APIs, concepts, guides, and more

◆ StreamingOutputAdd() [2/4]

void StreamingOutputAdd ( int32_t onMask,
int32_t offMask,
uint64_t address,
int32_t ptPointIndex )
StreamingOutputAdd will apply the bitmasks "onMask" and "offMask" to the specified address, setting high bits in the on mask to high, and the high bits in the off mask to low. ptPointIndex specified the MotionElementExecutingID at which the masks will be applied.
onMaskThe high bits of this bitmask sets the corresponding bits at the address high.
offMaskThe high bits of this bitmask sets the corresponding bits at the address low.
addressThe address at which to toggle bits
ptPointIndexThe MotionElementExecutingID at which to apply the masks. The valid range is from 0 to the last point index of the currently executing streaming move.

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 = -1; // Number of points that remains in the buffer before an e-stop
const int OUTPUT_INDEX = 0; // This is the index of the digital output that will go active when the user limit triggers.
const int NODE_INDEX = 0; // The EtherCAT Node we will be communicating with
double[] positions = { 1.0, 2.0, 3.0, 4.0 }; // These will be the streaming motion 5 positions.
double[] times = { 0.5, 0.1, 0.2, 0.4 }; // These will be the streaming motion 5 positions' time.
int outputEnableID = 2; // The motion element ID at which to set the output
int outputDisableID = 3; // The motion element ID at which to set the output
// Set up the inputs
// IOPoint output0 = IOPoint.CreateDigitalOutput(axis, RSIMotorGeneralIo.RSIMotorGeneralIo16); // Retrieve DOUT 1, Method 1: requires you know the io adress in memory, slightly faster
IOPoint output0 = IOPoint.CreateDigitalOutput(controller.NetworkNodeGet(NODE_INDEX), OUTPUT_INDEX); // Retrieve DOUT 1 Method 2: only need to know node index
output0.Set(false); // Set the output low
// Set up Sync Outputs
axis.StreamingOutputsEnableSet(true); // Enable streaming output.
// ENABLE the Sync Output(s)
axis.StreamingOutputAdd(output0, true, outputEnableID); // This will turn DOUT1 High when the streaming motion reaches its 3rd motion point.
axis.StreamingOutputAdd(output0, false, outputDisableID); // This will turn DOUT1 Low when the streaming motion reaches its 4th motion point.
// DISABLE the Sync Output(s)
// axis.StreamingOutputAdd(output0, false, outPutEnableID);
axis.MovePT(RSIMotionType.RSIMotionTypePT, positions, times, TOTAL_POINTS, EMPTY_CT, false, true); // Start Streaming Motion
while (!axis.MotionDoneGet())
if (axis.MotionIdExecutingGet() > outputEnableID && axis.CommandPositionGet() < outputEnableID)
Assert.That(output0.Get(), Is.EqualTo(true), "The output should be triggered");
Assert.That(output0.Get(), Is.EqualTo(false), "The output should NOT be triggered");
axis.StreamingOutputsEnableSet(false); // Disable Sync Outputs.
axis.AmpEnableSet(false); // Disable the motor.
The points need to be added sequentially.
See also
StreamingOutputsEnableSet, StreamingOutputsClear, StreamingOutputAdd, MotionIdExecutingGet, MotionElementIdExecutingGet, IO, IOPoint