OSD

How to Make an SS Recorder (4/4)

Step 5: Create Test Data

  • 5-1. Union

  • To create 16 bits of bit data for the test data, create a WORD union and split it into bits

    Name Data type
    uWORD UNION

    W

    WORD

    B

    BOOL[16]

  • 5-2. Add a program

  • Add a program to create test data
    Create an angle in variable R that rotates 0.8 degrees every scan
    Put sine curve data of angle R into DummyInputLReal
    Convert this DummyInputLReal to INT, DINT, LINT, WORD, BOOL and String types to create test data

  • 5-3. Task assignment

  • Assign the test data creation program to the primary task

Step 6: Test

  • 6-1. Create trace data

  • 1. Turning ON the record start flag (Rec) accumulates record data in the ring buffer
    2. The number of records can be checked in RecBuffer.Count; when it reaches 65535, the newest data overwrites the oldest, leaving the most recent 65535 records in the ring buffer
    3. Turn the record start flag (Rec) OFF to stop recording for now
    4. Turning ON the record write flag (RecWrite) to write the ring buffer data to files starts writing, and the RecBuffer.Count decreases
    5. When RecBuffer.Count reaches zero, all data has been written to files, so turn the record write flag (RecWrite) OFF
    6. The Rec folder on the memory card now contains 65535 records split into six files of 10,000 records and one file with the remaining 5535 records

  • 6-2. Import into Sysmac Studio data trace

  • 1. Copy the files created in 6-1 to the PC
    2. Add a new data trace in Sysmac Studio
    3. Import the files copied to the PC with the import button on the data trace screen
    4. If the primary task period is 2 ms, 20 seconds of data is displayed

This completes how to make the SS recorder

The data you want to trace can now be displayed in Sysmac Studio data trace
It could be used, for example, by stopping the trace when a fault occurs and displaying it in Sysmac Studio

Download

Projects made so far
naviRecorderSS.zip

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