LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

basic help

hello friends,

actually I am new to labview..and I got stuck in a problem

actually I have refnum and I want is that if bolean is TRUE the refnum should go to visa close and if its FALSE then it needed to be pass the refnum through the shift register of the loop..

please help me out..that which function should I use..

thanx in advance

0 Kudos
Message 1 of 10
(4,175 Views)

Hi vk29,

 

use a case structure...

 

Next time please attach a VI or atleast a picture of your code. So we could get the context much easier instead of reading between the lines of boolean, refnum, VISA close and shift register...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,167 Views)

in the true case write the visa code, in the false one ... write the other code (shift reg).

 

 

 

0 Kudos
Message 3 of 10
(4,163 Views)

You description makes absolutely no sense. Where is the shift register? What loop? Is the VISA close inside the loop?

 

Please show us a picture or attach some code!

 

Also please use a descriptive title in your posts, directly related to the problem! When you wrote "Basic Help" I thought you had problem with the pH being too high. 😄

Message 4 of 10
(4,156 Views)

Just by your description, I can already forsee a problem.

You should never have a VISA close in a loop. 

It will close the first iteration, then throw an error the next time because it is already closed.

Cory K
Message 5 of 10
(4,150 Views)

sorry friends...here I am attaching the VI

I have tried case structure but it is showing error.Smiley Sad

0 Kudos
Message 6 of 10
(4,144 Views)

Hi vk29,

 

like cory said: move the VISA close after the loop and you're fine. When you close the VISA connection you will loose all functionality in the loop!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10
(4,129 Views)

hello GerdW,

in the solution you gave the boolean close and the boolean stop are doing the same thing..

and I wanted there should be a boolean close such that if its value is true it should close the visa and if its false it should pass the value of refnum through shift register..Smiley Indifferent

0 Kudos
Message 8 of 10
(4,088 Views)

Hi vk29,

 

it makes absolutely no sense to close the VISA reference in the loop! (Or you have to prove the opposite!)

So I attached the VI again with an additional case structure...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(4,071 Views)

It makes sense if the purpose is to close the VISA session so an external program can access the port. In that case, the read and write Booleans would have to be set to false first.

 

Your original program needs to wire the reference from the code outside the loop to the shift register and inside the loop, all of your VISA references should come from the shift register.

0 Kudos
Message 10 of 10
(4,067 Views)