LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

execution time of a simple vi too long

I'm working with LabVIEW 6.0.2 on a computer (AMD ~700MHz) under Windows 2000. The computer is connected to the instruments (eg Keithley 2400 Sourcemeter) via GPIB (NI PCI-GPIB Card). When trying to read the output of the K2400 with a very simple vi (sending the string READ? to the instrument with GPIBWrite (mode 2) and subsequently reading 100byte with GPIBRead (mode 2) from the instrument, the execution time mostly exceeds 1s (execution highlighting disabled). Sometimes, it can be much faster but this is very irreproducible. I played around with the GIPBRead and Write modes and with the number of bytes to be read from the device as well as with the hardware settings of the Keithley 2400 but nothing seemed to work. The API calls ca
ptured by NI Spy mainly (lines 8 - 160) consist of ThreadIberr() and ibwait(UD0, 0x0000).
As this problem is the main factor limiting our measurement speed, I would be grateful for any help.
Thanks a lot
Bettina Welter
0 Kudos
Message 1 of 3
(2,829 Views)
Have you tried using the VISA API to communicate with the instrument instead? I know adding yet another layer of software may not sound like a way to improve performance, but it's worth a shot. I know that NI-VISA does a lot of buffering and optimization behind the scenes for you, and by default it uses asynchronous I/O, which will at least let the non-I/O-bound parts of your program keep running.
0 Kudos
Message 2 of 3
(2,829 Views)
Hello,
Thanks for contacting National Instruments. It seems like the 1 second delay that is occurring is due to the operation being called. ThreadIberr returns the value of iberr, while ibwait simply implements a wait. These two get called repeatedly while the GPIB device waits for the instrument (K2400, in your case) to finish its operation and respond back. It is quite possible that when you query the Keithley to send back 100 bytes of data, it has to gather them from its buffer (if its already been generated). And if there aren't 100 bytes of data in the buffer, the Keithley will keep the NRFD line asserted while it gathers 100 btyes of data. After the data has been gathered, the NRFD line is deasserted, at which point, ThreadIberr will detect the change in th
e ibsta status bit and read the 100 bytes.
So make sure that the 100 bytes of data that you are requesting don't take too long to be gathered, since this is where the main delay lies. Hope this information helps. Please let us know if you have further questions.

A Saha
Applications Engineering
National Instruments
Anu Saha
Academic Product Marketing Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,829 Views)