HTBasic Help
×
Menu
Index

OUTPUT and ENTER Statements

 
The OUTPUT and ENTER statements can also be used for byte level transfers. If only the interface select code is specified in the OUTPUT and ENTER statements, no bus addressing is performed.
 
If the device is the active controller then no addressing needs to be done, as long as the addressing has been done once. The talker and listener still need to remain addressed for transfers to take place. For example:
 
10  ENTER 705; Str$
20  FOR I=1 to 10
30    ENTER 7; Str$
40    PRINT Str$
50  NEXT I
60  END
 
This type of addressing will reduce the bus addressing overhead for each piece of data read. However, we do not recommend this practice because branching to an interrupt service routine may destroy the current talker or listener setup.
 
When the device is not the active controller, it cannot do any bus addressing. 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. For example:
 
OUTPUT 7; Str$  !Waits Until Talker Addressed
ENTER 7; Str$   !Waits Until Listener Addressed
 
A combination of the SEND and the ENTER statements can emulate any of the high level transfer or bus control statements. As an example, let’s see how to conduct a serial poll (SPOLL) operation using these statements.
 
Poll_value = SPOLL(705)         !High level command
 
SEND 7; CMD "?5E" CMD 24        !Output SPE command
ENTER 7 USING "#,B";Poll_value  !Read Poll Value
SEND 7; CMD 25 UNT              !Output SPD command
 
You are limited in your control of the IEEE-488 bus only by your imagination and skill at combining the SEND and ENTER statements.