TIA Portal How To save alarms to file

0

TIA Portal How To save alarms to file

Alarms can be saved to a file stored on the HMI’s SD card as well as view them on the panel itself. These files can be later accessed by reading the card on a PG or via web browser – by typing in the HMI’s IP address in the address bar.

In this tutorial you’re going to learn:

  • How to create a PLC Alarm Word in TIA Portal
  • How to map your alarms to Alarm Word in TIA Portal
  • How to connect HMI’s Alarms to PLC ALarms in TIA Portal
  • How to configure TIA Portal project to store HMI’s alarms on SD Card
  • How to configure TIA Portal project to display current alarms
  • How to configure TIA Portal project to display historical (stored) alarms

1. Hardware used in TIA Portal project

TIA Portal alarms to file hardware
TIA Portal alarms to file hardware

TIA Portal help on logging alarms: Help » Content » Visualize processes » Working with alarms » Logging alarms

2. PLC Alarm Word in TIA Portal (0:00)

First we need to create a Word variable, that will contain our alarms and will be read by alarm facility in our HMI.

I’ve chosen to place my Word in a Data Block:

TIA Portal how to make Data Block
TIA Portal how to make Data Block

Each Word contains 16 bits, therefore you can map 16 discrete alarms to a single Word variable. Create as many Word variables as you need.

TIA Portal Word Data Type
TIA Portal Word Data Type

2. Mapping Discrete alarms to Word variable in TIA Portal (0:50)

For the purpose of this tutorial I’ve created 5 five discrete alarms in local PLC memory as markers.

Now We’re going to map our alarms to Word variable in a Function:

TIA Portal Alarm Mapping
TIA Portal Alarm Mapping

Do no forget to call this Function as i forgot to show this in the video!

TIA Portal Function call
TIA Portal Function call

3. Creating HMI Alarm log in TIA Portal (3:35)

Go to: HMI » Historical data » Alarm logs » <Add new>

TIA Portal Alarm Log
TIA Portal Alarm Log

Lets explain some of the properties here:

  • Storage locations: this is actually a file type 😉 in which the log will be stored. I usually choose .CSV as it can be opened with Excel or even a notepad.
  • Number of data records per log: Maximum number of records in a file. Max is 500000 and I recommend setting it to this value. .CSV files are relatively small and HMI data SD cards are not ridiculously expensive so you can easily by a bigger one.
  • Path: storage location of your log (can get confused with the first one due to odd terminology)
  • Logging method: Specifies how the log behaves when getting full.
  • Restart behavior: What happens with the log at HMI power on.

4. Create HMI Alarms in TIA Portal (4:12)

Go to: HMI alarms » Discrete alarms » <Add new> » ‘…’ on trigger tag » PLC_1 » Expand ‘DB_AlarmsHMI’ » AlarmsWord_1 » OK

TIA Portal Alarms
TIA Portal Alarms
  • Change Alarm Text to whatever message you want displayed when alarm occurs
  • Adjust the trigger bit to correspond to the selected bit in your alarm word
    TIA Portal Alarm bit
    TIA Portal Alarm bit

    5. Connect Alarm Class with Alarm Log (5:25)

Go to: Alarm Classes » Errors (as the alarms we created where errors) » ‘…’ on Log » HMI_1 » Historical data » Alarm_log_1 » OK

TIA Portal Alarm class to log
TIA Portal Alarm class to log

6. Display current and historical Alarms (5:47)

No lets create two screens on our HMI. One will display current alarms, the second historical alarms.

  1. Current alarms on HMI in TIA Portal: Go to Toolbox » Controls » drag and drop ‘Alarm view’ object to your window » Properties and make sure ‘Current alarm states’ is selected

    TIA Portal current alarm view
    TIA Portal current alarm view
  2. Historical alarms on HMI in TIA Portal: Go to Toolbox » Controls » drag and drop ‘Alarm view’ object to your window » Properties and select ‘Alarm log’ » click ‘…’ in Alarm log » HMI_1 » Historical data » Alarm_log_1 » OK

    TIA Portal historical alarm view
    TIA Portal historical alarm view
123 Shares