Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

gpib reading and serial polling without readdressing?

I am trying to use Labview/GPIB to read 2 bytes at a time from binary data stored in the output buffer of a Perkin-Elmer/Ametek lockin amplifier. Apparently standard GPIB read vi's readdress the lockin, which then causes the multiple reads to fail. I found some useful information in "Multiple GPIB Reads in LabVIEW Result in EABO Errors" on the NI web site. Here the solution was to either to only address the lockin in the first GPIB read (all other reads have a blank GPIB address input) or to initialize the GPIB board to not require readdressing. This works, except when I do serial polls to check if the data is ready to be read and if the buffer is finally empty. Please tell me how I can do GPIB reads AND serial
polls repeatedly without causing errors, such as having the serial poll byte prematurely reset or having the read hang up?

For a moment using the clear device vi before each read seemed to solve the problem, but this no longer is working. I've tried writing programs using IEEE 488, 488.2 and even VISA vis, but still cannot get reliable data transfer.

Thanks for your help,

John
0 Kudos
Message 1 of 2
(3,329 Views)
You may be able to do it manually. To conduct a serial poll, you can try the following:

Send one command byte: \x18
Read One Byte without addressing (leave the address blank)
Send one command byte: \x19

This sequence assumes that the device has already been addressed to talk and that the controller is already addressed to listen. \x18 is a command byte to place the device in "Serial Poll Mode". \x19 is a command byte to place the device in "Normal Mode".

The byte you read with the one-byte read will be the serial poll byte. This will not necessarily work if the device is actually requesting service. If the device is requesting service, you can do it this way, but you must do all of your programming with the IEEE 488.2 style calls. Otherwise, you can
use any programming technique that you desire.

Good luck.
0 Kudos
Message 2 of 2
(3,329 Views)