NI Home > Community > NI Discussion Forums
Reply
Member
Hans D. Jensen
Posts: 6
0 Kudos

Getting rid of "ibcmd" in application

I am trying to re-create a behavior I can get using HTBasic with an
instrument that apparently is quite sensitive to GPIB commands.

I simply want to read the measurement value presented by the instrument, but
I can't get it to work with standard ibdev, ibwrt, ibrd commands. So, I have
tried HTBasic which can make it work and used the NI GPIB-Spy to sniff out
what is going on and now I hope for some help to recreate this behavior in
LabWindows or LabView. I am using an AT-GPIB/TNT card under WIndows 95.

The following sequence is what goes on when HTBasic initialises (LOAD BIN
"GPIBNI+"):
ibfind GPIB0
ibonl 1
ibpad 21
ibtmo T1s
ibeot 0
ibsic
ibsre 1
ibgts 0
ibpad 21

Now each time I as to read a value from the inst
rument on adress 8 (using
ENTER 708;S$) the following happens
ibcmd "H?5"
ibrd 1
ibrd 1
.... until ibsta includes (end)


As far as I can deciffer this, the program is setting the controller up
directly and Talks/Listens directly on the adress it assigned itself (21)
and the instrument adress (8). If I do all this step by step in IBIC it also
works, but is this the only way to do it? Will it interfere with instruments
that are controlled and read using standard LabWindows drivers? It seems to
be rather low-level commands to me.

Is there a more straightforward way of accomplishing the same with higher
level commands? Are all the ibsic, ibsre, etc. crucial in this setup? And
what about this changing the controller primary adress..

TIA

Hans D. Jensen
hdj@dfm.dtu.dk (note: a simple "Reply to Sender", won't work)
Member
ceetee
Posts: 41
0 Kudos

Re: Getting rid of "ibcmd" in application

Hi Hans,

I'm definitely not one of the gurus around here but I'm working through a similiar situation and would like to share a little info that might help.

First, this is a good document to get an understanding of the purpose/usage of ibcmd...

http://zone.ni.com/devzone/conceptd.nsf/webmain/C22B1B6801D2BBE98625680F00535F1D?opendocument&node=dz00000_us

Second... as you will be able to tell from that reading...

"There are two types of GPIB functions: board-level functions and device-level functions. At the device level, you are limited to communicating with one device at a time, while at the board level, you can communicate with multiple devices (but only one device can talk at a time!). With respect to GPIB messages, board-level functions require you t
o perform Talker/Listener assignments manually with the ibcmd function; device-level functions take care of the Talker/Listener assignments for you."

So your choice to eliminate ibcmd may depend on that. I am working through a script for calibrating a TDS210 with a Wavetek standard. The legacy system I'm converting from uses ibcmd extensively but I have seen no issues when converting everythign over to use ibwrt at the device level instead of board level. Since ibwrt can work at either the board level or device level, and device level calls handle the talker/listener assignments internally... there is no further need for ibcmd.