Alarm 7.6.3: enable/disable and set point bind to DB values


I’ve been reading some topic and unfortunately I have not found a way to solve my problem :cry: . This is what I do:

I have a table (bind DB) in which I have the columns “Data Point Value” (float) and “Enable Alarm” (boolean).

First I want to link the alarm setpoint to the value of the table “Data Point Value”. Now I have the DB query in the set point of alarm windows and it takes the value, but don’t know how to update if iI change it into the Table.

I also want the alarm to be enabled or disabled according to the value “Enable Alarm” boolean of the table.

Obviously any modifications I make in the table is updated in the DB.

Any suggestions to help me do what I want?

Hi Vikos,

I think this should be possible.
Create a memory tag, and create an alarm inside it.
Now bind the “enabled” property to an expression with the function “executeScalarQuery” with your custom query to get the data.

Do the same for the “setpoint” property.

I think these values should update depending on the “scan class” selected in the “general tab” in the tag editor of the memory tag.


Pat’s answer is exactly correct. I would only be a little cautious about how many of these are created, and how quickly the scan class runs, because a query will be executed for each property, for each alarm, for each execution. It won’t be a problem at first, but you can quickly get up to very high query counts.

If you wanted to get a more advanced and avoid the problem I just outlined, one way to go would be to create a UDT for your alarm, with the alarm tag, and a memory tag for enabled, and setpoint. Then, in a gateway timer script, periodically load all of the settings table, go through them, and write to the appropriate tags. In this way, you’re only running one query to load the data, and it can be a little slower than the tag exec rate.