WinCC Alarm Logging allows you to export configured messages as a text file. You can then edit the messages with appropriate tools (e.g. Microsoft TextPad, Notepad, Excel) and import them into WinCC. Possible cases of application are as follows:
- Messages are to be configured in Microsoft Excel and imported into WinCC.
- Messages of a WinCC project are to be exported, edited and imported into another WinCC project.
Detailed information on exporting, importing and on configuring the text file is available in the WinCC Information System under "Working with WinCC > Setting up a Message System > Configuring the Message System > Working with Single Messages > Importing and Exporting Messages."
This entry only provides additional information and notes.
||Exporting single messages|
You can call the dialog for exporting messages with the menu command "Messages > Export Single Messages...".
If you want to export, edit and then reimport messages, you should select the options "Separator within the fields", "Set text identifications to 0" and "Set group identifications to 0" before exporting.
Following are descriptions of the effect of these setting options:
- "Separator within the fields" option
If you select the "Separator within the fields" option for exporting, the texts with the separators "," or ";" are enclosed in "quotation marks". This allows correct interpretation of the exported files if the message texts contains the "," or ";" characters.
When exporting the messages, the data is stored in a text file and the separate bits of data of a message (message number, message class, message type, message variable, ....) are separated by a comma ",". The configuration of this text file is preset. If a message text contains the separators "," or ";" and that option is not selected, then when this data is processed later on, the fields of the export file might interpreted incorrectly.
Messages containing the characters "," or ";" in the message text are exported. The data of this export file is to be reimported. Errors occur when importing, because the messages with the separators in the message text are interpreted incorrectly.
- The "," character is used permanently as a separator for exporting. The setting of the list separator in the Control Panel under "Regional and Language Options > Regional Options > Customize" has no effect here.
- The ":" character is not a special character for exporting/importing. It can be used as a normal character in the message text.
- The "quotation mark" character can be used as a normal character in message texts. If you select the "Separator within the fields" option, the "double quotation marks" characters in the message text are each written twice in the export file. Thus when the data is interpreted later on a clear distinction can be made between normal characters of the message text and special characters.
- "Set text identifications to 0" option
If you select the "Set text identifications to 0" option for exporting, the text IDs of the message texts are not exported, i.e. the text IDs have the value "0" in the export file. You should use this option if you intend to reimport the exported messages. The explanation is given in point no. 3 ("Importing single messages") of this table.
- "Set group identifications to 0" option
If you select the "Set group identifications to 0" option for exporting, the group identification of a message is not exported, i.e. the group ID has the value "0" in the export file. You should use this option if you intend to reimport the exported messages. The explanation is given in point no. 3 ("Importing single messages") of this table.
||Editing messages in Microsoft Excel|
You have the option of editing the exported files in a text program. If you want to edit the data in Excel, it is useful to open the export file as text file and select the "," character as list separator.
Below are instructions for opening the export file in Microsoft Excel:
- Start Microsoft Excel. Select the menu command "File > Open..." A file selection opens. Select "Text files" as the file type and the file just exported.
- The "Text Import Wizard - Step 1 of 3" dialog opens. Select the "Delimited" option and then click the "Next >" button.
- The "Text Import Wizard - Step 2 of 3" dialog opens. Clear the "Tab" option and select the "Comma" option. Then click the "Next >" button.
- The "Text Import Wizard - Step 3 of 3" dialog opens. Click "Finish".
- An Excel table is displayed with the exported messages. Now you can edit the messages (e.g. change message texts, variable links or group assignments).
- If you change a message text, the associated text ID must have the value 0 so that the new text is transferred when you import it.
- If you change the group of a message, the associated group ID must have the value 0 so that the new group is transferred when you import it. The new group must have already been created before the import procedure.
- If you change the variable links, you must make sure that the variables concerned have already been created before the import procedure.
- Save the file with the menu command "File > Save" or "File > Save as...".
Make sure that you save the file as a "*.txt" file and not as a "*.xls" file.
||Importing single messages|
With the menu command "Messages > Import single messages" you open the dialog for importing messages.
In the "Mode" area you have a choice of three options:
- "Overwrite Messages and Import New Messages"
If you select this option, all the messages are imported in the import file. If the import file contains messages whose message numbers already exist, those messages are overwritten. This setting is important if you wish to change existing messages.
- "Import New Messages Only"
If you select this option, only new messages are imported in the import file. Messages in the import file whose message numbers are already in the system are not imported. This setting is important if you wish to add just the new messages.
- "Delete Messages"
If you select this option, the messages in the import file are deleted from the system. There is no subsequent import of messages. This modes is therefore not a mode for importing, but for "correctly" deleting messages.
The following points are to be noted regarding importing:
- Text IDs for changed texts must be "0"
In order for changed messages texts to be transferred when imported, the associated text IDs must have the value "0" or an invalid value (non-existent text ID). If upon import a text ID has a value that is already in the text library, the text belonging to that text ID is used as the message text.
Upon import the system checks whether the message text is already in the text library. If the message text doesn't already exist, the text is created in the text library and the relevant text ID is entered in the Alarm Logging. If the text does already exist, it is not created anew in the text library, but the associated text ID is entered in the Alarm Logging.
It is therefore recommended to set all text IDs to the value "0".
- Group ID for changed group assignment must be "0"
In order for a changed group assignment for messages to be transferred when imported, the associated group ID must have the value "0" or an invalid value (non-existent group ID). If the group ID in the import file has a value that is already in the system, the message is assigned to the associated group.
It is therefore recommended to set all group IDs to the value "0".
- Before importing you should check that all the variables for variable links and all the message groups used have already been created in the system.