Hi,
I am currently developing a C++ application employing the NI GPIB-USB adaptor to communicate with a range of Pulse Pattern Generators (with their respective features and command sets defined in a configuration file). As, at the moment, all of our other PPGs are in use, I mainly test the software with an old HP8116A. As I encountered the following problem just recently, I can not verify if it is independent from the used PPG:
When my program is loaded up (or the PPG configuration file is changed), I issue a number of GPIB commands. The type and order is very close to the example code delivered with the GPIB adaptor:
Call SendIFC to the GPIB board,
issue a FindLstn call,
do a DevClearList,
define my device over ibdev and a user-defined GPIB-Channel,
do a ibclr on that device
, and afterwards start to ibwrt a number of commands to it. The ibclr call is just there for testing purposes, as I assume it would not be neccessary after the DevClearList. I also tried versions with only one of the two clear commands, and no clear command at all.
And finally, my problem: If I simply start my application, the PPG resets to its standard settings (due to the clear calls) and afterwards reacts to no command issued by the program. I get no ibsta error byte, and NI Spy logs every write command I send without an error. Trying to read something from the device results in a timeout.
But if I instead first start the GPIB explorer and take a look at the GPIB fork and afterwards start my program, everything is running fine. Using NI Spy, I saw the large number of VISA commands issued when taking a look at the devices-fork in the GPIB Explorer. I have NI CVS and the appropriate VISA device drivers installed, but as I want to keep the program as small and portable as possible, it would be best if there was a workaround without including visa.h and just using the includes provided by the GPIB adaptor.
Other things I tried:
Use various other orders of the issued GPIB commands. As this does not change anything, I am quite sure that just nothing happens after the clear command.
Add *very* long wait times between each GPIB command. Does not help.
Thanks in advance,
Nils