02-15-2013 11:15 AM
Hello, I've made a VI that consists of two Tab pages. Each of page have three buttons...... ->thee measurement procedures
When starting the VI, always the Initialization is done. When swiching between pages, always the initialization is done.
Everything works fine except: when switching between pages, Initialization is done twice!!!!
How to avoid that?
Solved! Go to Solution.
02-15-2013 12:25 PM
And it should, with the way your code is set up. You should only have one event structure in this vi. The fact that you have the two in different cases doesn't isolate them. What is happening is when you change tab pages both event structures trigger, firing off the initialation code. You don't need the case structure, at least not for the events. Have only one event structure, it will handle all of the various buttons, regardless of which tab page they are on. They may be hidden from the operator (visually), but are not in the event structure layer. So, pull out the event structure from the case statement.
02-15-2013 01:46 PM
But what to do if I it is necessary to keep two pages with different measurement procedures? Depending on chosen page different Initialization procedures are used... and only afterwards thr Measurement procedures will work.
02-15-2013 01:56 PM
Generally, tab controls are a visual aid for the front panel to group like controls. The terminal is not connected to anything in code.
It sounds like you want a "state machine". Search the forums and LabVIEW help.
Your code is basically inside out right now. You should only have a single event structure and make that the outer most structure (just inside the outermost program while loop.)
Inside the appropriate event cases (one per event/action) use a case structure that determines what code to run based on your different measurement procedures.
02-16-2013 10:20 AM
Thank you for ideas... I've solved the issue with steady state machine