Multiple Alarms multiple emails

Hello there…

I am trying to handle multiple alarms and send them through email. For only one alarm its simple to cut the loop for sending just one email the time as the sample that you provide here at the forum but my problem is how to make the loop (i am trying to do this through scripting) sending only one email for every occasion of alarming.

Thank you

Please post an example of your script or flow. What platform are we talking here? PAC PROJECT? I have done it before and can dig it out for you.
Are you running an email script per alarm? ie, alarm is triggered then send email… then set a flag trigger for email sent. If the alarm is still active then you check your sent flag trigger and bypass the send mail script.
Hope that makes sense.

Hello jakes

I am using pac project. My question is if i can run only one script block doing the whole job. I managed to run it through flowcharts and scripts like this:

But i want to see if i can do this with only one script block (i.e making a lot of loops with the right orders for every alarm and sending it only one time).

p.s My flowchart is on testing thats why its so bad. :slight_smile:

I would set an email sent flag after each alarm email is sent, you do get an error log if the email does not send.

Nothing wrong with your flow mate.

So, once your alarm is triggered - Set alarm triggered flag for that specific alarm —> Send email for that alarm ----> set email sent flag for that specific alarm. So when your loop starts again and the alarm is still active —> you check to see if that alarm flag is still set (alarm still active) if it is, check if the email flag is still set/active ----> bypass email sending script. keeping checking alarm triggered flag until alarm is off, then reset your email sent flag.

Hope that makes sense.

My example below has a SMS routine included and is for ONE alarm only. Flags are your friend :slight_smile:

hello again!!

I am still trying to find a way to make my alarming work properly. In my chart above the flowchart dont responding in the occasion that 2 alarms or more triggered the same time, thats my problem…

So i am trying through scripting make the whole project. Also i have a question about making tables with my alarms (i.e previous alarm state - actual alarm state) and compare the differences of them so when i have one or more alarms triggered send the right email for each alarm…

Do we have the ability to mass compare two tables or someway to manage a lot of alarms at the same time??

You can put your alarms in tables and use your flowchart above, but you want to put the logic inside another loop of the flowchart that iterates through the index of your tables until it reaches the last alarm defined, at which point you set the index back to zero and do it over again.

You can do the work directly on the tables, but a lot of the times you need to (or it is easier) to assign the table values to temporary variables and perform the work logic on them and then assign them back to the tables when done. This is particularly helpful when using pointers or needing to use built in functions that don’t work on tables.

This pattern can be used for more than just alarms. Here is an example flow of this: