
KPCI-488LPA-900-01 Rev. A / December 2008
2-33
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
Section 2: NI Command Compatible Functions
Syntax
Visual Basic
ibwait (ByVal ud As Integer, ByVal mask As Integer)
As Integer
- or -
call ibwait (ByVal ud As Integer, ByVal mask As
Integer)
Parameters
ud
: board or device descriptor
mask
: GPIB events that can be monitored. The valid code values are shown in
Table 2-14
ibwait valid mask codes
Mask
Bit Position Hex Value Description
ERR
15
8000
GPIB error
TIMO
14
4000
Mask timeout
END
13
2000
END
or
EOS
is detected by GPIB board
SRQI
12
1000
Send SRQ signal (only board)
RQS (only device
level)
11
800
Device requesting service
SPOLL
10
400
Controller sequentially polls the board
EVENT
9
200
A
DTAS
,
DCAS
, or
IFC
event occur
CMPL
8
100
I/O completed
LOC
7
80
GPIB board is in Lockout Status
REM
6
40
GPIB board is in Remote Status
CIC
5
20
GPIB board is in CIC status
ATN
4
10
Send Attention signal
TACS
3
8
GPIB board as a talker
LACS
2
4
GPIB board as a listener
DTAS
1
2
GPIB board is in Device Trigger Status
DCAS
0
1
GPIB board is in Device Clear Status
Return Value
The value of the
ibsta
Error Codes
EARG, EBUS, ECIC, EDVR, ENEB, ESRQ
ibwrt
Description
This command writes data from a buffer to a device.
When
ud
is a device descriptor,
ibwrt
addresses the GPIB and writes count data
bytes (
cnt
is the tallying value in the counter) from the board’s memory to the GPIB
device. The operation normally ends when
cnt
number of data bytes have been
written; if
cnt
number of bytes are not written completely during the timeout period, the
operation stops with an error. The number of bytes actually transferred is returned in
the global variable,
ibcntl
.
When
ud
is a board descriptor, the board-level
ibwrt
automatically writes
cnt
data
bytes from the buffer to the GPIB device. Normally, this operation ends when the
cnt
number of data bytes are completely written; if
cnt
number of bytes are not completely
written during the timeout period (or, if the board is not CIC and CIC sends the
Device
Clear
message on the GPIB bus), the operation stops with an error. The number of
bytes actually transferred is returned in the global variable
ibcntl
.