using System.Threading;
Console.WriteLine("📜 IO: Sync Outputs");
Axis axis = controller.
AxisGet(Constants.AXIS_0_INDEX);
try
{
const int TOTAL_POINTS = 4;
const int EMPTY_CT = -1;
const int OUTPUT_INDEX = 0;
const int NODE_INDEX = 0;
double[] positions = [1.0, 2.0, 3.0, 4.0];
double[] times = [0.5, 0.1, 0.2, 0.4];
int outputEnableID = 2;
int outputDisableID = 3;
Console.WriteLine($"Starting streaming motion with {TOTAL_POINTS} points");
Console.WriteLine($"Output will go HIGH at element ID {outputEnableID}");
Console.WriteLine($"Output will go LOW at element ID {outputDisableID}");
axis.
MovePT(
RSIMotionType.RSIMotionTypePT, positions, times, TOTAL_POINTS, EMPTY_CT,
false,
true);
{
bool outputState = output0.
Get();
Console.WriteLine($"Motion Element: {currentElement}, Output State: {outputState}");
Thread.Sleep(50);
}
}
finally
{
}
static void ConfigurePhantomAxis(Axis phantomAxis)
Configures a phantom axis on the controller.
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Helpers class provides static methods for common tasks in RMP applications.
uint16_t MotionIdExecutingGet()
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.
bool Get()
Get the state of Digital Input or Output.
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.
NetworkNode * NetworkNodeGet(int32_t nodeNumber)
NetworkNodeGet returns a pointer to a RapidCodeNetworkNode object using its node number and initializ...
static MotionController * Get()
Get an already running 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 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.
bool MotionDoneGet()
Check to see if motion is done and settled.
RSIMotionType
PT and PVT streaming motion types.