39using RSI.RapidCode.dotNET;
50public class MotionHold : SampleAppTestBase
52 public void MotionHoldByDigitalInput()
56 const int DIGITAL_INPUTS_PDO_INDEX = 3;
86 public void MotionHoldByPosition()
90 const double TRIGGER_POS = 1;
91 const int MOVING_AXIS_TARGET = 10;
92 const int HOLDINGAXIS_TARGET = 2;
96 Axis holdingAxis = controller.
AxisGet(Constants.HOLDING_AXIS_INDEX);
99 Axis movingAxis = controller.
AxisGet(Constants.MOVING_AXIS_INDEX);
123 public void MotionHoldBySoftwareAddress()
138 if (controller.
MemoryGet(SOFTWARE_ADDRESS) != 0x0)
140 controller.
MemorySet(SOFTWARE_ADDRESS, 0x0);
147 System.Threading.Thread.Sleep(WAIT_TIME);
152 controller.
MemorySet(SOFTWARE_ADDRESS, 0x1);
154 controller.
MemorySet(SOFTWARE_ADDRESS, 0x0);
160 System.Threading.Thread.Sleep(WAIT_TIME);
163 controller.
MemorySet(SOFTWARE_ADDRESS, 0x1);
165 controller.
MemorySet(SOFTWARE_ADDRESS, 0x0);
175 Assert.That(expectedCmdPos1, Is.EqualTo(0));
176 Assert.That(expectedCmdPos2, Is.EqualTo(MOVE_DIST));
static void CheckErrors(RapidCodeObject rsiObject)
Check if the RapidCodeObject has any errors.
Helper Functions for checking logged creation errors, starting the network, etc.
double CommandPositionGet()
Get the current command position.
void MoveRelative(double relativePosition, double vel, double accel, double decel, double jerkPct)
Command a relative point-to-point S-Curve motion.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
void MemorySet(uint64_t address, int32_t data)
Write a value to controller memory.
uint64_t AddressGet(RSIControllerAddressType type)
Get the an address for some location on the MotionController.
int32_t MemoryGet(uint64_t address)
Read controller memory.
uint64_t NetworkInputAddressGet(int32_t index)
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
void MotionHoldAxisPositionSet(double position)
Sets the Axis position.
void Abort()
Abort an axis.
int32_t MotionDoneWait()
Waits for a move to complete.
void MotionHoldUserMaskSet(int32_t holdMask)
Sets the Motion Hold User bit mask.
void MotionHoldUserPatternSet(int32_t pattern)
Sets the Motion Hold User pattern bit mask.
void MotionAttributeMaskOffSet(RSIMotionAttrMask maskOff)
Turn off a particular motion attribute mask.
void MotionHoldTypeSet(RSIMotionHoldType type)
Set the motion hold type.
void MotionHoldAxisNumberSet(int32_t number)
Sets the Axis number for Motion Hold.
void MotionHoldUserAddressSet(uint64_t address)
Sets the Motion Hold User Address.
int32_t NumberGet()
Get the axis number.
void MotionAttributeMaskOnSet(RSIMotionAttrMask maskOn)
Turn on a particular motion attribute mask.
void MotionHoldAxisLogicSet(RSIUserLimitLogic logic)
Set the logic when holding for Axis ActualPosition.
RSIControllerAddressType
Used to get firmware address used in User Limits, Recorders, etc.
RSIUserLimitLogic
Logic options for User Limits.
RSIMotionAttrMask
Attribute masks for motion. You cannot mix RSIMotionAttrMaskDELAY and RSIMotionAttrMaskAPPEND.
RSIMotionHoldType
Types for MotionHold attribute.