09-30-2011 06:06 PM
Seeking help with following questions:
1 Background:
An instrument is connected to computer over USB.
Instrument uses NI driver wizard based driver.
Instrument follows default attribute settings (send/receive termination=CRLF, termination enabled flag=0)
2 Problem Sequence:
2.1
NIMAX ( 5.0.0f1 ) opened.
Able to send commands and receive response.
NIMAX closed.
2.2
VISA tester (an internal software program ) opened
Able to send command and receive response once .
VISA tested closed.
2.3
NIMAX opened again.
Is not able to communicate to the instrument.
Provides the following error: (Hex 0xBFFF0015) Timeout expired before operation completed.
2.4
While keeping NIMAX open and keeping instrument powered on,
if the USB cable is physically disconnected and connected back, NIMAX resumes its normal operation !
means NIMAX is able to send commands and receive responses again.
Above problem is observed on 64bit windows7 and 32bitWindowsXP, 32bitWindows7
We have tried flushing the buffer programatically in our target application (the problem happens in NIMAX so we are describing it to remove our target program as a variable). It did not help.
3 Questions that need help.
3.1 Need help in the following:
3.2 If NIVISA opens a separate session each time, why is communication stuck the second time?
3.3 Why is NIVISA not able to reestablish the condition which VISA tester program might be disturbing (if it is)?
3.4 Why is NIMAX able to communicate well, after disconnection and connection back, without changing anything else?
3.5 What is getting fixed due to disconnection and reconnection?
3.6 What can be done programmatically via VISA to achieve the same result (communication coming back to normal) as disconnection and reconnection of the USB cable?
10-03-2011 05:26 PM
Hey Chas2003,
From MAX working and VISA only working once, my first guess is that you may not be closing something properly in VISA. However, from this KB (http://digital.ni.com/public.nsf/allkb/A8E297E42E04AEDB86256AB100059605?OpenDocument) it seems as though if you’re using LabVIEW, this shouldn’t be the case.
If you generate a log file for your operations and test what happens during MAX operation VS what happens when you’re using your VISA tester, you might be able to find the difference. This KB will explain how to use NI I/O Trace (http://digital.ni.com/public.nsf/allkb/282C5D41E2BA04F2862574BA007803B9) to generate a log file of the commands that you send to your device.
Regards,
Michael M
NI Americas | AE
NI.com/support | 1866-275-6964