Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual
Page 336

III. COMMAND REFERENCES - 15. Command References
15B. Driver488/SUB, W31, W95, & WNT
Personal488 User’s Manual, Rev. 3.0
III-321
EXAMPLE
term.EOI = TRUE;
term.nChar = 1;
term.EightBits = TRUE;
term.termChar[0] = ‘\r’;
bytecount=EnterX(timer,data,1024,0,&term,1,&stat);
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 additional
Enter
functions are:
Enter
,
EnterN
,
EnterMore
, and
EnterNMore
. These functions
are discussed in detail below:
Enter
SYNTAX
long pascal Enter(DevHandleT devHandle, char *data)
REMARKS
Enter
is equivalent to the following call to
EnterX
:
EnterX(devHandle,data,sizeof(data),1,0L,0,0L);
The
Enter
function passes the device handle and a pointer to the data buffer to the
EnterX
function.
It determines the size of the data buffer provided by the user and passes that value as the
count
parameter. It specifies
forceAddr
is
TRUE
, causing Driver488 to re-address the device. The default
terminators are chosen by specifying a
0
as the
term
parameter. Asynchronous transfer is turned off by
sending
0
for the
async
parameter, and the completion status value is ignored by sending
0
for the
compStat
parameter.
EnterN
SYNTAX
long pascal EnterN(DevHandleT devHandle,char *data,int count)
REMARKS
EnterN
is equivalent to the following call to
EnterX
:
EnterX(devHandle,data,count,1,0L,0,0L);
The
EnterN
function passes the device handle, the pointer to the data buffer, and the size of the data
buffer to the
EnterX
function. It specifies
forceAddr
is
TRUE
, causing Driver488 to re-address the
device. The default terminators are chosen by specifying a
0
pointer as the
term
parameter.
Asynchronous transfer is turned off by sending
0
for the
async
parameter, and the completion status
value is ignored by sending
0
for the
compStat
parameter.
EnterMore
SYNTAX
long pascal EnterMore(DevHandleT devHandle,char *data)
REMARKS
EnterMore
is equivalent to the following call to
EnterX
:
EnterX(devHandle,data,sizeof(data),0,0L,0,0L);