Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ibclr with a Board Descriptor

I am currently working on rehosting some test software from QuickBASIC to C and am having some problems interpreting some of the old code, namely the use of the ibclr function. Before each call to ibwrt or ibrd, there is a call to ibclr. It seems that ibclr should be a device level command, however the parameter being used in the QB code is gpib0 (CALL IBCLR(gpib0%)). How can I emulate this when I rewrite the code in C?

 

 

 

0 Kudos
Message 1 of 4
(4,083 Views)

ibclr() with board level call is a "non-selected" device clear. "non selected" means that the call does not specify any listener address(es), therefore it works as like broad-cast to all the instrument on the same bus.

 

If you want to change the ibclr() from board-level to devcei-level, you can use the same ibclr() function but you need pass the unit descriptor of "device-level". The call works as "selected device clear" with automatic listener setting.

 

 

0 Kudos
Message 2 of 4
(4,064 Views)

Thanks for your response. So basically what the board ibclr does is the same as executing an ibclr on each device. If this is so, I can simply use ibclr on the device I am communicating with, since I am only working with one device, and this will still be equivalent to the old code. Is this correct?

0 Kudos
Message 3 of 4
(4,058 Views)

Yes it is correct, ibclr() on "board-level" and "device-level" are equivalent each other for the instrument side. Normally the instrument does not distinguish (broadcasted) Device Clear and (addressed) Selected Device Clear.

0 Kudos
Message 4 of 4
(4,032 Views)