Topic: P053

Data Logger

Data Logger allows logging of system errors and up to 64 tag values on a USB storage device connected to the CPU. Logging can be triggered by the rising edge transition of a BooleanTag (Event) or can be configured to occur at regular intervals (Scheduled).


Data logging conceptually provides a historical record, rather than live access to data.

A USB storage device should be normally connected if logging data.  The CPU maintains an internal 73KB buffer for temporarily logging data while no USB storage device is present.  Data in the buffer will not be retained through a power cycle.

Recommended data logging rate should not exceed once per second, 2kB per second. Logging rate will be affected by CPU scan time and SD card behavior.

Note: P Series CPUs ONLY support up to a 32GB FAT formatted USB pen drive (P3 Series) or MicroSD card (P1 and P2 Series).


Note: P Series CPUs ONLY support a maximum of 200 files on a portable memory device, regardless of file size. Keep this in mind when scheduling new CSV file creation.


Note:  To avoid data corruption, use the Remove Pen Drive Now function of the P2 CPU &P3-550(E) Front Panel LCD Display menu or use the Portable Memory Device Eject system tag when removing a USB device from a running P2 CPU or P3-550(E).


Note:  With the P3-530 & P1 CPU, to avoid data corruption, use the system tag "Portable Memory Device Eject" when removing a USB device while the CPU is running.


Accessing Data Logger

There are three methods to access the Data Logger menu item.

Method 1


Select the Data Logger menu item from the Setup Menu of the Main Menu.

Method 2


Select Data Logger from the Monitor & Debug topics of the Application Tools panel.

Method 3

Select the Data Logger icon located on the Monitor Toolbar. Once selected, a Data Logger window will open as shown below.

Setting up Data Logger

The Data Logger window provides the following:

  1. Event Data Logging:  Select Event Data Logging to log all 0-1 (off to on) transitions based on the ON status of a specific Boolean Tag (bit). The Event Logging starts immediately once the project has been transferred to the CPU.

Note: If event logging is selected and data log buffer reaches 512 bytes of data, then the buffer will write 512 bytes segments to the pen drive (unless pen drive is not present), in attempt to lower data log buffer below 512 bytes. However, how fast the buffer is filled is dependent on the frequency of event, the number of tags, and data types of these tags selected for logging.

  1. Event Bit Tag Name:  Used when Event Data Logging (Item "a" in the diagram shown above) is selected. Enter or select a Boolean Tag for triggering logging.
     
  2. Scheduled Data Logging:  Select Scheduled Data Logging to log data based on a time interval. Select from the following:
  1. Log System Errors, Events & File Name: Select to log system errors, events and enter a file name for logging the systems errors and events. This function will create a text file containing system errors and events with the time and date the error or event occurred.  
  2. USB Device File Name:  Enter the prefix of the file name for Data Logger to create.  The name entered will always be appended by “-MMDDhhmm.csv” where the time and date are the CPU time and date of the first entry.  The CPU will create a “LOGS” folder on the USB storage device and save the log file there.

Note: If no file name is given then a default of DL is added as a prefix of the logged file.

  1. Schedule Interval:  Used to create new files, at Scheduled Intervals, into which data is logged. The name will be the same, but with a new date and time stamp. To prevent loss of buffered data, there must be a USB storage device installed during a scheduled CSV file name change.  Select from the following:

Note: A new log file will be generated in the below cases. If a scheduled interval is chosen these cases are still applicable:

1) Stop -> Run (including power up)

2) New Config [New Project] sent to CPU (Run or Stop Mode transfers)

3) Pen drive eject

4) Set Date/Time

5) Scheduled file name change

The below features are only available with P1-622, P2-622 and newer (next-generation) CPUs.

  1. File Created Status: (Boolean Tag) The bit turns ON when a new file is created. It does not go OFF again unless it is turned OFF by the ladder code.
  2. Note: A boolean tag must be created in TagDB prior to being assigned to this field.

  3. Remove oldest file when storage device reaches the file count limit: When selected the oldest file will be deleted to make room for a new file, before the user specified file limit is reached. Enter a value between 1 and 199.

Below is an example using a discrete bit to trigger the Portable Memory Device Eject System Bit. Use an edge-triggered contact to SET the Portable Memory Device Eject bit. Once the SET goes high, the Portable Memory Device Ready bit will go low and the Portable Memory Device Eject bit will reset itself.

Note: RST instruction is not required.


Note: After Portable Memory Device Eject has occurred, remove and re-insert the memory device for it to become ready again.

  1. Tagnames To Log: Enter up to 64 Tagnames (32 per column) to be monitored.