using RSI.RapidCode.dotNET;
using NUnit.Framework;
using System;
#if DOXYGEN
#endif
[TestFixture]
[Category("Software")]
public class MotionHold : SampleAppTestBase
{
public void MotionHoldByDigitalInput()
{
const int DIGITAL_INPUTS_PDO_INDEX = 3;
}
[Test]
public void MotionHoldByPosition()
{
const double TRIGGER_POS = 1;
const int MOVING_AXIS_TARGET = 10;
const int HOLDINGAXIS_TARGET = 2;
Axis holdingAxis = controller.
AxisGet(Constants.HOLDING_AXIS_INDEX);
Axis movingAxis = controller.
AxisGet(Constants.MOVING_AXIS_INDEX);
}
[Test]
public void MotionHoldBySoftwareAddress()
{
int WAIT_TIME = 10;
int MOVE_DIST = 2;
if (controller.
MemoryGet(SOFTWARE_ADDRESS) != 0x0)
{
}
System.Threading.Thread.Sleep(WAIT_TIME);
System.Threading.Thread.Sleep(WAIT_TIME);
Assert.That(expectedCmdPos1, Is.EqualTo(0));
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.