Operating principle

Data is recorded on the MOVI-C® CONTROLLER in single-shot mode using the RealTimeScope function block. The data is saved in a CSV file on a Windows system (e.g. Windows part of the MOVI-C® CONTROLLER or external PCs). For storage, the function block provides a buffer variable that is used to exchange one line of the CSV file at a time. Also included are other variables for the handshake and progress information to control the transfer. Data is exchanged via a standardized communication protocol such as CODESYS ARTI.

To log data, the application program must provide the RealTimeScope function block with a ring buffer in the form of a static array. The shortest possible sampling interval is the cycle time of the HighPrio task of the application program, but can also be any integer multiple of the cycle time. Since the size of REAL variables is 4 bytes, the buffer size in bytes must be an integer divisible by 4. On the one hand, the necessary buffer size depends on the sampling interval, the desired recording duration and the number of channels to be recorded (max. 8); on the other hand, it should be selected so that it only occupies as much storage as absolutely necessary.

The required buffer size in bytes is calculated as follows:

For example, the following buffer size is required for 4-channel recording with a sampling interval of 1 ms and a recording time of 5 s:

Various variables are provided in the Measurement structure for transferring the CSV file from the MOVI-C® CONTROLLER to the connected Windows system. See chapter Measurement.

If a recording is successful, a CSV file is provided for transfer. The transfer takes place line by line. In each cycle, the RealTimeScope function block first checks the status of the variable INOUT.xNewData. If this variable has the value "FALSE", the receiver side is ready. In this case, one line of the CSV file is written to the variable OUT.abyLineBuffer and the variables OUT.diLines2Transfer and OUT.diLinesTransferred are set to the corresponding values. The variable INOUT.xNewData is then set to "TRUE" to signal to the receiver side that a new line is ready for transfer. As soon as the receiver side has fetched the line, it must set the variable INOUT.xNewData to "FALSE" to signal to the function block that the next line can be transferred. This procedure is repeated until all lines of the file have been successfully transferred.