Executing Commands

After opening a cyclic buffer and adding commands, the cyclic buffer can be executed by calling the Execute function. The axis operation state will change to DirectControl and the cyclic buffer will start to execute. The state returned by the CyclicBuffer::GetStatus function will change from Stopped to ExecutingCommand.

After all the commands in the cyclic buffer have been executed, the state will change to WaitingForCommand. In this state, the cyclic buffer will immediately resume execution (and change to the ExecutingCommand state) when more cyclic commands are added.

Execution options may be specified by an optional CyclicBufferSingleAxisOption argument to the Execute function.

The maxAcc option can be set to specify a maximum acceleration for position commands. When the specified maximum acceleration is exceeded, the axis is stopped using the quick stop deceleration (Quick Stop Dec), the state will change to MaxAccError, and any remaining cyclic commands in the cyclic buffer are cleared. This option is only compatible with AbsolutePos and RelativePos cyclic commands and will have no effect on Vel and Trq cyclic commands.

While executing the cyclic buffer, if a cyclic command with a CyclicBufferCommandType that does not match the Axis Command Mode of the axis is encountered, the execution is immediately aborted, the state will change to CommandModeMismatchError, and any remaining cyclic commands in the cyclic buffer are cleared.