08-11-2009 03:51 AM - edited 08-11-2009 03:57 AM
Hello,
I have a vi in which I have three case structures (true or false elected by a button on the front panel). The first case structure works correctly but the second and third do not select properly. (ie, do not loop as they should when selected from the front panel individually). The vi has been written in 7 Express. Any help as to what is wrong with the structures would be most appreciated.
Nevica
Solved! Go to Solution.
08-11-2009 03:58 AM
Hi Nevica,
can you explain what you expect?
Mike
08-11-2009 03:58 AM
Wow, you must have a very, very big screen or resolution!
Your description is vague, so I don't really know what exactly is not working.
Maybe you should delete the contents of the cases and just plase a message box inside for testing purpose to see whats going on.
Christian
08-11-2009 04:11 AM - edited 08-11-2009 04:12 AM
Hello Mike and Christian,
The case structures are initiated by switches on the front panel. If I select one of the switches (true) then CONTINUAL data acquired for that input channel. A loop should be initiated by selecting a switch as true. This only works for the first case structure.
A loop structure, ie data is continuously acquired for the first case structure (1000 Torr Gauge) but for the second and third structures only one iteration is initiated therefore only one data point is acquired. I need the case structure that is selected to loop until stop is pressed.
nevica
08-11-2009 04:11 AM
You should remove the "Flat sequence structure".
The first frame is executed but the other two won't execute as long as the first one isn't finished.
So when you press button 2 or 3 but frame 1 is still busy, the code of frame 2 or 3 won't be executed.
08-11-2009 04:19 AM - edited 08-11-2009 04:20 AM
Hello Alain,
But surely if I just select the second structure as true and the first structure as false then when the vi pointer gets to the first structure and sees false it will select the false pane in the structure which does nothing. It should then pass onto the second structure (returning true for the error) which is true and then run that procedure. This doesn't seem to be happening in that it doesn't get past the first false structure (I am not sure if this is happening). Why is this happening?
What is the point of removing the flat structure? Why did you suggest this?
Nevica
08-11-2009 04:29 AM
08-11-2009 04:30 AM
08-11-2009 04:31 AM
Do you need the sequence, first use 1000Torr gauge, then the 10Torr gauge, then the 1Torr gauge?
If not then you don't need flat sequence structure. Remove it so that you have three case structures in the loop.
If yes then you're on the good way but: the implementation of the stop button isn't right
Now it's used only in the first frame, so as long as you don't press it that frame goes on, but what did you wire in the other frames is wrong for several reasons
First, you use constants instead of a button
Second, the outputs aren't used to stop the loop
... ...
So can you please clear out the required functionality of the code:
Succesive use of the three gauges or not?
Use of only one gauge at the time or not?
Always multiple readings until the "Stop" button is pressed or not?
08-11-2009 04:39 AM
muks wrote:
You can try doing it like this.
If the three gauges are to be used simultaneously or one after the other, then you can't use your code since it uses only one gauge at the time