Streaming Motion Sync Outputs

What are Streaming Motion Sync Outputs?

Streaming motion Sync Outputs allow you to change the state of a digital output(s) at a precise moment in Axis or MultiAxis streaming motion (PT, PVT, or PVAJT).

Why use Streaming Motion Sync Outputs?

Streaming motion Sync Outputs make it easy to change any Digital Output state based on a specified point index (or ElementID), commonly used where precise coordination of motion and Digital Output states are required. For example, triggering a strobe at precise positions.
EXAMPLE 1
If I make a MovePT() call that contains 5 different motion points. By using StreamingOutputAdd() I can set a specified digital output true/high during the 4th motion point.
Therefore, if our motion points look like:
1st
2nd
3rd
4th
5th
← motion points
Position[5] =
{1,
2,
4,
10,
14}
← in user counts
Times[5] =
{1,
1,
1,
2,
2}
← in seconds
When it gets to position 10 (or the 4th motion point) the specified output will change its state.
A motion point in MovePT() refers to a point that contains Position and Time. If there are 5 motion points, then there are 5 positions with 5 times.
Motion points are zero ordinate. Therefore, if you wish to add a sync output on the 1st motion point you should refer to it as “ElementID 0”. Moreover, if you wish to add a sync output on the 2nd motion point you should refer to it as “ElementID 1”.

Sync Outputs Functions

The Streaming Motion Sync Output List is maintained as an array and index and this function will reset the current index to 0. However, the array backing is not freed. You are allowed to Clear the list as soon as the move method (MovePT(), etc.) returns.
Must be initialized.
This function will set whether Streaming Motion Sync Output(s) is/are enabled. If you are streaming continuous motion with many calls to MovePT (etc.) you must be sure to have the correct value for Enable for EACH call to MovePT().
Setting to:
FALSE - resets the current index to 0, and clears the vector backing.
TRUE - allows you to add the streaming motion sync output(s) into the frames created by the next MovePT() in firmware. Requires that the StreamingOutputs list size is greater than zero, or you will get a motion attribute invalid error.
Must be initialized.
StreamingOutputAdd applies the bitmasks "onMask" and "offMask" to the controller's memory address (IOPoint) when the controller reaches the specified streaming point index (or Element ID).
If you have enabled StreamingOutputs, then you must Add() at least one before calling MovePT (etc.) or you willl get an invalid motion attribute error.

Selecting the Right Element ID

For most Streaming Motion, you can use ElementID to determine where you are within a point set. ElementID 5 = Point 5. Element ID will match the point you provided. Streaming Motion using RSIMotionTypeBESSEL, RSIMotionTypeBSPLINE, and RSIMotionTypeBSPLINE2 involved carrying forward 1 point (Bessel, Bspline2) or 2 points (Bspline). It needs to do this for motion calculations.
Consider a Bspline streaming 100 points per chunk. Two would be carried forward each call. 98 would be associated with the first motion ID. 100 for each of the middle ones. 102 would be associated will the final group. For any middle or final chunk, if you wanted output to happen on the Nth element that you provided, you would add 1 (Bessel and Bspline2) or 2 (Bspline only) respectively to the Output Index. If you wanted an Output to take place on the 99th (Bspline only) or 100th logical user points, you would save it for the next chunk and put it at point 0 or 1.

Sync Outputs FAQ

What happens when I call StreamingOutputsEnableSet(true)?
When you call StreamingOutputEnableSet(true), all motion sync outputs that you add will get added to the frames which are created by MovePT (only MovePTs that have been called after calling StreamingOutputEnableSet(true)). It does not interfere with motions that have already been queued, loaded, or running.
After you call your move method (MovePT(), etc.), the StreamingOutputs will be copied inside the library and then automatically streamed/buffered to the RMP as frames with motion. You are allowed to clear or disable StreamingOutputs as soon as the move method returns.