Console.WriteLine("📜 User Limit: Digital Input One Condition");
MotionController controller = MotionController.Get();
try
{
controller.UserLimitCountSet(1);
controller.InterruptEnableSet(true);
controller.UserLimitConditionSet(
number: 0,
conditionNumber: 0,
userLimitMask: (uint)input0.
MaskGet(),
limitValueUInt32: (uint)input0.
MaskGet());
controller.UserLimitConfigSet(
number: 0,
actionAxis: 0,
duration: 0);
controller.UserLimitOutputSet(
number: 0,
enabled: true);
Console.WriteLine("Waiting for input trigger...");
throw new Exception("ERROR: Output should not be triggered yet");
controller.MemorySet(input0.
AddressGet(), 0b0001);
if (controller.InterruptWait(1000) !=
RSIEventType.RSIEventTypeUSER_LIMIT)
throw new Exception("ERROR: User limit did not trigger when input was high");
throw new Exception("ERROR: Output should be high after user limit triggered");
Console.WriteLine("✓ User limit triggered successfully - input high, output activated");
controller.UserLimitDisable(0);
controller.UserLimitCountSet(0);
Console.WriteLine("\nUser limit digital input one condition complete.");
}
finally
{
controller.Delete();
}
uint64_t AddressGet()
Get the Host Address for the I/O point.
void Set(bool state)
Set the state of a Digital Output.
static IOPoint * CreateDigitalInput(Axis *axis, RSIMotorDedicatedIn motorDedicatedInNumber)
Create a Digital Input from an Axis' Dedicated Input bits.
static IOPoint * CreateDigitalOutput(Axis *axis, RSIMotorDedicatedOut motorDedicatedOutNumber)
Create a Digital Output from an Axis' Dedicated Output bits.
bool Get()
Get the state of Digital Input or Output.
int32_t MaskGet()
Get the bit mask for the I/O point.
Represents one specific point: Digital Output, Digital Input, Analog Output, or Analog Input....
RSIControllerAddressType
Used to get firmware address used in User Limits, Recorders, etc.
RSIEventType
Event Types or Status Bits.
RSIUserLimitLogic
Logic options for User Limits.
RSIAction
Action to perform on an Axis.
RSIUserLimitTriggerType
Trigger types for UserLimits.
Helpers namespace provides utility functions for common tasks in RMP applications.