Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does viRead on GPIB device take 1 minute and completes normally

I am running Window 7 on a PXI-8108 processor.  I have installed NI-488.2 version 2.80, NI-PAL version 2.5.4, NI-Serial Version 3.6, NI-VISA version 5.0, NI-VXI version 3.7.  When accessing IEEE-488 devices, the viWrite function works normally.  However, the viRead functions all take between 45 and 60 seconds to complete.  According to NI-SPY, the reads complete normally.  What can I do to improve the performance?  When this hardware was running on Windows 2000, these same reads were in the milliseconds range.

0 Kudos
Message 1 of 5
(3,895 Views)

Hey debatbae,

Which SCPI commands are you trying to write and read?  My first thought is that you may have the viRead set so that it is expecting more data than it actually receives and it then eventually times out around 45 seconds and returns whatever data it had read up to that point.  The default timeout for these commands is usually ten seconds so something taking 45 seconds seems unusual.  Have you modified the timeout or the expected size of the viRead command.  You can find how to set the expected size of the viRead command here: http://www.ni.com/gettingstarted/setuphardware/instrumentcontrol/gpibconnect.htm.  Please post back with this information and any additional questions you may have.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 5
(3,869 Views)

Thanks for your response.  I am reading from a SCPI instrument that is only sending 3 bytes of data.  I am asking for up to 100 bytes.  However, the handle has been conditioned to end on EOI or EOS of a line feed.  The return status is VI_SUCCESS, and the return data is "1<CR><LF>".  This is a status response from the instrument. The handle is also conditioned to use readdress always.  As I indicated, in my original post, this code currently runs on Windows 2000 and Windows XP.  There are no issues with speed there.  I have noticed in Windows 7, that sometimes the viWrite will also take a very long time to complete.  That phenomenon occurs when the instrument address changes.  I have also noticed that sometimes the extra time is 32 seconds and sometimes 1 minute.  I am not sure why.  Keep in mind that this code is compiled using Microsoft Visual Studio 6.0, and uses IVI C drivers.  All of our I/O is through VISA.  We have three VXI chassis full of instruments and 10 GPIB devices.  The VXI devices are connected via an NI-8320 MXI controller.  The GPIB is built into the the NI-8108 CPU.  I have not noticed any problems with the VXI instruments if that helps.

0 Kudos
Message 3 of 5
(3,866 Views)

Hey debatbae,

It would be useful for us understanding what is going on with your system if we had the Max Technical Report (http://digital.ni.com/public.nsf/allkb/271F252B4EF0A2E0862570E70056A1E4) and your NI Spy I/O trace for when you are doing the viReads and viWrites.  I would also be interested in seeing if you get the same delay when running commands using the Measurement and Automation Explorer Test Panels or if it is just seen with the compiled code from Microsoft Visual Studio 6.0.  

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 4 of 5
(3,858 Views)

Hi Kevin,

 

I replied to your question and attached the files.  However, it created a new thread instead of ading to this one.  Don't know why.

 

Dale

0 Kudos
Message 5 of 5
(3,813 Views)