LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

turning off section of a loop

I have 5 of the same instruments connected to my program so I have the same proccess happening at the same time for all 5 instruments. I have the 5 serial ports initialized at the beginning and then the 5 processes in the loop happening using subvis since I am doing the same thing for all the instruments and then after the loop the 5 visa close.

 

I want to be able to turn off the instrument if I want. For example, if I only had 2 instrument I would turn the other 3 off with a switch. I am still learning labview and I can not think of an easy way to do this.

 

Thanks for the help

0 Kudos
Message 1 of 4
(2,601 Views)

Connect the swiitch to a case statement.

0 Kudos
Message 2 of 4
(2,590 Views)

Well I want to be able to display more than just one of the sets of data. I want to be able to turn them all on if I wanted not only 1 at a time. I will not always have 5 instruments connected though so I want to be able to use just 4 or 3 or 2 or 1...

 

I was just going to put a on off switch for each and  put each instrument code in a case statement but I do not know what that will do since the visa serial is outside of the loop.

0 Kudos
Message 3 of 4
(2,580 Views)

Don't understand your last comment. The instrument code would presumably be the VISA Reads and Writes and would not be outside the loop. The VISA Resource would simply be passed through the case statement when the instrument is disabled with the front panel switch. You would also have empty data in the disabled state. Since you did not post your code, I have no idea what the data type might be. Perhaps an empty array? Perhaps a NaN?

0 Kudos
Message 4 of 4
(2,575 Views)