日本語 English

Creating Sysmac Studio Trace Data with RecSSConvert (2/4)

Record settings

Here the following data is traced, output to files and then imported into Sysmac Studio data trace

Trace data
Data to trace16 bits, plus one each of INT, DINT, LINT, REAL and LREAL
Number of buffer elements10,000
Number of buffers2
Trace period2ms

The record start flag accumulates data in the first buffer
When data reaches the end of the buffer, it switches to the second buffer and accumulates data
When the buffer switches, the buffer is written to SD with the FileWriteVar instruction

Step 1: Create the Buffers

1-1. Create the buffer structure

Sysmac Studio data types
RecSSConvert create buffer structure

Create the sData structure to hold the data you want to trace
Put the Data structure into a double-buffer structure and set the array to the size needed for buffering
The number of array elements is the buffer size

Structures
NameData typeDescription
sDataSTRUCTBuffer
RecTimeDATE_AND_TIMETime of day
SamplingNoUINTSampling No.
IdxUINTIndex
BBOOL[16]16 BOOLs
INT16INTInteger 16-bit
INT32DINTInteger 32-bit
INT64LINTInteger 64-bit
RREALReal types
LRLREALReal, double precision

1-2. Create the buffers

Sysmac Studio create buffers in the variable table
RecSSConvert create buffers

Create the buffer variables named Data0 and Data1
Each is an array of sData structures with 10,000 elements

Step 2: Create the PLC Program

2-1. Add data to the buffer

Sysmac Studio data addition ladder
RecSSConvert data addition ladder

Create a single sData variable named RecData
Turning ON the record start flag (Rec) sets the data to trace into RecData
and the RecData with data set is added to the buffer with the RingBufPut function
Here global variables named Dummy... are used as the data to trace

2-2. When the buffer is full

Sysmac Studio buffer full ladder
RecSSConvert when the buffer is full

When the buffer is full, a file name is created and a command is issued to write the buffer to SD with the FileWriteVar instruction
At the same time the buffer is switched, so recording continues in the other buffer even while the file is being written
Switching and writing are repeated whenever the buffer is full

On the next page

Convert the output files to data trace CSV files with SSConvert

Comments