LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure

Hi all,
 
i tried doing a vi that is able to run more than one test at one go but the 'Ok Button' is the only one that respones. When i click RF/Acoustics/Baseband button, it didn't do anything which is not right.
 
what went wrong? Thanks for any help given.
 
Currently using labview version 8, winsXP.
0 Kudos
Message 1 of 3
(2,365 Views)
The first problem is that you need to create a single event structure with a separate case for each event that needs to be detected. Basic rule: Only 1 event structure in a VI.

Second, the boolean buttons that trigger the action should be inside the event case that is servicing them. Otherwise the mechanical actions won't work properly.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(2,355 Views)

I would recommend to study some of the shipping examples and online help. Whatever you are doing makes no sense at all.

  1. The STOP primitive is virtually never needed because the VI will automatically stop once the code finishes.
  2. It is of no use to place anything inside the timeout case if you don't wire a timeout. It will never time out and the code will never activate.
  3. Don't place event structures inside event structures. In your case, the front panel locks until the event completes, meaning once the OK button triggers, you are deadlocked. The inner event structures cannot trigger because the front panel is locked and the outer event structure cannot finish until all inner events have triggered.
  4. The inner case struture has no use, because only the TRUE case can ever be reached.
  5. It is recommended to use execution highlighting if things don't work as expected. A great debugging tool. Try it!

It is not clear how this VI integrates with the rest of your code. Can you describe how it is supposed to be used? Where are the "tabs" to be shown? What should happen if OK is pressed?

Typical event use:

  1. An event structure belongs inside a while loop. (and don't use the "continuous run" button to run the code!)
  2. Use a single event structure and add event cases for all desired actions.
  3. Place the terminal of latch mode buttons (mechanical action) inside the appropriate event. Latch action buttons (such as your OK) revert once they get read by the code. If you would place the terminal outside the event, it will not get read by the event and thus might not reset.
  4. Switch mode buttons can be anywhere you want. If the value is needed inside the event case, use the "new value" terminal.

In the attached quick modification, the user can change one of more of the switches. Pressing OK will hand all the final switch states to the calling program via output connectors. We can only guess unless you give more details on the intended use. 🙂

This is just a very quick draft. You need to adapt it to your exact requirements.

0 Kudos
Message 3 of 3
(2,342 Views)