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;
IOPoint output0 = IOPoint.CreateDigitalOutput(controller.
IOGet(NODE_INDEX), OUTPUT_INDEX);
output0.Set(false);
axis.StreamingOutputsEnableSet(true);
axis.StreamingOutputAdd(output0, true, outputEnableID);
axis.StreamingOutputAdd(output0, false, outputDisableID);
axis.MovePT(
RSIMotionType.RSIMotionTypePT, positions, times, TOTAL_POINTS, EMPTY_CT,
false,
true);
while (!axis.MotionDoneGet())
{
if (axis.MotionIdExecutingGet() > outputEnableID && axis.CommandPositionGet() < outputEnableID)
{
Assert.AreEqual(output0.Get(), true, "The output should be triggered");
}
else
{
Assert.AreEqual(output0.Get(), false, "The output should NOT be triggered");
}
}
axis.StreamingOutputsEnableSet(false);
axis.AmpEnableSet(false);