LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to initialize event structure and then only run the event structure when selection is made

I have pressure data coming in from a DataAq box for 10 pressure transducers. The pressures are displayed with analog gauges and digital indicators. I have set up property nodes for the 10 analog gauges. The property nodes are slowing down my stopwatch functionality so i decided to put them into an event structure that triggers when a unit (PSI, KPA, Bar) selection is made or changed. The default is PSI.

 

What i need the event structure to do is initialize in PSI and then only run when the units are changed. currently i only have the event structure running when a unit change is made.

 

When i run the application, the gauges come up in psi and then when i make a unit change the scales remain in psi and then each unit selection is off by one (PSI yields KPA scale, Bar yields KPA scale, KPA yields PSI scale).

 

How can i make the Event structure run when the executable is opened and after that only run when a unit change is made?

 

 

0 Kudos
Message 1 of 8
(5,433 Views)

Without looking at your code there are many ways to handle this.

 

1) Use the sub-VI that you use in the Event once when the app starts.

 

2) Similar but use "value Signalling" to trigger the event.

 

...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 8
(5,430 Views)

Ive attached the code

0 Kudos
Message 3 of 8
(5,427 Views)

I tried using a first call function with the event structure but it only ran once. Currently the event structure is triggered off a unit selection change. But i still cannot get it to initialize the first time.

 

I forgot to mention using labview 8.6

0 Kudos
Message 4 of 8
(5,424 Views)

I'd just duplicate the code and place it before the event loop. The enforce sequencial execution with the error wires or even using a flat sequence structure (Init, Do, Cleanup Sequences are not considered harmful).

 

Felix

Message 5 of 8
(5,411 Views)

Thank you all for your help...i was able to perform the functionality by using a shift register with a combination of not equal, or and first call fuctions.

 

Problem resolved.

 

thanks again

0 Kudos
Message 6 of 8
(5,403 Views)

Hi,

 

as mentioned before, you should put a simple "Value (signalling)" property node into your VI, just before the while loop starts:

19167i08D864E4933020A9

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(5,398 Views)

I don't want to sound fussy, but your architecture is awful.  First of all your block diagram is way too big.  It should fit on one screen without having to scroll a mile to see all the code.  You can get rid of the sequence structure, it is not needed.  The wires from the first two vi's will make the execution flow happen.  You have an event structure, yet you are using polling methods for all the case structures.  You can put each and every one of these cases inside your event structure and create events for each of the variables connected to the case selector (question mark).  If you did this, you could fit the entire BD on one screen.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 8
(5,384 Views)