Mpx.UserLimit userLimit = controller.Axis[0].UserLimit[0];
userLimit.ConfigurationReset(); // Reset user limit configuration before configuring it userLimit.ConfigurationBegin(); // Begin configuration
// Configure user limit
userLimit.TriggerType = Mpx.UserLimitTrigger.SingleCondition; userLimit.ConditionType[0] = Mpx.UserLimitConditionType.ActualPosition; userLimit.ConditionAxis[0] = controller.Axis[0].Number; userLimit.ConditionLogic[0] = Mpx.UserLimitLogic.AbsLe; userLimit.ConditionPosition[0] = 1000;
userLimit.OutputType = Mpx.UserLimitOutputType.Custom;
userLimit.OutputAddress = outputLocation; // VM3 address
userLimit.OutputIsSingle = FALSE;
userLimit.OutputNewValueInt32 = (int)newUserBufferValue;
userLimit.OutputAndMask = 0;
userLimit.OutputOrMask = (uint)newUserBufferValue;
userLimit.GenerateEvent = true;
userLimit.Action = Mpx.Action.None;
userLimit.ConfigurationEnd(); // Writes configuration to the controller
|