Specifications
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