Opening and Closing the Cyclic Buffer

When the WMX3 engine is started, no cyclic buffers are opened. To use the cyclic buffer function for an axis, a cyclic buffer must be opened for that axis.

To open a cyclic buffer, call the OpenCyclicBuffer function. The cyclic buffer is a ring buffer with each element corresponding to the cyclic command for one cycle. The size of the cyclic buffer is specified by an argument to the OpenCyclicBuffer function.

For example, a cyclic buffer with a size of 1000 will be able to hold up to 1000 cycles worth of cyclic commands at any time. If the cycle time is 0.5ms, the cyclic buffer will be able to hold up to 1000 * 0.5ms = 0.5 seconds of cyclic commands.

As cyclic commands in the cyclic buffer are executed, the space that the cyclic commands occupied are freed. New commands may be dynamically added to the freed space while cyclic commands are being executed, allowing commands to be executed indefinitely even with a finitely sized cyclic buffer.

An opened cyclic buffer can be closed with the CloseCyclicBuffer function. A closed cyclic buffer can be reopened with a different size.

Opening and closing a cyclic buffer is one of the few operations that dynamically allocate or deallocate memory (see Function Calls Related to Memory Allocation).