DLG (data log)

The DLG instruction writes variable values from the runtime engine into a data logging file on an SD card.
When writing to a data log, a maximum of 50 group folders are allowed each day. Each group folder has a maximum of 50 files, with a file size from 4k through 8k.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the L20E, L50E, and L70E controllers.
DLG
DLG
DLG parameters
Parameter
Parameter Type
Data Type
Description
Enable
Input
BOOL
Data logging write enable.
  • TRUE: Rising Edge Enable detected. Start the data logging operation when previous instruction operations are completed.
  • FALSE: Rising Edge not detected.
TSEnable
Input
BOOL
TRUE: Date and time stamp logging enable flag.
CfgID
Input
USINT
Data logging configuration VA ID number 1-10.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.
Status
Output
USINT
Current status of the instruction.
Data logging Status codes:
  • 0: Idle
  • 1: Doing
  • 2: Succeed. Indicates that data logging is completed.
  • 3: Error. Indicates that data logging is completed with errors.
ErrorID
Output
UDINT
A unique numeric error code for DLG.

DLG error codes

DLG error codes
Error code
Error Name
Comments
0
DLG_ERR_NONE
No error.
1
DLG_ERR_NO_SDCARD
SD card is absent.
2
DLG_ERR_RESERVED
Reserved.
3
DLG_ERR_DATAFILE_ACCESS
Access data logging file error.
4
DLG_ERR_CFG_ABSENT
Data logging configuration file is absent.
5
DLG_ERR_CFG_ID
Configure ID is absent in the data logging configuration file.
6
DLG_ERR_RESOURCE_BUSY
The data logging operation linked to this data logging ID is used by another FB operation.
7
DLG_ERR_CFG_FORMAT
Data logging configuration file format is not valid.
8
DLG_ERR_RTC
Real-time clock is not valid.
9
DLG_ERR_UNKNOWN
An unspecified error has occurred.

DLG examples

DLG function block diagram example
DLG function block diagram example
DLG ladder diagram example
DLG ladder diagram example
DLG structured text example
DLG structured text example
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal