Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How Do I Use Secondary Addresses in Code?

I'm using the dpib32.pas library and none of the code examples I've come across clue me in as to how the secondary GPIB address comes into play. I'm not sure how to even set it for a communication since the Send call refers to one address:

procedure Send(boardID:integer;address:Addr4882_t;buffer:string;count:longint;eotmode:integer);stdcall;


Maybe I'm just missing the fundamentals here. Is the secondary address a subset of primary or is it just as it says... a secondary address to be used instead of a primary address. So I could use say 96 instead of 8?

... or does gpib treat this like a 'fallback' address if the first one were to fail?
0 Kudos
Message 1 of 3
(3,100 Views)
If you look more closely at what Addr4882_t is in either the ni488.h or gpib-32.h header files, you may see that it represents a 16-bit number. The lower byte is for the primary address, while the upper byte is for the secondary address.

The secondary address is not used very often. The secondary address is pretty much a subset of the primary. Essentially, this allows multiple devices to have the same primary address, but different secondary address. If you have your instrument configured with just a primary address, you shouldn't need to worry about the secondary one at all.
0 Kudos
Message 2 of 3
(3,100 Views)
Hi ct,

It depends on the device if it takes a secondary address or not. There are two options:

- No secondary address: just use the primary address. Set the address argument to the primary address (0 to 30).

- Secondary address: You need to specify BOTH the primary and the secondary address. These two addresses are packed in the same integer. The primary address in the lower byte and the secondary in the upper byte.

Check out chapter 4 of the NI-488.2M Software Reference Manual. I think this is the manual that describes it better.

DiegoF
National Instruments.
0 Kudos
Message 3 of 3
(3,100 Views)