LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DSC - can't acknowledge or clear a user defined event

I wrote this code for alarms but now I have modified it to handle events.  So, first create the event (create alarm button), then try to acknowledge it or clear it.  There should be a time inserted for acknowledging and clearing.  It does't work.  I have used the exact event URL to acknowledge it.  Please help.

 

Thanks

Matt

0 Kudos
Message 1 of 9
(3,042 Views)

Hi Matt,

 

When you run the code are the alarms actually being created? I can watch it go through creating the alarm without errors but the array is never updated to show that an alarm is present even when the timeout case executes, which makes me think the alarms are not being created correctly. Subsequently I can't select an alarm to clear so I can not clear or acknowledge any of them.

 

Regards,

Peter W.

0 Kudos
Message 2 of 9
(3,031 Views)

Try to change the computer name to your computer name or localhost where it is piped into the for loop.  

IE: change

 

\\Database\Process Name\UserDefinedEvent

to

\\localhost\Process Name\UserDefinedEvent 

 

Then it should read the events you created.

0 Kudos
Message 3 of 9
(3,022 Views)

Try to change the computer name to your computer name or localhost where it is piped into the for loop.  

IE: change

 

\\Database\Process Name\UserDefinedEvent

to

\\localhost\Process Name\UserDefinedEvent 

 

Then it should read the events you created.

0 Kudos
Message 4 of 9
(3,021 Views)

Hi Matt,

 

I'm not following where you are talking about. There is a string array with the path listing you are talking about but it isn't linked to anything and changing it did not allow me to create any alarms. From what I can see there is no other location where I can change from database to localhost. The "machine name" line that is going into the for loop is a value grabbed from the registry and if I wire the path string into there then it causes further errors.

 

Regards,

Peter W.

0 Kudos
Message 5 of 9
(3,008 Views)

Sorry, I meant the while loop where the event structure is.  There is a 1D array of BV Tags as the help calls it.  I call them shared variable paths.  The path is:

\\Database\Process Name\UserDefinedEvent

 

it should be:

 

\\localhost\Process Name\UserDefinedEvent

 

or

 

\\yourcomputername\Process Name\UserDefinedEvent

 

You know what, here, I will do it for you.  Now the attached vi should work.  Please, I need to know how to acknowledge and clear an event.

 

Thanks

0 Kudos
Message 6 of 9
(2,999 Views)

Hi Matt,

 

Thank you for attaching the new code, I didn't realize there was a path in that constant since the original box was so small. Part of the problem you are seeing actually lies within that path, you should be locating to \\*\Process Name\UserDefinedAlarm now that you switched from working with events to alarms. Also, you are still using the Set User Defined Event.vi and Read Events.vi, which need to move over to their Alarm counterparts.

 

Once you have those changes made, you need to alter the way you are trying to acknowledge the alarms. The problem isn't within logging the time but that the alarms are not being acknowledged at all. If you use the Read Alarms.vi and then wire the "alarms" output into the acknowledge function then it will acknowledge all of the active events (you may have to change the acknowledge type to Alarms). If you only want to acknowledge a single alarm at a time then you will need to trim down that cluster to focus on your selected alarm.

 

Finally, the way you are logging to the multicolumn listbox is not functioning correctly. I would suggest you look at the DSC Alarms Demo example (Help » Find Examples... » Toolkits and Modules » Datalogging and Supervisory Control » Alarms and Events » DSC Alarms Demo.lvproj). In that example there is a subVI, which is not part of the Alarms & Events palette but probably should be, named Format Alarm Data.vi. It is used in the first three examples under that project and should work better for logging all of your alarm interaction than searching through the database.

 

Regards,

Peter W.

0 Kudos
Message 7 of 9
(2,980 Views)

Ok, Peter, listen, I want to create an event and then clear an event.  Not an alarm.  There is no Event counterpart to:

 

Acknowledge Alarms.vi

Clear User Defined Alarm.vi

 

I want to create an event, acknowledge the event and clear the event.  This is so that it will be removed from the active events list.

 

Set User Defined Event.vi creates the event.  How do I acknowledge the event and clear the event?

 

Remember, event, not alarm.  The code is there, it would be useful to modify it and repost the code once you get it working.

 

Thanks

 

PS: I know how to create an alarm, acknowledge an alarm and clear the alarm.  It then gets removed from the active alarms list.

0 Kudos
Message 8 of 9
(2,974 Views)

Hi Matt,

 

Sorry about that, I just got confused thinking you were moving from events to alarms not alarms to events. There isn't a VI for either of those functions because there is no need to acknowledge or clear an event, they are instantaneous occurrences that happen in the background. If you want to interact with them then you should be using alarms. You can refer to the help topic below for a more detailed description of the difference between the two.

 

Using Alarms and Events in DSC Module Applications (DSC Module)

 

Why do you need to use events instead of alarms?

 

Regards,

Peter W.

0 Kudos
Message 9 of 9
(2,959 Views)