07-18-2016 08:12 PM - edited 07-18-2016 08:13 PM
Hello,
Can you use Alarm & Event Notifications for User Defined Alarms with the DSC module? I'm using LabVIEW 2015.
Thanks,
Hans
07-19-2016 03:52 PM
Are you using this VI?: http://zone.ni.com/reference/en-XX/help/371618J-01/lvdsc/dsc_set_ud_alarm/
Is your question entirely in theory or have you tried and run into issues doing this? Theoretically, you can make event notifications for anything you'd like. You aren't restricted to the DSC Module for this. I'd be more helpful to you if I had a bit more insight to where you are with the application so I can give advice directly to what you're working on now.
Do you have an example we can debug together?
07-26-2016 06:10 PM
07-27-2016 01:35 PM
Hans,
There are a few things I noticed taking a look and a couple of things I wanted to try. You left the subVIs and controls folder out of the zip so I'm unable to run things myself to see exactly what you're seeing.
If we see the alarms being updated when the first loop is bypassed, it'd appear we have access to these alarms. The code running to the reading loop doesn't appear to have any dependencies on the boolean's state. If you have the value set to true and turn highlight execution (the yellow lightbulb on the toolbar of your block diagram), what values do we see propagate through the wires? Does this help us figure out where we're getting stuck?
Is the breakpoint hit before you set it to true? I wouldn't expect it would be. I just want to clarify things are behaving as I'd expect elsewhere.
I'm assuming the alarm reading loop iteration continues to rise even though we're not seeing an update on the front panel?
General programming notes -
Stop reading loop - Did you want this loop to be able to stop independently of the program? If not, we could just use the local variable for stop here as well without the need for a second stop boolean. If so, do we want a way to spin it back up again after being stopped?
Alarm Summary - This control is sitting around not wired into anything. It appears the only usage is the reference you pass into the subVI. I'm not sure what's going on in that subVI to make the reference more useful to you. I'm suspecting you're changing the summary using explicit property nodes. Does that sound right?
This is a small VI so code readability isn't a huge concern. But, making good habits with smaller code leads towards good habits with larger applications as well. It's probably beneficial to modify the case structures we're working with into small subVIs to handle the functionality of Initialize and Shutdown.
07-28-2016 03:57 PM
Hi Jeff,
Sorry bout the missing VI and control. Here's another zip that should let you run Alarm & Event Test - With Alarm Notifications.vi. Of course you also need the DSC module installed. I am using LabVIEW 2015 with the DSC Module on a Windows 10 PC.
The only thing the Enable Alarm & Event Notifications boolean does is control whether or not alarms and event notifications are enabled. When this boolean is false, the lower loop shows alarms as they are created, acked, and cleared via button click events the upper loop. This works as expected.
When the boolean is true and I create a user defined alarm by clicking the Set Alarm button, the alarm is not read in the lower loop (tho the lower loop iteration indicator is updating), and the User Event breakpoint is never hit in the upper loop. The alarm does show up in the NI Distributed System Manager however.
Once the VI has been run with the Enable Alarm & Event Notifications boolean set true, if it is rerun with it set false, alarms no longer show up in the lower loop. If the project is closed and reopened in LabVIEW and the run with the Enable Alarm & Event Notifications boolean set false, alarms are once again read by the lower loop, including the alarms that were created previously.
Again, the alarms always show up in the NI Distributed System Manager.
Hopefully you can run this now and see if you experience the same behavior.
Thanks again for your help!
Hans
08-03-2016 12:09 PM
Hans,
Sorry so slow to reply. With NI Week going on here, I've been a tad slammed this week. I've worked with the project you've got but didn't dig in TOO deeply. I'm seeing a loggin failed: failed to connect to Citadel database. Before I go too far with this, do you have a Citadel database setup or is this a dummy alarm you flag intentionally to make sure we see alarm behavior?
When I run the VI upon a fresh LabVIEW opening, I can play with the events for a bit before I start to see alarm -1967362033. Have you never seen this one? I see the same one when I try to run with the alarm and events enabled.
When I do run with those enabled, I'll see the breakpoint only when I use "Ack Alarms with Events" even though I've seen the error pop up prior to that.
I'm running LabVIEW 2015 with the DSC Module on Windows 7. I'm not sure if the OS change is causing the different behavior. Everything else sounds pretty similar.
08-03-2016 07:33 PM
Hi Jeff,
Thanks once again for your persistance. Unfortunately, I am now going on vacation for a couple weeks. Here's quick answers to some of your questions.
We do have a Citadel database setup, but not for this test lvlib or process name. This is just a test VI to try using the alarm and event notifications.
I do get error -1967362033, but only when I try to clear an alarm that isn't active, like if I create an alarm with the Set Alarm button (which uses the alarm name in the "Alarm name" control), but I try to clear it with the Clear A with Event button (which uses the alarm name "Alarm with Event name" control) - so this is a legit error in this case. For this test VI, you need to click the Clear Alarm button to clear an Alarm created with the Set Alarm button.
It sounds like you don't get the Alarm & Event Notification for user defined alarms either. Is that true? And if Alarm & Event Notification is on, do you no longer see alarms in the Alarm Summary, as happens for me (even tho they show up in Distributed System Manager)?
Hans
08-05-2016 07:15 AM
The alarms did vanish from the alarms summary as you mention. Were you able to get to the breakpoint using the Ack?