From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

take readings through GPIB, but very slow

Hi, I just wrote a programm take readings from two equipments.( one is a current source, the other is a voltmeter) the current source will sweep from a lower value to a higher value automatically, and for each current value taken the corresponding voltage value needs to be recorded almost at the same time. But it seems that the data recording interval ( the time interval between consecutive data recording) is very long about 1/sec.

all the data recording is within a while loop. I put no delay in the loop in order to test the fastest rate of data recording, but sadly, I got that result.
For Current source, I make use of the VISA session inherited from initialization at the beginning of the program. since there cannot be t
wo VISA session running at the same time, I use a small VI (including VISA open-take reading-close) for taking the reading of voltage. and put the two taking reading action in a "sequence" structure.

what is the possible reason of causing that, assuming individual reading taken from equipment equipment is very fast? (Sorry, I only test the current source reading, it is very fast, but forgot to test the nanovoltmeter rate)
0 Kudos
Message 1 of 8
(3,911 Views)
For one thing, remove the VISA Open and Close from the voltmeter VI. If you are using a version of LabVIEW older than 6, put the VISA Open for each instrument outside of the loop and just pass the VISA session references. When the loop completes, use the VISA Close on all open sessions. I don't know where you got the idea that you can only have one session at a time. There may be some upper limit but I've never reached it. Also, it would help if you could attach your code and describe the actual instruments that you're using.
0 Kudos
Message 2 of 8
(3,909 Views)
Hi, I use Keithley Nanovoltmeter 2182. It has 2 channels. I need to take the readings from the voltmeter simultaneously. What I do is that I open a visa session for channel 1,take reading, and close it, secondly I open a visa session for channel 2, take reading, and close it. when I put the action into the loop 50 times. it was found that when I only take the reading from channel 1, and save the data. the speed is very fast about 4 data/sec. For only channel 2, the speed is slower about 2 data/sec; when it comes to 2 channels, it will take about 1.5 sec/datum. what is your suggestion?
I open a visa session for channel 2
0 Kudos
Message 5 of 8
(3,909 Views)
I don't see how you can open a VISA session for each channel, typically there is one session for the instrument and you select the channel by sending commands to it. Your instrument would have to support reading from both channels simultaneously and I don't think that it does.

Brian
0 Kudos
Message 7 of 8
(3,909 Views)
Brian is right about the VISA session. You have one per instrument and not one for each channel of the same instrument. Remove the extra VISA Open/Close and check the speed. If channel 2 is still slower, maybe it's configured differently? Autoscale typically takes a long time. As far as simultaneous readings, the best way to do this is with a trigger. If you can configure each channel to use the same trigger, then they'll acquire simultaneously. Try the VISA Assert Trigger function. If the instrument doesn't support this, see if there is a command where a channel takes a measurement and stores it. Then you could do for example, a Meas Ch1, Meas Ch2, Read Ch1, Read Ch2. You wouldn't have quite simultaneous readings but it would be f
aster than telling Ch1 to take a reading, transferring the results and then doing the same with Ch2. Finally, I would suggest you contact a Keithley Application Engineer to get their recomendation on the best way to accomplish what you need. They may not be able to provide LabVIEW VIs but a Visual Basic, C, or pseudo code example can be easily translated.
0 Kudos
Message 8 of 8
(3,909 Views)
Try the program without opening a VISA session. VISA write and VISA read do not need the open and close VIs. Just feed the VISA resource name directly to the read and write VIs. I have written numerous GPIB programs without using VISA open and close.

I've found using GPIB direct (no VISA) to be faster as well. It takes very little work to change a program from VISA to direct GPIB.

Check the instrument documentation. Some instruments do not multitask when talking on the GPIB. They take a reading and then send the data. 1 second sounds reasonable for some instruments. The more accuracy you are looking for, the longer it takes a voltmeter to get a good reading. What is the voltmeter's acquisition time?

I hope this gives you some ideas that will help.


Rob
0 Kudos
Message 3 of 8
(3,909 Views)
CPU:

You can certainly have multiple VISA sessions open simultaneously. Just make 2 instances of the VISA refnum (in LabVIEW 5.x terminology) or of the VISA I/O control (in LabVIEW 6.x terminology).

As long as you have NI-VISA 2.5 or higher on your system, the VISA performance should be identical to raw GPIB performance. You can get the upgrade to NI-VISA 2.6 by going to our web site at www.ni.com and choosing Download Software.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 4 of 8
(3,909 Views)
Hi, if I have 2 visa sessions running at the same time and put them into a while loop (because I need to take readings from the 2 instruments simultaneously), can I just leave the 2 visa-read action in parallel? what I am doing now, is put the 2 reading actions in a sequence structure. take 1 reading from one instrument(frame 0) and then from the other( frame 1). because I am afraid they will crash if I just put it parallel. Seek for your suggestion.
0 Kudos
Message 6 of 8
(3,909 Views)