Add an event command to export a data log

Create an event command to export a data log to view the tag values collected on the HMI device. When triggered on the HMI device, the event exports all of the data logs in the
View Designer
project. Data logs export to a USB storage device or SD card for a
PanelView
project as a .zip file. The .zip file contains a .csv file for each data log.
For a
PanelView
project, create an additional event to allow the safe removal of the removable media from the HMI device so that files on the media do not become corrupt.
Prerequisites
Create an event to trigger the command:
  • Touch press.
    Occurs when touching the item on the screen that is configured with the event.
  • Touch release.
    Occurs when releasing the item on the screen that is configured with the event.
  • Key press.
    Occurs when pressing the specified key.
  • Key release.
    Occurs when releasing the specified key.
  • Button behavior
    Occurs when releasing the button.
  • Project event
    Occurs when the executing condition is met.
To add event commands to export a data log
  1. Select the graphic element configured with the touch or key event.
  2. In the
    Properties
    pane on the
    Events
    tab, select
    Add Command
    .
  3. Expand the
    Data Log
    category and select and configure the command:
  • Export Data Log
    . Creates and exports each data log in .csv format to a .zip file:
    • In the
      Destination
      box of the command card, select
      USB
      or
      SD Card
      for a PanelView project.
    • In the
      FileName
      box, type the name of the export .zip file for the data log.
  • Cancel Data Log Export.
    Cancels the export of the data log to the HMI device. Partial data logs do not export. No .zip file appears in the destination.
    TIP:
    Tips:
    • Bind the
      FileName
      box of the Export Data Log event command to a graphic element property or a tag in a controller. Binding the file name specifies the data log to export on the HMI device. For example, bind the
      FileName
      box of the Export Data Log event command to the text property of Text Input graphic element. This displays the name of the data log on the Text Input graphic element that exports the data log from the HMI device.
    • Exporting the same data log file to the same removable media creates a new export file each time. The file name increments by one. This may cause the USB storage device, SD card, or destination to reach capacity. For example, DataLog_002 indicates a second instance of an exported data log named DataLog.
    • When the data log is exporting, the
      Data Export
      icon Data Log Exporting
      appears in the
      System Banner
      . If there is an error exporting a data log, the
      Data Export Error
      icon Data Log Error
      appears in the
      System Banner.
    • Data log exports do not complete or create a .zip file on removable media if a ControlFLASH, reboot, or power cycle to the HMI device occurs during the export.
    • The data log file contains tag values from all controllers.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal