LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to program Instruments to different values programatically

I am having list of instruments e.g. powersupply, multimeter, etc which i need to automate.

 

I am using two types of looping system,

 

a) For Loop- to run a list of instruments continuoulsy the no. of times i will put in for loop e.g. For(3) will run the instruments within For Loop 3 times.

 

b) Loop- to program list of instruments to different values programatically e.g. Loop(3,5,7) wil program the instrument within the loop first to 3 value then 5 and then 7.

 

and at the end i am using End(For) or End(Loop) to terminate For or Loop.

 

with the help from NI Forum members i am able to run the first For Loop but i want to implement Loop also i tried several logics but not getting how to make a vi so that i am able to run both the looping system simultaneously.

 

below i am attaching the VI.

0 Kudos
Message 1 of 9
(3,309 Views)

Hi Ritu,

 

as first step you should remove "default if unwired" tunnels by wiring them.

Then you should remove the Rube-Goldberg of the 2nd FOR loop...

 

It seems you want to create some kind of simple batch interpreter. To do so you have to keep certain command settings in a shift register, like start index of loop, loop counts etc. Try that - after drawing a sketch on paper (!) to visualize the needed programming steps...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,299 Views)

Thanks GerdW for reply,

 

I tried modifying the code but output is not coming as expected.

 

below attached is the modified vi.

0 Kudos
Message 3 of 9
(3,274 Views)

Hello ,

 

Now i am doing the program to implement only one single loop to program the instrument to several values through automation, in this program i am not getting how to replace the previous value with new one loop values.

 

attached below is the vi which shows the expected output.

Download All
0 Kudos
Message 4 of 9
(3,245 Views)

Hi Ritu,

 

did you notice my signature? Can't open your VI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(3,240 Views)

Hello GerdW,

 

Thanks for the reply,

 

Below i am attaching the vi in LabVIEW 9 version

0 Kudos
Message 6 of 9
(3,236 Views)

Hi Ritu,

 

your batch language is badly designed...

 

It would be much easier to replace values in commands when there is some kind of marker (or format code) to replace to.

Right now you have to make sure your know all commands in advance and you have to know which value to replace in those commands...

 

So instead of having "GPIB0::8::INSTR,NORESET,6,1,0,0,ON" you should write "GPIB0::8::INSTR,NORESET,%d,1,0,0,ON".

Then you just use FormatIntoString to replace %d with the loop value!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(3,231 Views)

because of some project requirement i need to use it like this only, and the problem that i am facing here is i need to replace those loop values with power supply only e.g. E3646 in this case then how to differentiate with E3646 and K2001 like this i am nto able to identify how to work on this. how to make this loop to work properly.

 

0 Kudos
Message 8 of 9
(3,226 Views)

Hi Ritu,

 

you can detect the device by the input string: here you already filter the device type information...

Best regards,
GerdW


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