TIA - Alarm Generation

Jackllx

Lifetime Supporting Member
Join Date
Feb 2021
Location
UK
Posts
46
Hi,

I am very experienced with TIA Portal, however I think I could be doing some things much quicker, one of those things is alarms! On some projects I can have 1000+ alarms and moving them from my function blocks to an alarm FC, and then over to the HMI Alarms page (copying and pasting the alarm message etc) is rather long winded.

Is there a quicker way which anyone would like to share?

Many thanks :unsure:
 
Ive only been using TIA for a few years and the only way I do it is by using the program_alarm function block. You only do it once in the plc and it will display on the hmi
 
Just to add I think this block is only available for the 1500 cpu. I might be wrong

Ive only been using TIA for a few years and the only way I do it is by using the program_alarm function block. You only do it once in the plc and it will display on the hmi

That is even slower than using tag based alarms I think.

I'm more looking to see what people are doing to speed things up, macros etc.

If I have 100 function blocks and they all have the same 10 alarms inside, then surely there is a way of getting it done more quickly.
 
I am guessing that for each alarm, he has the raw alarm bit, a latched alarm bit (which is usually the trigger bit in the HMI), an acknowledge bit from the HMI, and maybe even an acknowledge bit to the HMI.

What I am doing is that I have an FC that loops through all alarms in one go, using word-logic to make it faster. The alarms, the latched alarms, and the acknowledge bits are all in arrays so it is easy to do.
The FC handles the latching of new alarms, the resetting of the alarms via the HMI ack bits, and also sets a couple of global bits for "there is a new alarm" and "there is at least one un-acknowledged alarm".

For the HMI alarm texts, I usually have a spreadsheet to comfortably generate the texts based on common templates for standard objects. Then I import the spreadsheet into TIA.

I dont know if there is a way to get the alarm texts from the spreadsheet into the comment section of the PLC tags. That would be neat.
 
I am guessing that for each alarm, he has the raw alarm bit, a latched alarm bit (which is usually the trigger bit in the HMI), an acknowledge bit from the HMI, and maybe even an acknowledge bit to the HMI.

What I am doing is that I have an FC that loops through all alarms in one go, using word-logic to make it faster. The alarms, the latched alarms, and the acknowledge bits are all in arrays so it is easy to do.
The FC handles the latching of new alarms, the resetting of the alarms via the HMI ack bits, and also sets a couple of global bits for "there is a new alarm" and "there is at least one un-acknowledged alarm".

For the HMI alarm texts, I usually have a spreadsheet to comfortably generate the texts based on common templates for standard objects. Then I import the spreadsheet into TIA.

I dont know if there is a way to get the alarm texts from the spreadsheet into the comment section of the PLC tags. That would be neat.

You can copy text directly from excel to TIA portal.

You can even have a field in excel where you put together cells and then import it into TIA.

Example field =A1+B2+F1 will generate a text from the three cells, the text that goes into that field can be copied directly to TIA.

I use it many times if I have a number that's in the middle of a text. Motor1running for example. If I have many motors I can just make some fields in excel and copy it directly. Saves me a ton of time :)
 
Hi,

I am very experienced with TIA Portal, however I think I could be doing some things much quicker, one of those things is alarms! On some projects I can have 1000+ alarms and moving them from my function blocks to an alarm FC, and then over to the HMI Alarms page (copying and pasting the alarm message etc) is rather long winded.

Is there a quicker way which anyone would like to share?

Many thanks :unsure:


Have you looked at ProDiag ?

Yes. It’s an option on the hmi.
Your alarm text in the plc code will be displayed in the hmi alarm window
 
You can even have a field in excel where you put together cells and then import it into TIA.

Example field =A1+B2+F1 will generate a text from the three cells, the text that goes into that field can be copied directly to TIA.

I use it many times if I have a number that's in the middle of a text. Motor1running for example. If I have many motors I can just make some fields in excel and copy it directly. Saves me a ton of time :)
Yes I do something like that as well. I 'build' a text string by adding several fields together. If 100 'objects' each have 10-15 standard alarm texts, I can generate 1000+ alarm texts in only 1 hour instead of many days. Also, any change is easier to do in the spreadsheet and then re-import rather than edit individual alarm texts in TIA.

You can copy text directly from excel to TIA portal.
I would like to have the HMI alarm texts in the comment section of the individual bits in the alarm DB. How do I do that ?
 
Why do you have to copy them from the FBs to an FC?

I don't have to, it just makes it easier.

Inside my FB I will have lets say, 10 alarms, this FB I will call 20 times, I will have other FBs with 10 alarms which I also call 20 times.

Inside a new FC, I then map the alarm bits (from the FBs UDT/DB) to a new 'Alarm Word', and each bit of this alarm word is used for a single alarm.

Then inside the HMI I copy and paste the message, example 'xxxx Overcurrent Detected!' to the corresponding alarm word bit.

I think this is pretty standard, the problem is when I go above a certain number of alarms, it gets really boring copyign and pasting alarm messages from FB to FC then to the HMI!
 
I am guessing that for each alarm, he has the raw alarm bit, a latched alarm bit (which is usually the trigger bit in the HMI), an acknowledge bit from the HMI, and maybe even an acknowledge bit to the HMI.

What I am doing is that I have an FC that loops through all alarms in one go, using word-logic to make it faster. The alarms, the latched alarms, and the acknowledge bits are all in arrays so it is easy to do.
The FC handles the latching of new alarms, the resetting of the alarms via the HMI ack bits, and also sets a couple of global bits for "there is a new alarm" and "there is at least one un-acknowledged alarm".

For the HMI alarm texts, I usually have a spreadsheet to comfortably generate the texts based on common templates for standard objects. Then I import the spreadsheet into TIA.

I dont know if there is a way to get the alarm texts from the spreadsheet into the comment section of the PLC tags. That would be neat.


Yeah you're doing it the same way as me, I just need to make a spreadsheet then I think!
 
Inside a new FC, I then map the alarm bits (from the FBs UDT/DB) to a new 'Alarm Word', and each bit of this alarm word is used for a single alarm.
This I dont get. Why set aside an entire word per alarm ?
If you do this bit by bit or word by word, then I think this is tedious and unnecessary.
In the HMI, you can have that all alarms are covered by a single bit-array.
For the HMI acknowledge bits and PLC acknowledge bits, you have similar arrays that mirrors the alarm bit array.

I think this is pretty standard, the problem is when I go above a certain number of alarms, it gets really boring copyign and pasting alarm messages from FB to FC then to the HMI!
I think if you reconsider how the data is reserved per alarm, then you can cut out the copying from FB to FC entirely.
For the creation of the alarm texts for the HMI, it really pays off with a spreadsheet. Especially if you have many similar objects with the same alarms. You can relatively easily automate the creation of the alarm text strings as previously mentioned.
 
This I dont get. Why set aside an entire word per alarm ?
If you do this bit by bit or word by word, then I think this is tedious and unnecessary.
In the HMI, you can have that all alarms are covered by a single bit-array.
For the HMI acknowledge bits and PLC acknowledge bits, you have similar arrays that mirrors the alarm bit array.

I think if you reconsider how the data is reserved per alarm, then you can cut out the copying from FB to FC entirely.
For the creation of the alarm texts for the HMI, it really pays off with a spreadsheet. Especially if you have many similar objects with the same alarms. You can relatively easily automate the creation of the alarm text strings as previously mentioned.


I don't use a word per alarm, I have an array of alarm words which as you know, contains 15 bits.

So alarm word1 .%0 is one alarm, .%1 is the next alarm etc...

So inside my function block, I have a UDT, nested inside my UDT is an alarm word, each bit of the alarm word is responsible for an alarm. Example 'Overcurrent' would be W1.%0.

Then in a seperate alarm FC I would map the UDT alarm to my 'global' alarm word, which is then mapped to the HMI, example Machine1.Faults.W1.%0 >>>>> AlarmWord1.%0

Then the HMI sees AlarmWord1.%0 and flags the alarm.

Mapping each individual FB UDT to the HMI would take a lot longer than the way I am doing it now.

I am going to make the spreadsheet for sure.
 
I simply address the alarm bits by the array offset.
Each FB has an input pin "alarm_offset", an in_out pin called "Alarmarray" and inside the FB the alarms are directly written like this

first alarm = #Alarmarray[#alarm_offset]
second alarm = #Alarmarray[#alarm_offset + 1]
third alarm = #Alarmarray[#alarm_offset + 2]
etc.

so no shoveling around of the alarm bits or words outside the FBs is required.
 
That is even slower than using tag based alarms I think.

I'm more looking to see what people are doing to speed things up, macros etc.

If I have 100 function blocks and they all have the same 10 alarms inside, then surely there is a way of getting it done more quickly.


If it is the same 10 alarms in every case, Program_Alarm might deserve another look. Effectively, you only make 10 alarms, and the system does the rest in the background (assuming you're not in 1200, of course, but 1000 alarms sounds huge for 1200).

The Alarm text for each alarm can be made dynamic to include things like a tag value or the instance DB of the block it's called in. This way you can make one FB, with whatever alarms, and then every time you call the FB again it calls the alarms for you without you doing anything new. In Runtime the HMI sees MOTOR 1 Overcurrent, Motor 2 Overcurrent, etc, but it automatically pulls the MOTOR 1/MOTOR 2/etc dynamically from some something like the instance DB and you don't need to worry about it.

If your 100 FBs is 1 FB called 100x, this you could call program alarm directly. If each FB is truly different, than you could create an Alarms FB to call from inside each one, and map the alarm tags to it. Inside the Alarms FB you call Program Alarm.
 

Similar Topics

Hi I’m trying to work out how to get the alarm button to flash when there is an alarm or do I have it that the alarm page pops up with the alarm...
Replies
15
Views
1,363
Hello All, I don't so much have a problem more my OCD. I have a project, with over 1000 alarms. I create arrays in the PLC/HMI for my alarm...
Replies
0
Views
556
Using TIA Portal v17, SIMATIC S7-1500 PLC. I am trying to write an alarm that will trigger for multiple sources, and output the triggering...
Replies
6
Views
2,507
Hey Guys, I'm trying to add an HMI alarm and can't get the trigger address to enter in the block. I'm new to all this so its probably something...
Replies
11
Views
1,945
Hello Experts, I want to ask how i can make my tab buttons blink when there is an Alarm active in the that screen. I am just new with WinCC...
Replies
2
Views
4,115
Back
Top Bottom