APIs, concepts, guides, and more

◆ StreamingOutputsEnableSet()

void StreamingOutputsEnableSet ( bool enable)
Description:
The Streaming Output List is maintained as an array and index and must be initialized before use. This function will set whether Streaming Output is enabled.
Note
You must call this function appropriately before EACH MovePT/MovePVT call:
- Set to true if the upcoming MovePT/MovePVT call has streaming outputs (and add at least one output)
- Set to false if the upcoming MovePT/MovePVT call has NO streaming outputs
Setting to false also clears the output list internally.
If set to true and no outputs are added, the move will throw an exception.
Parameters
enableEnable (true) or Disable (false) Streaming Output behavior.

Part of the Streaming Motion method group.

Sample Code:
IO: Input & Output
const int TOTAL_POINTS = 4; // total number of points
const int EMPTY_CT = 2; // number of points that remains in buffer before e-stop
const int OUTPUT_INDEX = 0; // digital output index that will be controlled
const int NODE_INDEX = 0; // the EtherCAT Node index
double[] positions = [1.0, 2.0, 3.0, 4.0]; // streaming motion positions
double[] times = [0.5, 0.8, 1, 0.5]; // streaming motion times
int outputEnableID = 2; // motion element ID at which to set output HIGH
int outputDisableID = 3; // motion element ID at which to set output LOW
// create IOPoint for digital output
IOPoint output0 = IOPoint.CreateDigitalOutput(controller.NetworkNodeGet(NODE_INDEX), OUTPUT_INDEX);
output0.Set(false); // set output low initially
// enable streaming/sync outputs
// configure sync outputs - turn output HIGH at motion element 2, LOW at motion element 3
axis.StreamingOutputAdd(output0, true, outputEnableID); // turn output HIGH at element ID 2
axis.StreamingOutputAdd(output0, false, outputDisableID); // turn output LOW at element ID 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}");
// start streaming motion
axis.MovePT(RSIMotionType.RSIMotionTypePT, positions, times, TOTAL_POINTS, EMPTY_CT, false, true);
// monitor motion and output state
while (!axis.MotionDoneGet())
{
int currentElement = axis.MotionElementIdExecutingGet();
bool outputState = output0.Get();
Console.WriteLine($"Motion Element: {currentElement}, Output State: {outputState}");
Thread.Sleep(50); // small delay to avoid overwhelming console
}
See also
StreamingOutputsEnableSet, StreamingOutputsClear, StreamingOutputAdd, Streaming Motion Sync Outputs
Examples
SingleAxisSyncOutputs.cpp, SyncOutputWithMotion.cpp, and io-sync-outputs.cs.