23#include "SampleAppsHelper.h"
24#include "SampleApps.h"
29int SingleAxisSyncOutputs::Run()
36 const int AXIS_COUNT = 1;
37 const int AXIS_NUMBER = 0;
39 const double USER_UNITS = 1048576;
42 const int NODE_INDEX = 0;
43 const int OUTPUT_INDEX = 0;
45 const int OUTPUT_ENABLE_ID = 2;
46 const int OUTPUT_DISABLE_ID = 3;
49 const int TOTAL_POINTS = 4;
50 const int EMPTY_CT = -1;
51 const double POSITIONS[] = { 0.25, 0.50, 0.75, 1.0 };
52 const double TIMES[] = { 0.5, 1.0, 1.5, 2.0 };
59 char rmpPath[] =
"C:\\RSI\\X.X.X\\";
104 printf(
"Motion started. Waiting to complete.\n");
107 printf(
"Motion Complete. The outputs should have been set\n");
115 printf(
"%s\n", err.text);
void UserUnitsSet(double countsPerUserUnit)
Sets the number of counts per User Unit.
void ErrorLimitActionSet(RSIAction action)
Set the action that will occur when the Error Limit Event triggers.
void PositionSet(double position)
Set the Command and Actual positions.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
void Set(bool state)
Set the state of a Digital Output.
static IOPoint * CreateDigitalOutput(Axis *axis, RSIMotorDedicatedOut motorDedicatedOutNumber)
Create a Digital Output from an Axis' Dedicated Output bits.
Represents one specific point: Digital Output, Digital Input, Analog Output, or Analog Input....
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
IO * IOGet(int32_t nodeNumber)
IOGet returns a pointer to an IO object using its node number and initializes its internals.
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 StreamingOutputAdd(int32_t onMask, int32_t offMask, uint64_t address)
void StreamingOutputsEnableSet(bool enable)
Sets whether Streaming Output is enabled (true) or disabled (false).
void MovePT(RSIMotionType type, const double *const position, const double *const time, int32_t pointCount, int32_t emptyCount, bool retain, bool final)
A move commanded by a list of position and time points.
Represents the error details thrown as an exception by all RapidCode classes. This class contains an ...
@ RSIMotionTypePT
simple Position and Time algorithm
@ RSIActionNONE
None - do not perform any action.
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.