Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

34401 Query Problem

Should you add "\n" after the "?".  Just a thought..

Curt

0 Kudos
Message 21 of 25
(1,791 Views)

Kurt,

I have tried adding additional termination, but I do not remember exactly if I tried just plain old \n.  I will try this tonight, good suggestion.

Thanks

Diego

0 Kudos
Message 22 of 25
(1,787 Views)

Hi,

GPIBQuery(HP34401,"MEAS:VOLT:AC?",write_buffer);
 
int GPIBQuery(int address, unsigned char *write_buffer, char *read_buffer)
{  
ibrd (device, read_buffer, BytesToRead);
//Receive(0,address,read_buffer,BytesToRead,STOPend); 
}
 
What is the size of write_buffer which you seem to be using are the return buffer for ibrd(), you have set the bytes to read as 80, so is the buffer big enough. I cannot see why you have define the size of the string buffer. At the moment it just seems like an uninitialised string pointer you are using the ibrd() or Receive().
 
so in your code you should have
char write_buffer[100] = ""; // it would have been better if you used read_buffer for readibility
 
...
 
GPIBQuery(HP34401,"MEAS:VOLT:AC?",write_buffer);
 
 
 
try capture the return value incase the function is just erroring eg int err; err= ibrd(...);
 
 
 
Regards
Ray Farmer 


Message Edited by Ray Farmer on 03-18-2008 08:14 PM
Regards
Ray Farmer
0 Kudos
Message 23 of 25
(1,784 Views)

Ray,

I usually use 80 since it is normally enough, but I have changed it to 2000 just to make sure.
I went ahead and tried char write_buffer[100] = "", and still having same issue.
I cannot set any of those functions to err=ibrd, but I can check errors with iberr and I get a 6 (operation halted).
 
Per Agilent's request, I checked the actual front panel error code:    "error 550" Per the manual:
Command Not Allowed In Local:  The device received a READ? or MEASURE? command while in the local mode.  During RS232 operation, you should always execute the SYSTem:REMote command before sending other commands.
 
Since I am on GPIB, I cannot send the SYST:REM command, so it is obvious that I am missing a very important step to set this device for GPIB queries of the measurement kind.   I say that, because as suggested earlier, I did try using the same function with *IDN? query and that works just fine, regardless of which 488 layer command I use ( ibwrt/send).  Im going through the manual again and see what I am missing, in the meantime I left Agilent a message on the latest findings. 
 
Thanks
Diego
 
 
 
0 Kudos
Message 24 of 25
(1,772 Views)

I finally solved the problem.  Bottom line is that the 34401 was never going into Remote mode.  I have yet figure out how, but I do have a solution.

Using 488.2, I added the EnableRemote command.. Or in 488, send the *REM command.  Both commands put the 34401 in Remote mode and will not accept Measurements Queries.  Why it does, however, accept other queries such as *IDN? and not measurements, I am not sure.
Also, I am not sure, nor is Agilent, why it is only the 34401 that has this issue when I have several other intruments on the bus.

For the hell of it, and since I do have a duplicate system, I installed an NI GPIB on the duplicate system with their drivers.  I then ran my code without the above changes and it worked just fine.  This leads me to believe there is something unique with the Measurement Computing GPIB card and or their drivers.

Regardless, the issue is solved and I really appreciate all of your commends and suggestions.

Diego

0 Kudos
Message 25 of 25
(1,720 Views)