Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB device returns no errors

Hi
 
I am currently trying to interface a Agilent E4405B with a NI  GPIB card. It actually works already, but:
 
I do not get any errors when I write an invalid command to the device.
 
I use GPIB Write and I then check the status array for the errors. No matter what I write, I always get bit 7 set to true (CMPL - Command complete) and bit 15 to false (telling me no error occured).
 
Am I doing something wrong ?
0 Kudos
Message 1 of 5
(3,933 Views)
The NI-488.2 status indicates the success/failure of the driver to be able to send the buffere. It has no relation to whether the buffere contains valid data. You will need to do a device-specific check for that. If the device is IEEE 488.2, you can do a *ESR? query to read the event status register. The error should generate a command error, which would set bit 5 of the 8-bit value (contains bits 0-7).

If you have a SCPI instrument, you can query the status queue to determine more information about each error.

Please refer to the documentation of your instrument for more information.
0 Kudos
Message 2 of 5
(3,925 Views)
why does it have to be so easy 🙂
 
thank you - I checked the documentation and found the *esr? Now it works as expected.
 
But  I'm coming up with my next question 🙂
0 Kudos
Message 3 of 5
(3,919 Views)

Hi,

Could I theoretically use the event Status register as a temporary storage register? That is if I Write "*ESE 144" and then do  aquery "*ESE?" I get "144" with the NI-MAX Device Communicator and a  Test device.

I try to do it with another Test Device from Agilent and a Controling PC both connected via GPIB, but I received all the time "60" on that query although the prior code performance was "*ESE 144".

Is it possible to do this?

Yariv3G

 

0 Kudos
Message 4 of 5
(3,841 Views)
I would say this is a bad idea, but it could work.  Some instruments may not allow you to write the ESE with just any old value.  Also, you're enabling events for this, so basically you're going to get more service requests depending on what you've written to the ESE.
 
Scott B.
GPIB Software
National Instruments
0 Kudos
Message 5 of 5
(3,827 Views)