APIs, concepts, guides, and more

◆ StreamingOutputsClear()

void StreamingOutputsClear ( )
Description:
This method will clear the contents of the Streaming Output List.
Note
Streaming outputs accumulate across MovePT/MovePVT calls and are NOT automatically cleared. You should call StreamingOutputsClear() after each MovePT/MovePVT call to ensure the next call starts with a fresh output list. Failing to clear can cause outputs from previous calls to interfere with new outputs.

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, StreamingOutputAdd, Streaming Motion Sync Outputs
Examples
SyncOutputWithMotion.cpp.