
Chapter 7. I/O Facilities
113
7.4.3 Monitoring by the
WAIT
Statement
The
WAIT
statement monitors the input and output devices (I/Os) listed in Appendix D, "I/O
Ports." Unlike the
INP
function, the
WAIT
statement makes the I/O devices idle while no entry
occurs, thus saving power consumption.
The table below lists some examples.
* The
WAIT
function can monitor the trigger switch status only when the trigger
switch function is assigned to any of the magic keys.
In a single
WAIT
statement, you can specify more than one I/O device if the same port number
applies. To monitor keyboard buffer & touch key buffer and the barcode buffer with the single
WAIT
statement, for example, describe the program as shown below.
OPEN "BAR:" AS #10 CODE "A:"
WAIT 0,&h03
The above example sets the value of &h03 (00000011) to port 0, indicating that it keeps waiting
until either bit 0 or bit 1 becomes ON by pressing any key or by reading a bar code.
WAIT
Statement
I/O Devices
WAIT 0,&h01
Keyboard buffer & touch key buffer status
WAIT 0,&h02
Barcode buffer status
WAIT 0,&h04
Trigger switch status*
WAIT 0,&h08
Receive buffer status
WAIT 0,&h10
TIMEA
function
WAIT 0,&h20
TIMEB
function
WAIT 0,&h40
TIMEC
function
Summary of Contents for BHT-BASIC 100 SERIES
Page 1: ......
Page 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Page 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Page 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Page 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...