TIA Portal How To: Table of Contents
- TIA Portal How To save alarms to file
- 1. Hardware used in TIA Portal project
- 2. PLC Alarm Word in TIA Portal (0:00)
- 2. Mapping Discrete alarms to Word variable in TIA Portal (0:50)
- 3. Creating HMI Alarm log in TIA Portal (3:35)
- 4. Create HMI Alarms in TIA Portal (4:12)
- 5. Connect Alarm Class with Alarm Log (5:25)
- 6. Display current and historical Alarms (5:47)
- 7. Links:
- Related Posts:
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 them to Alarm Word in TIA Portal
- How to connect HMI’s Alarms to PLC’s in TIA Portal
- How to configure TIA Portal project to store them 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 help on logging : 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:

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.

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 them to Word variable in a Function:

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

3. Creating HMI Alarm log in TIA Portal (3:35)
Go to: HMI » Historical data » Alarm logs » <Add new>

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 buy 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
- 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 5. Connect Alarm Class with Alarm Log (5:25)
Go to: Alarm Classes » Errors (as the ones we created were errors) » ‘…’ on Log » HMI_1 » Historical data » Alarm_log_1 » OK

6. Display current and historical Alarms (5:47)
No lets create two screens on our HMI. One will display current alarms, the second historical.
- Current ones 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 - Historical ones 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
Is there a way to do the same with a AB Control Logic processor and Siemens HMI (TP 1200).