08-19-2002 05:17 PM
08-20-2002 04:12 AM
08-20-2002 10:27 AM
12-31-2002 01:15 PM
06-17-2005 06:16 PM
06-17-2005 06:29 PM
06-20-2005 02:55 PM
12-20-2005 11:19 AM
Hello all,
In my search for a way to get data from my HP4145A with CVI, I came across this thread. I have an Agilent USB-GPIB converter that I use all the time but I use the VISA layer instead of GPIB calls so all the platforms I install programs on work. I did not have success with the commands in the manual and this setup (USB-GPIB and laptop) and so reverted to my desktop and brute force GPIB commands. In both cases, I was able to get the instrument to do things but could get no data back. I finally used the HP4145 driver (*.fp) supplied by National Instruments and found that the instrument has a wait state that was causing the problem. During this wait state which I believe is the ancient instrument processor trying to catch its breath, the downloaded driver polls the bus with 'ibrsp'. When this finally goes to the value of one, the data is asked for and comes back one byte at a time.
I found this by turning on NI-SPY (great tool) and watching the drama unfold. When I turned off NI-SPY, my program would hang. I theorized that the ancient instrument processor (again) could not keep up with the barage from my newer hardware and so in the 'hp4145_measure' function on line 476 in the driver (filename HP4145.c), I added a delay in the while statement at the end as below.
Original:
while (serial_poll != 1)
ibrsp (instr_bd[instr_id], &serial_poll);
Modified
while (serial_poll != 1)
{
ibrsp (instr_bd[instr_id], &serial_poll);
Delay(0.1);
}
Adding this delay actually made the program run faster and it worked without having NI-spy on. Cool.
I hope this helps some other schmo out there. Happy coding.
timLesher
06-30-2006 10:51 AM
06-30-2006 11:12 AM