HTBasic Help
×
Menu
Index

High Level Transfer Statements

 
The ENTER and OUTPUT statements are used to transfer data between IEEE-488 devices. They automatically generate all the required bus addressing. For a description of the ENTER and OUTPUT statements, see Chapter 5, "General Input and Output."  It explains how to send or suppress CR/LF line terminators and how to set the EOI signal line on the output of the last data byte. The following example demonstrates communication with an HP-GL plotter at device address five.
 
OUTPUT 705;"OP;"
ENTER 705;P1x,P1y,P2x,P2y
 
The OUTPUT statement requests the plotter to send its P points. The ENTER statement reads the P point values sent back by the plotter.
The powerful USING option gives you a high degree of control over the data format used for the transfer operations. For example:
 
OUTPUT 705 USING "#,K";Str$
ENTER 705 USING "#,K";Str$
 
Multiple listeners may also be addressed with the same command. As follows:
 
ASSIGN @Dev to 705,706,707,708
OUTPUT @Dev; "Data"
 
The OUTPUT statement listen-addresses the devices with primary addresses 5, 6, 7, and 8 and then sends the string "Data" to all of them. If the same I/O Path is used for the ENTER statement, the first device is addressed as the talker and the remaining devices, including the active controller, are addressed as listeners.
Some devices allow the selection of a particular mode of operation by the use of the secondary address. Multiple secondary addresses may be specified. This extended addressing mode is shown below.
 
ASSIGN @Dev to 7011011    !Secondary Address 10 and 11
OUTPUT @Dev; Str$
OUTPUT 70501; Str$        !Secondary Address 01
 
When the device is not the active controller, it cannot do any bus addressing. If only the interface select code is used for the ENTER and OUTPUT statements, no bus addressing will be performed. The device must make sure that it has been addressed to talk or listen before it participates in the transfer of data. If it has not been addressed, then the device will wait until it is addressed before continuing.
 
OUTPUT 7; Str$
ENTER 7; Str$