24#include "SampleAppsHelper.h"
25#include "SampleApps.h"
30int MotionHoldReleasedBySoftwareAddress::Run()
37 const int AXIS_COUNT = 1;
38 const int AXIS_NUMBER = 0;
40 const double USER_UNITS = 1048576;
43 const int USER_BUFFER_INDEX = 0;
46 const double MOTION_DISTANCE = 0.25;
48 const std::chrono::duration HOLD_TIME = std::chrono::milliseconds(2000);
55 const char rmpPath[] =
"C:\\RSI\\X.X.X\\";
96 if (controller->
MemoryGet(userBufferAddress) != 0x0)
98 controller->
MemorySet(userBufferAddress, 0x0);
102 printf(
"\nCommanding Motion...\n");
106 printf(
"\nSetting Motion Hold...\n");
110 printf(
"Commanding Motion...\n");
112 std::this_thread::sleep_for(HOLD_TIME);
115 printf(
"Releasing Motion Hold...\n");
116 controller->
MemorySet(userBufferAddress, 0x1);
118 controller->
MemorySet(userBufferAddress, 0x0);
121 printf(
"\nClearing Motion Hold...\n");
125 printf(
"Commanding Motion...\n");
135 printf(
"%s\n", err.text);
void UserUnitsSet(double countsPerUserUnit)
Sets the number of counts per User Unit.
void ErrorLimitTriggerValueSet(double triggerValue)
Set the Position Error Limit trigger value.
void PositionSet(double position)
Set the Command and Actual positions.
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.
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
void AmpEnableSet(bool enable)
Enable all amplifiers.
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 MotionHoldUserAddressSet(uint64_t address)
Sets the Motion Hold User Address.
void MotionAttributeMaskOnSet(RSIMotionAttrMask maskOn)
Turn on a particular motion attribute mask.
Represents the error details thrown as an exception by all RapidCode classes. This class contains an ...
@ RSIControllerAddressTypeUSER_BUFFER
First location in User Buffer.
@ RSIMotionAttrMaskHOLD
Prevents the move from executing until a specific trigger condition is met. See MotionHold methods.
@ RSIMotionHoldTypeCUSTOM
static void SetupControllerForHardware(MotionController *controller)
Sets up the controller for hardware use by resetting it and starting the network.
static void CheckErrors(RapidCodeObject *rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
static void SetupControllerForPhantoms(MotionController *controller, int axisCount, std::vector< int > axisNums)
Sets up the controller for phantom axes, including configuring specified axes as phantom.