# Export Alarm Data

You can use this script operation to export the alarm log to a CSV or TXT file.

##### Block

##### Text

exportAlarmData(false, false, $Enums.AlarmMode.Log);
1 2 3

1: Export Latest Data

2: Append to Existing File

3: Alarm mode

[Export Latest Data] | ##### Block Checked Unchecked ##### Text 'true' 'false' | When using the [Log] alarm mode, select this check box to export only the alarms that occurred since the previous alarm export operation. This setting does not change the output data for [Active] alarm modes.
[Append to Existing File] | ##### Block Checked Unchecked ##### Text 'true' 'false' | When using the [Log] alarm mode, select this check box to append exported alarm data to previously exported alarm data. This setting does not change the output data for [Active] alarm modes.
Alarm mode | ##### Block [Log] [Active] ##### Text '$Enums.AlarmMode.Log' '$Enums.AlarmMode.Active' | Specify the alarm mode of exported alarm data: [Active] or [Log].

Note: For more information about exporting alarm data, refer to the following.

Exporting and Importing Alarms

## Example (Alarm mode: [Log])

Example | [Export Latest Data] | [Append to Existing File] | [Append Date/Time] in [All Alarm] Property Window
Example 1 | Unchecked | Unchecked | Unchecked
Example 2 | Unchecked | Unchecked | Checked
Example 3 | Checked | Unchecked | Unchecked
Example 4 | Checked | Unchecked | Checked
Example 5 | Unchecked | Checked | Unchecked / Checked
Example 6 | Checked | Checked | Unchecked / Checked

### Example 1

[Export Latest Data]: Unchecked

[Append to Existing File]: Unchecked

[Append Date/Time] in [All Alarm] Property Window: Unchecked

1. The first Export Alarm Data operation is executed after the third record is logged, resulting in the Alarm1.csv file as shown below.

2. When the second Export Alarm Data operation is executed after the fifth record is logged, all the log data overwrites the existing file.

### Example 2

[Export Latest Data]: Unchecked

[Append to Existing File]: Unchecked

[Append Date/Time] in [All Alarm] Property Window: Checked

1. The first Export Alarm Data operation is executed after the third record is logged, resulting in the csv file as shown below.

2. When the second Export Alarm Data operation is executed after the fifth record is logged, all the log data is written to a new csv file.

### Example 3

[Export Latest Data]: Checked

[Append to Existing File]: Unchecked

[Append Date/Time] in [All Alarm] Property Window: Unchecked

1. The first Export Alarm Data operation is executed after the third record is logged, resulting in the Alarm1.csv file as shown below.

2. When the second Export Alarm Data operation is executed after the fifth record is logged, only the records after the previous export are written to the new csv file.

### Example 4

[Export Latest Data]: Checked

[Append to Existing File]: Unchecked

[Append Date/Time] in [All Alarm] Property Window: Checked

1. The first Export Alarm Data operation is executed after the third record is logged, resulting in the csv file as shown below.

2. When the second Export Alarm Data operation is executed after the fifth record is logged, only the records after the previous export results in the new csv file.

### Example 5

[Export Latest Data]: Unchecked

[Append to Existing File]: Checked

[Append Date/Time] in [All Alarm] Property Window: Unchecked / Checked

1. The first Export Alarm Data operation is executed after the third record is logged, resulting in the Alarm1.csv file as shown below.

2. When the second Export Alarm Data operation is executed after the fifth record is logged, all the log data is appended to existing records, resulting in duplicate data regardless of the [Append Date/Time] setting.

### Example 6

[Export Latest Data]: Checked

[Append to Existing File]: Checked

[Append Date/Time] in [All Alarm] Property Window: Unchecked / Checked

1. The first Export Alarm Data operation is executed after the third record is logged, resulting in the Alarm1.csv file as shown below.

2. When the second Export Alarm Data operation is executed after the fifth record is logged, only log data after the previous export are appended to existing records regardless of the [Append Date/Time] setting.