07-22-2010 07:08 AM
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?
07-22-2010 10:09 AM
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.
07-22-2010 10:46 AM
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?
07-22-2010 07:42 PM
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.