Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Errors communicating with my GPIB device in C++

I am trying to communicate with a GPIB device via a custom C++ program.  I am using ni488-2.h and the associated obj file.

 

When I send the commands to the device "manually" through the Measurement & Automation Explorer, everything seems to work fine, consistantly.

 

However, when I try sending commands via code, per the example provided ("Show Sample") button.  Some commands return an error, but not all of them, and not always the same ones.

 

The Measurement & Automation Explorer seems to wait after I send a command, and displays "Reading..." indicating that it is doing some sort of check to ensure there is data to be read...or something.  However the sample code doesn't do this.  It's the only difference I can find, without actually being able to see the code M&A Explorer uses.

 

Any help would be appreciated.

 

Thanks

 

EDIT: The device I am communicating with: S380 Dual Channel Optometer (UDT Instruments)

via: GPIB-USB-HS

using drivers (header file etc.) from May/Jun 2014

0 Kudos
Message 1 of 2
(4,367 Views)

If you installed NI-488.2, it will install sample programs. In Windows 8.1 C:\Users\Public\Documents\National Instruments\NI-488.2\Examples

0 Kudos
Message 2 of 2
(4,362 Views)