I have used the GPIB extension in the Release 4 CD and still cannot get a
future basic program to work trying to communicate with a LeCroy Digital
Scope. The statement that seems to fail is the ibwrt statement (write).
The NI test program formats the characters sent to the scope (in my example) as
ibwrt "time/div 10 ms"
and this works fine (the displayed time/div on the scope changes as expected).
The corresponding FutureBasic statement in the NI manual is
FN ibwrt%(ud%,wrtbuffer&,cnt&),
where ud% is obtained from a previous call to ibdev, wrtBuffer is the
address of the buffer containing the bytes to write and cnt& is the number
of bytes to be written.
The toolbox call in the library is
toolbox fn ibwrt(short,@long,long) = SHORT
(the % is apparently not used in the Library functions - it won't complile
if I use ibwrt%)
My program is as follows. The three functions ibdev, ibclr, and ibwrt
execute without an error, but the scope remains unchanged. Since the NI
test program works and presumably uses the NI-488.2 drivers extension (it
doesn't work without it), where could the error lie? It would appear that
it might lie in the proper addressing of the string to be sent. I have
tried addressing the first byte of dataString$ (as in the example below) or
the second byte (the first byte you wish to send) or dimming dataString$ as
dim 14 dataString$, since there are only 14 bytes to be sent. Nothing
works. Any suggestions?
Eric
dim dataString$
dim as long cnt
ud% = FN ibdev (0,1,0,13,1,0)
IF ud% < 0 THEN FN gpiberr ("ibdev Error",ud)
stop "1"
ibsta = FN ibclr (ud%)
IF (ibsta AND _ERR) THEN FN gpiberr ("ibclr Error",ud)
stop "2"
dataString$ = "time/div 10 ms"
cnt& = 14
ibsta = fn ibwrt (ud,@dataString$,cnt&)
IF (ibsta AND _ERR) THEN FN gpiberr ("ibwrt Error",ud)
stop "3"