Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

34401 Query Problem

Hi,

Your string ,"MEAS:VOLT:AC?", sent using the ibwrt function followed by the ibrd function to get the reading should work. Make sure the instrument is not in triggered mode.

Have you checked that your instrument has been setup to use SCPI language and not one of the other supported instruments. Check the manual for setting up your instrument via the front panel.

Have you checked where you can perform the *idn? and get back the query string. If you can't get this then I would say that you have a faulty instrument.

regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 11 of 25
(1,723 Views)

Ray,
Thanks for your response.

Agreed, that command and those functions should work, they work for other instruments and I have used that same exact functions for years on other instruments.  Ive read the 34401 manuals up and down and have set the device to the appropriate address and remote control option through the front panel.
I have tried *IDN? and it also errors.  I have verified that the issue occurs anytime I send a query (whenever ? is added to the command), regardless of the command or the setup.
I have 2 of these units an they both behave in the same manner.  I also tried another GPIB card with the same results.

In my opinion this has something to do with the way I handle the query command and or timing.  Ive tried adding all sorts of delays in different locations with the same results.

I am calling up Agilent today and see if they can help, but please feel free to continue the suggestions, I am in desperate need to get this issue resolved asap.

Thanks
Diego

0 Kudos
Message 12 of 25
(1,716 Views)
Have you tried disconnecting all other instruments and trying to use MAX to communicate with it? Though I use LabVIEW and VISA, I have not had any problems with a 34401. Isolating the instrument will tell you whether the instrument itselft might be bad or whether another instrument might be causing a problem.
0 Kudos
Message 13 of 25
(1,710 Views)

Hi,

What GPIB card are you use?

Ray.

Regards
Ray Farmer
0 Kudos
Message 14 of 25
(1,708 Views)

Dennis,
Yes, I have tried to isolate the instrument on the bus with same results.  I cannot use MAX since the GPIB card does not show up in the hardware list.  I followed the Measurement Computing instructions on how to add the device to the list and therefore have control through that interface, but it never did work.  At that time I left it alone since my 488 based functions worked just fine... that is until I tried to Query the 34401.  Give this issuse, I should get MAX to work only in that it may tell me something that leads to a solution.

Ray,
I am using a Measurement Computing IEEE 488.2 PCI Card.  I have used these before with no issues.
http://www.measurementcomputing.com/cbicatalog/cbiproduct_new.asp?dept_id=106&pf_id=1799&mscssid=UPR...

I just got off the phone with Agilent, they also feel that the issue lies with my code and suggest I use the VISA functions.  I am reluctant, but I have no choice to try that later today.
Another suggestion is to check the actual Instrument error when the error takes place, all this time I have been checking the GPIB bus error through the IBERR command.  It never dawned on me that the actual front panel instrument error may lead to a solution.  I will check that later tonight.

Again, thank U all for the suggestions, they are greatly appreciated.
Diego

0 Kudos
Message 15 of 25
(1,708 Views)

Hi,

You have to use the driver supplied for the card not the NI-488 functions

Software
The PCI-488 includes the GPIB-488 software library for Windows XP, Windows 2000, and LabVIEW™. The library includes National Instruments' style 488.1 'ib' and 488.2 command Sets. The driver provides support for 32-bit, Visual Basic and C/C++ language programs and is compatible with National Instruments' VISA and LabView.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 16 of 25
(1,694 Views)

Ray,

Yes, I am using the Measurement Computing 488 driver.  Upon installation, it will ask that the NI 488 first be removed.  Once that is done and the MC 488 driver is installed, the VISA interactive panel can be used to communicate with devices.  I do find the GPIB card plus the rest of the intruments.  And as previously mentioned, I can query all devices ( including 34401) with no issues.

Diego

0 Kudos
Message 17 of 25
(1,681 Views)

Hi,

 can you post your code?

regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 18 of 25
(1,672 Views)
Ray,
Here it is again, the error occurs during the IBWRT or SEND commands, depending on which I use.  Ive tried both combinations ibwrt/ibrd(488) or Send/Receive(488.2) with the same results.  There is another function ( not shown ) which only sends commands ( using either ibwrt or Send ) which works every time with all instruments, including 34401.  However, as soon as I add the "?" to the 34401 command string to query, that when I get the error.
Thanks
Diego
0 Kudos
Message 19 of 25
(1,664 Views)
main
hHpib = ibfind("GPIB0");    // Get Handle Of card
//SendIFC(0);     // Reset Board - force it ias controller
FindLstn(0,addr_list,inst_list,5);
 
GPIBQuery(HP34401,"MEAS:VOLT:AC?",write_buffer);
 
int GPIBQuery(int address, unsigned char *write_buffer, char *read_buffer)
{  
 int gpib_error,device;
 int BytesToRead = 80;
 
 // acquire device
 device = ibdev (0, address, NO_SAD, T1s, 1, 0);
 ibwrt (device, (unsigned char *)write_buffer, strlen(write_buffer));
 //Send(0,address,write_buffer,strlen(write_buffer),1); 
 
ibrd (device, read_buffer, BytesToRead);
//Receive(0,address,read_buffer,BytesToRead,STOPend); 
}
0 Kudos
Message 20 of 25
(1,660 Views)