Enterx – Measurement Computing Personal488 rev.3.0 User Manual
Page 84

Personal488 for Windows 95/98/Me/NT/2000
04-10-01
API Reference 6-16
EnterX
Syntax
LONG WINAPI EnterX(DevHandleT devHandle, LPBYTE data,DWORD
count,BOOL forceAddr,TermT*term,BOOL reserved,LPDWORD
compStat);
devHandle
refers to either an IEEE 488 interface or an external device.
data
is a pointer to the buffer into which the data is read.
count
is the number of characters to read.
forceAddr
is used to specify whether the addressing control bytes are to be issued for
each
EnterX
command.
term
is a pointer to a terminator structure that is used to set up the input terminators.
If
term
is set to
0
, the default terminator is used.
reserved
- this value is ignored.
compStat
is a pointer to an integer containing completion status information.
Returns
-1
if error
otherwise, the actual count of bytes transferred. The memory buffer pointed to by the data
parameter is filled in with the information read from the device. Note that the actual
count does not include terminating characters if term characters are specified by the
term in function. In addition, term characters are not returned but are discarded.
Bus States
With interface handle:
*ATN, data
With external device handle:
ATN
•UNL, MLA, TAG, *ATN, data
Example
term.EOI = TRUE;
term.nChar = 1;
term.EightBits = TRUE;
term.termChar[0] = ‘\r’;
bytecount=EnterX(timer,data,1024,0,&term,1,&stat);
See Also
OutputX, Term, Buffered
The
EnterX
command reads data from the I/O adapter. If an external device is specified, then Driver488 is
addressed to Listen, and that device is addressed to Talk. If an interface is specified, then Driver488 must
already be configured to receive data and the external device must be configured to Talk, either as a result
of an immediately preceding
EnterX
command or as a result of one of the
Send
commands.
EnterX
terminates reception on either the specified count of bytes transferred, or the specified or default terminator
being detected. Terminator characters, if any, are stripped from the received data before the
EnterX
command returns to the calling application.
The
forceAddr
flag is used to specify whether the addressing control bytes are to be issued for each
EnterX
command. If the device handle refers to an I/O adapter, then
forceAddr
has no effect and
command bytes are not sent. For an external device, if
forceAddr
is
TRUE
then Driver488 always sends
the
UNL
,
MLA
, and
TAG
command bytes. If
forceAddr
is
FALSE
, then Driver488 compares the current
device with the previous device that used that interface adapter board for an
EnterX
command. If they are
the same, then no command bytes are sent. If they are different, then
EnterX
acts as if the
forceAddr
flag were
TRUE
and sends the command bytes. The
forceAddr
flag is usually set
TRUE
for the first
transfer of data from a device, and then set
FALSE
for additional transfers from the same block of data from
that device.
Additional Enter Functions
Driver488 provides additional
Enter
routines that are short-form versions of the
EnterX
function. The
following
Enter
functions are already defined in your header file.