Operating modes, 8n. operating modes, Asynchronous transfers – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual
Page 131: Topics

8M. Data Transfers
II. SOFTWARE GUIDES - 8. Driver488/DRV
II-116
Personal488 User’s Manual, Rev. 3.0
This reads data into
W%
until either
20
characters have been received, or
EOI
has been detected.
However, if
EOI
causes the transfer to stop, we can discover how much data has been received by using
the
BUFFERED
command:
PRINT#1,"BUFFERED"
INPUT#2,N
The number of bytes transferred is read into
N
. Now we can use this value to send the read data out to
device
17
:
PRINT#1,"OUTPUT17#";N;"BUFFER";VARSEG(W%(1));":";VARPTR(W%(1));"EOI"
Note that the variable
N
has been used in place of the literal
20
to specify how many bytes to transmit.
Clearly,
BUFFERED
I/O is more complex than simple direct I/O. However, it can be very useful.
BUFFERED
I/O is normally much faster than direct I/O because the characters go directly from memory
to the bus under the control of Driver488/DRV without the intervention of BASIC or DOS. Also,
BUFFERED
I/O is not limited by the 255-character limit on
INPUT$
that can hinder binary
ENTER
s.
Asynchronous Transfers
Driver488/DRV can return to the user’s program while a transfer is in progress. This is useful
whenever the transfer takes a substantial amount of time, and other processing could proceed while
waiting. For example, suppose a certain bus device can transfer only 1000 bytes per second. If there
are 10,000 bytes to transfer, it takes 10 seconds to complete the transfer. The following statements
might be used to receive this data:
DIM R%(5000)
PRINT#1,"ENTER 09 #10000 BUFFER"; DS%;
“:”; VARPTR(R%(1)); “CONTINUE”
Now do other work while
the transfer is continuing
PRINT#1,"WAIT"
The
CONTINUE
keyword tells Driver488/DRV to return to the program after setting up the transfer.
The program is then free to do other processing, as long as it does not need access to the IEEE 488 bus.
Finally, when the program is ready to process the received data it performs a
WAIT
to check that the
data has been completely received. In this way,
CONTINUE
transfers overlap IEEE 488 bus data
transfers with program execution.
The use of DMA and interrupts requires proper hardware and software configuration. For more
information, refer to the Sub-Chapter “Installation & Configuration” early in this Chapter.
8N. Operating Modes
Topics
•
Introduction................................................................................... II-116
•
Operating Mode Transitions ...................................................... II-116
•
System Controller Mode.............................................................. II-117
•
System Controller, Not Active Controller Mode.................... II-117
•
Not System Controller Mode ...................................................... II-119
•
Active Controller, Not System Controller Mode.................... II-119