Browse FAQs

How do you configure logging data to a CSV file in EcoStruxure Machine Expert?

Published date: 26 June 2020

How do you configure logging data from a Symbol to a CSV file in a EcoStruxure Machine Expert PLC like M241, M251 or M262?

Product Line
EcoStruxure Machine Expert
Modicon M241, M251, M262 Programmable Logic Controllers

PLC Configuration Software - Logic Builder

To configure logging data to file in EcoStruxure Machine Expert, follow these steps:
1) In Logic Builder of your project, go to the Tools tree
2) Right-click on the Application node of your PLC
3) Add a DataLogManager node. This will automatically add the SE_DataLogging library to the Library Manager of this controller
4) Under the DataLogManager node, add a LogFile node. The name that is assigned to this node will be the filename of the log file (e.g. "MyLogFile.log").
 In this node, you can choose the storage location (Internal Flash or SD Card), add date and time stamps, choose the maximum entries in the file, choose to use a circular buffer or not, and use a deliminating character for CSV format.
5) In a POU subroutine, add the LogRecord function block from the SE_DataLogging library
6) Name it the same as the LogFile node's name (MyLogFile)
7) Add a LogRecord.Dump, again with the same instance name (MyLogFile)
8) Tie the xDone output pin of the LogRecord block to the xExecute input pin of LogRecord.Dump
9) Assign the variable that you wish to log to the wsRecord input pin of the LogRecord block.
Note that an Integer or Floating point value must be converted to WSTRING type to be logged. This can be done with an INT_TO_WSTRING or REAL_TO_WSTRING conversion operator, for example, respectively.
10)  A rising edge to the xExecute input pin of the LogRecord block will cause the file to be written to.

The file can be accessed by the following steps:
1) Log in to the PLC
2) From the Devices Tree, double-click on the name of the Controller (MyController by default)
3) Go to the Files tab
4) On the right-pane, click the refresh button (spinning green arrows icon)
5) Open the "Log" folder from the PLC. There, you will see the log file.
6) On the left pane, select a destination folder on your PC
7) Click the [<<] button to move the file to your PC. This file can be renamed and opened as CSV in Excel for example.

For more information, please see EcoStruxure Machine Expert - Data Logging Functions - DataLogging Library Guide 

Was this helpful?

What can we do to improve the information ?

Can't find what you are looking for?

Reach out to our customer care team to receive information on technical support, assistance for complaints and more.