OSD

How to Make an SS Recorder (1/4)

Overview

We create a recorder that outputs files that can be imported into Sysmac Studio data trace
The traced data is kept in a ring buffer (in memory) and output to a file at any time
Use it for debugging, analysis when faults occur and so on

Related page → Continuous output in Sysmac Studio data trace file format

Purpose

Preparation

Output file format

Output matches the file format exported by Sysmac Studio data trace (it may change in future versions)

Trace data

Set the data to trace in structure sData

sData STRUCT

RecTime

DATE_AND_TIME

Variable 1

INT etc.

...

Max. 191 (*1)
*1 In Sysmac Studio data trace, the number of variables is 192 for NJ501 and NX701 and 48 for others,
but files made here, even with data traced on an NX102 etc., can be imported by changing the project model to NJ501 or NX701

RecTime (DATE_AND_TIME) is required to create a data trace file, so always include it
Set the other members freely to the variables you want to trace

Traceable data types Basic data types (except strings)
Arrays (with number of elements specified)
Enumerations
Structures/unions (with members specified)


In this navigator, the following data is traced

Structures

Ring buffer capacity

Trace data is recorded in a ring buffer
The ring buffer is constantly updated and old data is overwritten, so the period that can be recorded depends on its capacity
You want it as large as possible, but the PLC system has the following limits, so decide the ring buffer capacity within them

Item Limit Relationship with the ring buffer
Variables 4MByte(4,194,304byte) Total ring buffer capacity
Number of buffers 65535 Number of sData records

Reference
The ring buffer capacity when multiple INT values are set as trace data, by number of buffers, is as follows
Ring buffer structure


Setting the trace data made in this navigator in a ring buffer with 65535 array elements gives a capacity of about 3.25 MB
(check in Memory Usage)

Ring buffer structure

Memory usage


Trace period

The trace period can be anything
Data is added to the ring buffer at the period you want to trace


In this navigator, tracing uses the primary task period (2 ms)

Trace duration

The duration that can be saved is determined by the trace period and the number of buffers (array elements) in the ring buffer
Trace period × number of buffers = trace duration
(Example) 2 ms × 65534 = 131068 ms = approx. 2 m 11 s

Reference
Relationship between trace period and trace duration by number of buffers
Ring buffer structure

From the next page,

We explain how to create the SS recorder program step by step

Download

If you want to download the project made here first,
naviRecorderSS.zip

By downloading, you are deemed to have agreed to the Terms of Use