LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Jumping out of case structures other than by STOP

Solved!
Go to solution

Hello,

 

I have a VI where I first select one of three switches to read from different gauges. At the moment when each gauge is selected a case structure is selected and data is recorded from that gauge until stop is pressed. There is no means within the VI to change gauges mid flow so to speak without first stopping and restarting and saving the file afresh. I would like to be able to press another gauge button and the software automatically continue recording daat from the different gauge.

 

To do this I need to jump out of the central case structure and revert back to the beginning. How do I do this?

 

Also, in each case structure there is a facility for saving data so by jumping out of the case structure and into another one it will ask me for a new file name and save a new file afresh. I need to put the SAVE File outside of the case structure. Is there a quick and easy way of doing this?

 

 

Nevica 

Message Edited by nevica on 08-21-2009 06:35 AM
0 Kudos
Message 1 of 23
(3,545 Views)

Hi nevica,

you shouldn't use the local variable. It should work as expected if you stop only the inner loop. Use a second "stop" button for the outer loop. You can then use a local variable from the second stop button to stop also the inner loop. Use a or assignment to do it.

You should insert a function to select the gauge while the vi is already running. You can use an event structure for it.

 

Mike

Message 2 of 23
(3,532 Views)

I am sorry. I dont quite understand what you mean.

 

Do I have to use a stop button for a while loop or can I jump out some other way. I need to be able to stop the inner loop or select another gauge seamlessly. I think you are saying that I put my actual stop outside of the inner loop and provide locals for the inner loop from the outside stip. Is this corrent?  What difference will it make by making local 'stops' to the inner while loops? and the outer loop the actual stop button.

 

I don't know what an event structure is: Could you please be more specific.

 

What do you mean by Use a or assignment to do it.?

 

Nevica

Message Edited by nevica on 08-21-2009 07:15 AM
Message Edited by nevica on 08-21-2009 07:16 AM
0 Kudos
Message 3 of 23
(3,521 Views)

Hi nevica,

the attached picture shows how you can stop the two loops.

I think you need the event structure to select the new gauge.

 

Mike

Message 4 of 23
(3,506 Views)
How do you make this work. When I looked at your code you are reading from com1 for every case. Do you switch the gage on com one to get the different reading from you gages? I would also agree you need to move to a state machine and event structure format. It will make your life so much easier. As soon as I understand what you are doing I will be happy to give you an example.
Tim
GHSP
0 Kudos
Message 5 of 23
(3,497 Views)

Hello Aestat,

 

Within each I/O Assistant I have different commands (@0000, @0001, @0002) which select different gauges over the same COM1 line. It is a device which can select to read from 1 of three pressure gauges. Does this help. That is why I need a case structure to select each of these commands.

 

nevica

0 Kudos
Message 6 of 23
(3,496 Views)
Give me a few minutes and I will have some code to show you.
Tim
GHSP
0 Kudos
Message 7 of 23
(3,488 Views)
OK here is the first try with state machine and event structure. I can not trouble shoot your com stuff since I do not have the device to take too so I hope that you understand what I did so far. If not just ask. I have not gotten the save data to work yet.
Tim
GHSP
Download All
0 Kudos
Message 8 of 23
(3,464 Views)
Here is a version with save working.
Tim
GHSP
0 Kudos
Message 9 of 23
(3,460 Views)

Hello Aestat,

 

Thanks forthe time you have put into the VIs. Unfortunately I cannot open any off the files as I am still using LV 7.0. Could you please save in this format or do a screenshot please?

 

Thanks,

 

Nevica

0 Kudos
Message 10 of 23
(3,442 Views)