.

Best Practices when using the Data Recorder

It is possible to fill up a data recorder’s buffer on the controller if data is collected more slowly than it is generated. When the buffer on the controller fills up, the data collection will normally be suspended, not stopped. When data is later collected, the recorder buffer will no longer be full, and the data collection will resume.

NOTE: If MPIRecorderConfig.bufferWrap is TRUE, then the data collection will not be suspended. Please see the documentation for MPIRecorderConfig.bufferWrap for more information.

The consequences are that gaps in data can easily occur and easily be missed by an application. There are two ways to detect gaps:

  1. Record the controller’s sample counter.

    NOTE: WorkBench’s Scope and Motion Scope automatically perform this task do this behind the scenes and will properly display gaps in the data should they occur. It is not necessary to manually configure WorkBench’s Scope or Motion Scope to record the controller’s sample counter.

  2. Enable reporting of the “Recorder Buffer Full” event. If the event occurs, a gap will normally occur.

    NOTE: This method does not indicate where in the data stream that a gap occurred, only that a gap did occur.

Frequently Asked Questions

How may I reduce the chances that the recorder’s buffer will fill up?

A simple solution is to increase the size of the recorder’s buffer.
In the MPI, set the buffer size via MPIControlConfig.recordCount.
In the MPX, set the buffer size via Controller.RecorderBufferSize property.
This will not help if data needs to be collected over long periods of time and the application takes more time to collect and handle the data than controller does to produce it.

The other solution is to reduce the amount of time it takes the application to handle the data. A common method to do reduce this time is to read all the data into memory or onto a disk. Then after enough data has been collected, the application may analyze the data.

Is there any way to really stop the recorder in the case the recorder buffer becomes full without creating gaps in the data?

Yes. The recorder’s stop trigger must be configured to stop when the recorder is full. Currently, it is not possible to do this in the MPX. This is currently only possible in the MPI.

See Also

MPI
MPIControlConfig
MPIRecorderConfig

MPX
Controller.RecorderBufferSize
Recorder.SetTrace

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering