Access the Configuration

Access the data logging parameters:

Step

Action

1

Access the DTM configuration for your module.

2

In the DTM Browser, double-click the DTM that corresponds to the BMENOR2200H module to access its configuration parameters.

3

In the CONFIGURATION menu, select Data Logging.

Configuration Instructions

Configure data logging in the DATA LOGGING PARAMETERS fields:

Step

Action

1

Enter the destination of the .stu file in the Application Path field.

NOTE: You can use the Browse button to navigate to a file destination.

2

Assign a name in the Table Name field.
NOTE: You can enter a maximum of 31 characters in this field.

3

Press the Add button to create the log table.

4

Confirm that the new log table is created:
  • The new table appears in the LOG TABLES field.

  • Expand the structure (CONFIGURATION > Data Logging) to see the name of the new table.

5

Click the OK or Apply button to implement the changes.

Data Logging Parameters

LOG PARAMETERS: Expand (+) Data Logging in the CONFIGURATION menu and select a table to access these parameters:
Parameter Description
Maximum Records
Enter the maximum number of records that can be stored in a log table.
NOTE: When the configured number of records are logged, the newest records overwrite the oldest records.
Log Period
Use these values to enter an interval after which the backup is triggered:
  • Disable the period backup: 0

  • Configure the interval.

  • Configure the time unit of log period.

Time Unit of Log Period

Select the unit of time to apply.

Backup On Full

Check this box to trigger a backup when the log table is full (at its maximum configured capacity).

Time Stamp

Check this box to add a time stamp for each log record.

LOG VARIABLES: You can access these parameters only after you create a data logging table (above).
Parameter Description

Add

Click this button to open the Global Variables dialog box and add new variables to the LOG VARIABLES table.

Variable Name

This column shows the names of the added variables.

Type

This column shows the type that corresponds to the configured variables.

Delete

Click this button to remove the selected variable from the table.

Import

Import the selected variable.

Export

Export the selected variable.

Total Variable Count

This field shows the total number of variables in the table.

BACKUP PARAMETERS:
Parameter Description

Backup Period

Use these values to trigger the table backup or configure a periodic event. In this case, configure the time base:
  • Disable the period backup: 0

  • Configure the interval: 30 min ... 100 days

Backup Estimated Time

This is the maximum estimated amount of time that elapses before the backup data is lost (overwritten by new backup data).

Erase on Restart

Check this box to delete the table log files in the SD card upon a restart of the module.

Time Unit of Backup Period

Select the unit of time to apply.

Maximum File Number

Use these values to define the maximum number of backup files for this table:
  • default value: 10

  • maximum backup file count: 200

Backup Maximum Size

Data logging files are stored in the SD card, and the maximum size of an SD card is 4GB. When you build a new data logging table, the maximum size of the table is fixed. This number comes from the DTM, which uses the following assessments to calculate the maximum folder size (backup folder in this case):
  • data type in table

  • the number of recorders in each file

  • the number of files in the SD card

Variables in the Device DDT

To access the variables in the device DDT for the module, open the Variables tab in the Project Browser (Project > Variables & FB instances > Device DDT Variables ).
Value Action

1

Open the Variables tab in the Project Browser (Project > Variables & FB instances > Device DDT Variables).

2

In the Name column, expand (+) the name of a module that is associated with a data logging table.

3

Find the name of the table and expand (+) it to access the structural elements that are described in the next table.

Structural elements:
Element Description

Enable

This value controls the data logging service for the selected table:
  • 0: disabled

  • 1: enabled

Records_count

This value represents the number of records in the selected table.

Backup_count

This value represents the number of backup files in the selected table.

Last_Log_Status

byte 0: trigger value (The action finished without the detection of an error.)

byte 1: trigger result (The SD card is not available.)

Last_Backup_Status

byte 0: trigger value (The action finished without the detection of an error.)

byte 1: trigger result (The SD card is not available.)

Log

Trigger a log action and view the trigger result.
NOTE: Refer to the description of byte values for Trigger_S, below.

Backup

Trigger a backup action and view the trigger result.
NOTE: Refer to the description of byte values for Trigger_S, below.

Purge

Trigger a purge action to delete the backup file and view the trigger result.
NOTE: Refer to the description of byte values for Trigger_S, below.

Trigger_S

The Trigger_S type has two variables when it is associated with the log, backup, or purge variables:
  • Trigger: Every change in value triggers the corresponding action.

  • Status: The high byte of the Status variable contains the result of the executed action, as indicated by these values:

    Byte Description

    0

    The execution of the action completed without any detected errors:

    1

    The SD card is not available.:
    • possible reason: The slot does not contain a compatible SD card.

    • suggested action: Insert a compatible SD card in the slot.

    2

    A file system error is detected:
    • possible reason: It is not possible to write files to the SD card.

    • suggested action: Check the write-protection on the card, reboot the module, or swap out the SD card.

    3

    The available space on the SD card is not sufficient to execute the action:
    • possible reason: The SD card is full.

    • suggested action: Replace the SD card or purge the files on the card.

    4

    The available RAM is not sufficient for logging or backup:
    • possible reason: Too many services or data points are configured.

    • suggested action: Reduce the size of the configuration.

    5

    The variable is not available:
    • possible reason: The data dictionary is not enabled in the project or one or more variables that are configured in table are missing from the user's project.

    • suggested action: Enable the data dictionary in the project settings or re-configure the data logging table to remove the missing variables.

    6

    The table is full:
    • possible reason: There are too many log records.

    • The high byte of the Status variable contains the result of the executed action, as indicated by these values Status va

    • suggested action: Trigger a backup action.

    7

    The SD card is busy.

    8

    A system error is detected:
    • possible reason: The data transfer between the module and the CPU is interrupted.

    • suggested action: Check the hardware connections, or reboot the entire system.

  • The low byte of the Status variable identifies the action that the result effects. When the execution of an action is completed, the value of the low byte is updated to the value of the Trigger byte that triggered the action.
    NOTE:

    Confirm that the Status is updated before the next action is triggered.

    1. This is an example of a log action that is triggered with its result checked for a selected table:
      • BME_NOR_2200H_DATALOG.Table0.enable = 1 (The table is enabled.)

      • BME_NOR_2200H_DATALOG.Table0.log.Trigger = 0

      • BME_NOR_2200H_DATALOG.Table0.log.Status = 0

    2. The action is triggered by a change in the value of BME_NOR_2200H_DATALOG.Table0.log.Trigger from 0 to 1 to start this sequence:
      1. The module adds a log record to the table.

      2. The module updates the value of BME_NOR_2200H_DATALOG.Table0.log.Status.

    3. The user's application program continues to monitor the value of BME_NOR_2200H_DATALOG.Table0.log.Status:
      • If the low byte changes to 1, the log action finishes executing.

      • If the high byte changes to 0, the log action is finished successfully.

      • Any other value indicated an unsuccessful execution.

    4. The user's application program can again change the value of BME_NOR_2200H_DATALOG.Table0.log.Trigger to fire another log action.

    5. Repeat these steps to check the result.

Module Diagnostic Device DDT

The module diagnostic Device DDT includes the status of the SD (SD_STATUS) card and data logging service (DATALOGING). These are the possible bit values for SD_STATUS:
  • bit 0 STATUS: This bit is set when the SD card is normal.
  • bit 1 BUSY: This bit is set when the SD card is busy.
  • bit 2 LOW_SPACE_ALARM: This bit is set when the free-space rate of the SD card is less than 20 percent.

Variable Selection

You can add existing unlocated variables (in your current project) to the Variable selection table when you configure the data logging table. The data logging service supports these variable types:

Variable Type

Logging format (backup files)

BOOL

0, 1

EBOOL

0, 1

BYTE

0 ... 255 (decimal)

INT

-32768 ... 32767 (decimal)

UINT

0 ... 65535 (decimal)

WORD

0 ... 65535 (decimal)

DINT

-2147483648 ... 2147483647 (decimal)

UDINT

0 ... 4294967295 (decimal)

DWORD

0 ... 4294967295 (decimal)

REAL

-1.2345678e-99 (scientific notation)

TIME

49D_17H_20M_47S_295MS

DATE

1990-02-02

TOD

23:10:59

When you click the Add button in the Log Variable section, the Variable selection window opens. From here you can select from the variables that are defined in the current Control Expert project.

When a new backup event occurs (owing to a trigger or period expiration), a new record that contains all of the variable values is added to the log table (with optional time stamping). When the user-configured maximum number of records is reached, the newest records overwrite the oldest.

Backup File Format

The data logging service supports an SD card with a 4-GB capacity. Backup files are stored in the data log folder at the root of the card. Each table includes a dedicated sub-folder for this storing action. The name of the sub-folder is the same as that of the user-configured table name.

When a new log event occurs (owing to a trigger or period expiration), a new file is generated in this folder and the records in the log table are stored in the file. At this time, the log table itself is flushed. When the user-configured maximum number of files is reached, the oldest backup files are deleted.

The generated file assumes the event timestamp as its own name in this format:
yyyy-mm-dd_hh-mm-ss

The file format is fixed. You cannot modify it.

The file is encoded in pure ASCII format in a text file with the .csv extension. This is an example of the content of a log file:

Date,plc.plc1.height,plc.plc1.length,plc.plc1.width,
2003-10-01 02:44:55,150,200,50,
2003-10-01 03:48:08,140,150,30,
2003-10-01 04:55:10,220,280,80,
2003-10-01 06:01:05,170,220,60,

You can open the .csv file in Microsoft Excel to separate the data in columns:
Date plc.plc1.height plc.plc1.length plc.plc1.width
10/1/2003 2:44 150 200 50
10/1/2003 3:48 140 150 30
10/1/2003 4:55 220 280 80
10/1/2003 6:01 170 220 60

Purge

A CPU-triggered purge erases all backup files for the current table from the SD card. In this case, the table folder is emptied.

To trigger the purge action every time the module restarts, select Erase on restart.

NOTE:
  • This variable is available only after you configure the data logging service.

  • The purge does not affect the log table in memory.

Name

Type

Description

Purge_Archive

Trigger_S

Clear archived backup file.

Trigger

BYTE

Change the value of this byte to trigger the action.

Status

WORD

0: Trigger value without a detected error.

1: The SD card is not available.

2: A file system error is detected.

3: The SD card has insufficient space.

4: There is insufficient memory space.

5: The variable is not available.

6: The table is full.

7: The SD card is busy.

8: A system error is detected.

(table name)

T_BME_NOR_2200H_TABLE

The table name is assigned when you create a data logging table.

Enable

BOOL

0: Disable the datalogging service.

1: Enable the datalogging service.

Records_count

UINT

Current records count in this table.

Backup_count

UINT

Current backup records count of this table.

Last_Log_Status

BYTE

0: Trigger value without a detected error.

1: The SD card is not available.

2: A file system error is detected.

3: The SD card has insufficient space.

4: There is insufficient memory space.

5: The variable is not available.

6: The table is full.

7: The SD card is busy.

8: A system error is detected.

Last_Backup_Status

BYTE

0: Trigger value without a detected error.

1: The SD card is not available.

2: A file system error is detected.

3: The SD card has insufficient space.

4: There is insufficient memory space.

5: The variable is not available.

6: The table is full.

7: The SD card is busy.

8: A system error is detected.

Data Logging and Hot Standby

The data logging service for the module runs in the primary and standby modes in a Hot Standby system. Both models respond when you trigger a log, backup, or purge action.

The Device DDT always displays the result of the trigger for the module in the primary role. During a Hot Standby swap, the status of the module that assumes the primary role is overwritten.

You can download the primary and standby backup data logging files from the web. The two modules do not necessarily have the same log data, time stamping, and SD card statuses.