From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable/Enable all alarms at once

Solved!
Go to solution

I have a system definition that has 300 alarms.  I would like to disable all alarms when a channel goes to 0, and enable all alarms when that same channel goes to 1.  What would be the best way to accomplish this on the RT side?  Thanks.

0 Kudos
Message 1 of 5
(3,098 Views)
Solution
Accepted by holteeww

Hi holteeww,

 

There isn't a great way to do this, but the best way to get it done is going to be to stick with the engine features you're already using (alarms and procedures) to programmatically enable or disable alarms based on your boolean channel value. 

 

The simplest way to do this is going to be to create an "Enable Alarming" alarm which looks for a channel value greater than zero on your "Enable/Disable Alarm" boolean (or however you're triggering this).  That alarm should be tied to a procedure comprised of a bunch of Alarm Command steps with function "Enable This Alarm".  Unfortunately, you cannot select multiple alarms to be tied to an alarm command step, so you'll need to repeat this ~300 times. 

 

The same goes for disabling the alarms.  Have an alarm tied to the channel you're watching that triggers if the channel value is zero.  Have a bunch of Alarm Command steps in a procedure tied to that alarm with functionality "Disable This Alarm".  

 

Admittedly, adding ~600 steps to a procedure can be a little tedious, so an option is to programmatically add steps to the procedure using LabVIEW's .NET API for VeriStand.  The "Create a SDF File with Procedure.vi" is a good place to start with this - specifically, the "Add Procedure" subVI.  

Matt | NI Systems Engineering
Message 2 of 5
(3,029 Views)

Matt,

 

Thanks for the response.  I ended up using the Sys Def API to add the individual disable/enable alarm steps to the procedure like you described.  This option works, however the UI Manager goes out to lunch for approximately 5 seconds when the procedure executes.  I dropped a "HP Loop" indicator down, and I don't see any counts so I believe the RT side handles the procedure fine.  It must just be the alarm monitor on the windows side that is inefficient.

 

I also considered creating a custom device, but I'm not sure if there is an API for accessing/monitoring the alarms on the RT side.  I do see the host side API which can make the calls through the gateway.  Do you know if there exists an api for accessing alarm info on the RT side?  If so, maybe I can find a call that can disable/enable all alarms at once.

0 Kudos
Message 3 of 5
(3,021 Views)

Hi holteeww,

 

You're probably right about the UI side.  If the RT processor is overloaded while implementing the procedures, it could be deprioritizing the low-priority communication between the RT system and your UI.  You could look into changing the streaming mechanism from the RT controller back to the host-side UI to a slower half-duplex connection and hopefully see some increase in the responsiveness of your UI.  The configuration to do this is in MAX under the controller's "Network Settings": 

Network Modes.JPG

 

There isn't an API to implement alarming functionality in custom devices which is due to how alarms communicate with the VeriStand Engine and the VS Gateway.  Alarms will always look to the gateway for channel values that might be out of spec and don't actually dig into the channel values in the VS Engine.  As a result, the alarm API is a host-side API with functionality that only exists outside of the RT context and is explicitly dependent on the gateway (instantiated on your host PC) to determine the status of a channel value as it relates to your alarms.  Understandably not the answer you're looking for but I hope this provides some insight as to why an RT API doesn't exist. 

Matt | NI Systems Engineering
0 Kudos
Message 4 of 5
(2,994 Views)

Matt,

 

Thanks for the response.  I tried your suggestion and there is no change in the slow down of the UI Manager.  

 

I did figure out how to put the UI Manager into this particular state.  By default I have the "Alarm Monitor" tab displayed.  The UI manager responds as expected as long as I don't select the "History" or "Rules" tab.  My application handles the the alarms just fine without slowing the UI Manager down (Even when I force the enable/disable all alarms procedure to execute).  Once I select the History or Rules tab, the UI Manager becomes slower to respond even when I go back to displaying the "Active Alarms" tab.  It appears that a background task gets kicked off once these tabs are selected that is changing the responsiveness of everything else in the UI Manager.  I can live with it though.  Especially since we don't use the History and Rules tabs.

 

Some other points that makes me think it is UI Manager related:

- The old workspace Alarm monitor is very responsive compared to the UI Manager's Alarm monitor.

- I see the same behavior when I target the VeriStand engine to the host rather than a RT target.

- The "Rules" tab once selected is very slow to scroll or edit

 

Another note is that I am using VS 2016.

 

Thanks for your help.

 

Capture.JPG

0 Kudos
Message 5 of 5
(2,990 Views)