TIA - Alarm Generation

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.

Will having several hundred instances of Program_Alarm in the program use up a lot of memory/resources though?
 
Will having several hundred instances of Program_Alarm in the program use up a lot of memory/resources though?


Depends on your definition of "a lot", I guess.

I just threw something together in Portal, and compared before and after of calculating the alarms with just bits in a word vs triggering program alarm. The "bits in a word" method would have needed some other code around it for management, probably, but serves as a starting point.

For code work memory, there wasn't much increase. I had a standard FB with 10 alarms that got called 100 times. Adding Program_Alarm added 385 bytes for the instruction itself to be loaded to PLC as well as a little under 1000 bytes for adding the Program_Alarm calls. Note that this is a one time "cost" as the block doing the calling had minimum change.

For Data work memory, there was more increase. It used about 60kB of memory total for the 1000 instances of the alarms. That was about 5% of the 1511 I had configured.

Load Memory increased about 75kB, which left it at still 1% for the 12MB card I selected.

Overall, doesn't seem that bad to me. It isn't half the PLC memory or anything like that, but it's certainly more memory. From my perspective, optimizations don't mean much most of the time, unless you need them, in which case they are critical. If you know you're cutting it close on your CPU, might be a feature to avoid; but if that last 5% makes a difference on your CPU I'd be worried about other things, like expandability down the road.
 
Remember that if you use Program_alarm, you have to use S7-1500 and only Siemens comfort panels, as S7-1200 and Siemens basic panels don't support it. With bit-triggered alarms you are more flexible when you consider your library also for smaller / cost sensitive applications.

The problem of Program_alarm is not only the memory, but the cycle time it costs, especially on 1500 cpus at the lower end. There are users which program their own handling around it, that only a maximum number of alarms is triggered at one cycle, to avoid extreme high cycle times if you have many errors at the same time (e.g. power loss).

But an advantage of Program_alarm is, that it's timestamped when the message occurs in the plc, and not in the hmi. For some applications it's relevant to know which error came first.
 
Remember that if you use Program_alarm, you have to use S7-1500 and only Siemens comfort panels, as S7-1200 and Siemens basic panels don't support it. With bit-triggered alarms you are more flexible when you consider your library also for smaller / cost sensitive applications.

1200 and basic panels don't support, very true.

However, you can still get the text of the alarm into a Basic panel or a third party panel with the Get Alarm instruction, which reads the alarms into text that can be sent to the HMI. Downside is now you have to manage a buffer of strings and track them as they come and go.

I think the most recent FW allows for the 1500 to be an OPC UA Alarms and Events server, which could then link up to any OPC UA A&E client, but I dunno how many of those are out there in the wild, if that's more of a theoretical use case than a real one.

But an advantage of Program_alarm is, that it's timestamped when the message occurs in the plc, and not in the hmi. For some applications it's relevant to know which error came first.

It also makes it really easy to manage the alarms if you have multiple HMIs per PLC, you don't have to try to manage the text across them.

You can also read the alarms easily in Portal, on the web page, on the display, etc.


Sidebar: does anyone actually use the front displays on a 1500 for anything? I'm torn on whether its really really useful or a complete marketing gimmick.
 
Sidebar: does anyone actually use the front displays on a 1500 for anything? I'm torn on whether its really really useful or a complete marketing gimmick.[/QUOTE]

The only nice thing I have found is that I didnt have to run to the HMI to see what alarms are active. Can just read them on the cpu display
 
Sidebar: does anyone actually use the front displays on a 1500 for anything? I'm torn on whether its really really useful or a complete marketing gimmick.
Nope. I also use the ET200SP CPUs, which don't even have the display.

I think the display is useful to read out PLC diagnostics, in case that you have a PLC that wont go to run.
But if you use Siemens HMIs you can get the same functionality with the System Diagnostics View. I think it is actually better than using the small display on the CPU.
And if you don't use Siemens HMIs, there is the onboard web-server.
So, the display is nice to look at but is not so important in real life in my opinion.
 

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,506
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