LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple LABVIEW GPIB Commanding alternating Write followed by read many times

Hi,

 

I am trying to convert my labwindows C program over to Labview.  This is a VISA GPIB application.  I have seen how you can send multiple

commands in Labview by sending the commands separated by semicolons.  However with my instrument.  I need to write one command

then immediately read the command. and report the results to a text window for user visual verification.

 

In C is sent around 47 or so commands to the instrument just to be sure all of these parameters have the correct configuation.  I did this with a

Array of strings with each element a string command.  then simply used a for loop in C to send to visa ViPrintf function.  Always one write and one read followed by displaying the command string and the response to the instrument.

 

I would like to do the same thing in Labview. 

 

Thank You for your help,

 Gary

Message Edited by golson on 07-14-2009 04:02 PM
0 Kudos
Message 1 of 8
(3,788 Views)

OK. So what's your question? LabVIEW has VISA functions as well. VISA Write and VISA Read. LabVIEW has loops. LabVIEW has arrays. Thus, you can create an array the same way you did in LabWindows, and drive a loop with that array, and send a write followed a read.

 

Perhaps you can clarify what you're asking for. 

 

Have you looked at/gone through the tutorials? To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

0 Kudos
Message 2 of 8
(3,783 Views)

Hi,

  Thank you for the information.  I need to learn how to create the array of strings to feed the ViPrintf function. 

I have been looking through a lot of information.  Have not found a example of how to do this.

Thank You,

Gary

0 Kudos
Message 3 of 8
(3,776 Views)
Are you talking about a static array, or an array in which the strings are created based on some parameters? If you're just talking about a static array then place an array constant on the block diagram and drag and drop a string constant into the array container. Then type away. If you need to create an array of strings as a function of something else then you will need to provide more information as to what this is.
0 Kudos
Message 4 of 8
(3,770 Views)

I hope you figuratively mean ViPrintf.

 

Your VI should look something like the code below.

 

Write Array.PNG

Message 5 of 8
(3,765 Views)

Hi,

I will try that. I need just a static array that can hold around 50 strings.  Then increment through to send strings out.

I am still a novice with labview. 

Thank You,

  Gary

 

 

0 Kudos
Message 6 of 8
(3,763 Views)

Between you and me gary, 18000 post ago, Dennis was a novice too!

 

Good luck, post back if you need any more help.

Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(3,738 Views)
Lot longer than that actually. I also moved from Labwindows to LabVIEW but that was the Labwindows version for DOS and LabVIEW v3.Smiley Happy
Message 8 of 8
(3,728 Views)