LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Keep triggering or not at all

Solved!
Go to solution

Hi everyone,

 

I am creating a program that monitors 200 alarm tags from the OPC, display any alarm and save them as alarm logs if any single one of them have a change in value (boolean).

 

So far I managed to get everything right except for the event which check for their value change.

 

I noticed that the event structure only response to the buttons in the front panel while the OPC values come as a share variable. I tried using share variable, local variable and the event does not response. I tried using Signalling and Event generation but these keep on triggering the event all the time, creating too much duplicated alarms in my alarm log.

 

Finaly I create my own VI (Indicator Event Check For Every Value in the attachment) that check for the alarm tag to be the same value as previous and only triggering the event when it is different.

 

Although it does what I need, it require me to create a buffer placeholder for all the previous value of the alarms tags, and I have 200 of them. I am wondering if there is a more effective way to do this?

 

Thanks in advance

0 Kudos
Message 1 of 5
(2,556 Views)

do you right click on the event structure boundry and then select the 'Add anevent case' option, when you click it then you will see a window in which all keys and buttons will displayed in a column and beside that column you will see the case you can select like 'Value changed' 'Key pressed' etc

 

I normally used  event structure are mainly used for buttons designed in the front panel of Vi and then check the value changed and perform operation accordingly

 

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

Thanks for your attention Tirmizi, yes I did use the add event case option as shown in my attached zip.

 

Problem is the event structure only recognize buttons press at the front panel (Indicator Event of my attach project), not the share variable of the OPC.

 

When I use the share variable (Indicator Event Shar Var of my attached project) it never register the change.

 

When I try to use signaling (Indicator Event Signaling of my attached project) it keep trigger the event all the time and stop me from doing anything.

 

I try to use the create user event (Indicator Event Generate of my attached project) it also keep trigger the event all the time although it don't stop me from doing other thing.

 

Finally I come up with my own coding to recognize if there is a value change (Indicator Event Check For Every Value of my attached project) and it did what I expect it to. However it require a buffer numeric memory for every alarm, and 200 of them seems a bit much. Therefore I am wondering if there is a more effective method to do it? I am thinking of shift register of the while loop but is that a less resourse intensive method?

0 Kudos
Message 3 of 5
(2,507 Views)

I created another VI called "Indicator Event While Loop to Check Changes" which uses while loop shift register. Is this the best way to do it or there is an easier way?

0 Kudos
Message 4 of 5
(2,502 Views)
Solution
Accepted by topic author Gnostic

It's been more than a month since the last reply. I contacted NI guys for help and was happy with the solution.

 

Note that the user should uncheck the use buffering option for the share variable network or it will cause delay, missused of old value

 

I share this solution in the attachment so people in the future can benefit from it.

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