LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hp4145a GPIB through LabView write but no read

Hi, using the NI LabView HP4145B driver, I can connect to and write to
my 4145A, however, when I try to read from the device using the HP 4145
Graphics plot.vi it gives me the error: HP 4145 Receive Message.

I have noticed other people have also experienced this, but there seems
to be no known solution besides the stated problem of needing a delay
before reading from the device.

Any help would be appreciated. Thanks.

0 Kudos
Message 1 of 19
(5,951 Views)
The hp4145a is pretty old and you probably do need a little delay.  I use NI spy to find out how long the write and read takes.  Also, make sure allocated enough buffer space when you try to read.
Brian
0 Kudos
Message 2 of 19
(5,901 Views)
Brian,
 
Can you tell me where I can place the delay?  Per another posting, I can add a delay on the HP4145.c
 

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);

     }

I've tried that...but no luck.  I've also tired to add a delay onto the VI itself for it's ready to READ back from the 4145.

Thanx

0 Kudos
Message 3 of 19
(5,888 Views)

On a few older pieces of test equipment I work with, I add a delay before I call my read function.   Try 200msec or more.  The older the equipment the slower the processing will be.  Make sure you allocated enough bytes for the read.  I have an hp4145a here, but yet have had a chance to play with it. Sorry I cannot be more specific with your question. 

Brian

Brian
0 Kudos
Message 4 of 19
(5,880 Views)
Thanx Brian,
 
I've gotten the 4145A to make measurements and FINALLY able to RECEIVE data.  Unfortunately, when I'm expecting 101 data points, I only received about 73.  It just plugs "0"s into the rest to fill up the array.  I was adjusting to allocate enough memory bytes during receive as well as delay time during the loop of the receiving.  I'm still not getting the full 100 data points.
 
Does anyone also knows how to pull 2 parameters out at the same time?  When you list "LI" with two parameters "LI 'XX', 'YY';" (I'm using only 1) , how can you pull out BOTH parameter data at the same time? Right now, I'm only listing 1 parameter, send in the DO 'XX' cmd, the 'DR1' cmd...thus, I'm receiving only 1 set of data at a time.  When I list 2 parameters and try to read it, it'll just crash because it cannot distinguish between data XX or data YY.
 
 
 
 
0 Kudos
Message 5 of 19
(5,850 Views)
By doing the following procedure, I have been able to successfully all
of the data in the buffer from the 4145A:

1) press the print button on the 4145A or send the "PR" command
2) read from the device using the LabView communicate with instrument
explorer (sample read/write program).

I can then take the data and import it into excel for later processing.


GYU wrote:
> Thanx Brian,
>  
> I've gotten the 4145A to make measurements and FINALLY able to RECEIVE data.  Unfortunately, when I'm expecting 101 data points, I only received about 73.  It just plugs "0"s into the rest to fill up the array.  I was adjusting to allocate enough memory bytes during receive as well as delay time during the loop of the receiving.  I'm still not getting the full 100 data points.
>  
> Does anyone also knows how to pull 2 parameters out at the same time?  When you list "LI" with two parameters "LI 'XX', 'YY';" (I'm using only 1) , how can you pull out BOTH parameter data at the same time? Right now, I'm only listing 1 parameter, send in the DO 'XX' cmd, the 'DR1' cmd...thus, I'm receiving only 1 set of data at a time.  When I list 2 parameters and try to read it, it'll just crash because it cannot distinguish between data XX or data YY.
>  
>  
>  
>  

0 Kudos
Message 6 of 19
(5,825 Views)
Hello every body
Dear Maz.khora,
 
I'm new in labview, and have the same problem with 4145A.
 
I tried your procedure and could you precize me wich VI or wich application, or program, you use after having send the "PR" command in other to get the data ? I have labview 6.1.
 
 
I send you my best regards
 
 
0 Kudos
Message 7 of 19
(5,743 Views)
Dear everybody,
 
I tried again the procedure from Maz.Khora, but unsuccessfully and  I don't understand what to do.
Does somebody has an other idea how to manage to get the data from 4145A ?
I give you the text given by the procedure after having send write and read " PR" :
 
"
 
String received
iberr = EABO
 
EABO indicates that an I/O operation has been canceled, usually due to a time out condition after a GPIB read.
Before reading from the instrument, verify that the GPIB command you are sending is understood by your device and instructs it to place data in it's output buffer.
For information on your device's command syntax, consult the instrument manufacturer's user documentation   "
 
Best Regards
 
 
 
 
0 Kudos
Message 8 of 19
(5,733 Views)
Hello,

I am not familiar with the instrument, but it looks like it's not getting enough time to complete operations before you try to read from it. Have you tried including delays before you write to and read from the instrument? Try that and see if it helps. Good luck! Thanks!

Regards,
Ebele O.
National Instruments
0 Kudos
Message 9 of 19
(5,688 Views)

Thanks _Belle,

I tried successfully a 50 s delay, and got the data. 

 

I thank you all very much

 

Regards

0 Kudos
Message 10 of 19
(5,675 Views)