LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do Boolean switch events stop registering after a user prompt.


@RavensFan wrote:

I wouldn't go that far.


Yeah I think we more or less agree.  When done right multiple event structures (in separate loops) can be a fine tool.  But if I see a random VI with two event structures in it, historically there is a 90% chance it is doing something wrong.  So just giving a blanket statement like "Don't do it" fixes those 90% issues, and in the 10% cases we  end up having conversations like this.

0 Kudos
Message 11 of 14
(926 Views)

So how do you handle thesituation where it take to event to make something happen. as an example , this ps require you to push the shift key then let say local which toggle the ps channel being displayed. I tried with 2  different keys in the evenrt structure but that dont work.

0 Kudos
Message 12 of 14
(920 Views)

@RavensFan wrote:

You have an event structure inside of an event structure.  Bad, bad, bad.

 


Why is there a timeout event? Why is there a 1000ms wait in the upper left? Why can't the VI be stopped?

 

Basically, you are queueing up an infinite number of events in the inner event structure until shift is changed. At which point, the oldest event can execute until shift is changed again. Each of the inner event is still set to lock the front panel, so you cannot change "shift" and the event queue can never be emptied. Even if you unlock all events, things will not work right.

 

For example, if OVP is changed, both the inner and outer event structure queues up the event, but the inner one cannot react and thus will lock the panel forever.

 

What you need to do is use a single event structure. You can keep the shift state in a shift register and modify the triggered execution accordingly.

You can even eliminate the outer case structure by placing the display code inside the timout event. Set the timeout to infinity (-1) in the timeout event and to a small value inside all the other events (also via a shift register, of course).

 

Also, all you latch action booleans belong inside their respective event case so they properly reset to the default state once the event has been triggered. You currently have them aligned ouside any structure, so they get read only once when the program starts. This means the latch action will never work, i.e. they will never reset.

Message 13 of 14
(913 Views)

ok got it . Thanks everyone for the feed back.

0 Kudos
Message 14 of 14
(897 Views)