10
INIT#1, "COM: "
20
INIT#2, "OPT:"
30
OUT#1, 65
At Line 1 0, file number # 1 is assigned to a serial 1/0 device. At Line 20, you
probably think that file number #2 is assigned to an optical coupler.
However, when this program is executed, an error message is displayed. This is
because, when file number # 2 is assigned to the serial 1/0 device, file number
# 1 is canceled.
Now, the X-07 uses the baud rate generator to output sound through the com
pact magnetic speaker. For this reason, when the INIT# instruction is used
along with the BEEP instruction, an error similar to the above example occurs.
10
INIT#1, "COM:"
20
BEEP 5, 10
30
A=INP(#1)
At Line 1 0, file number # 1 is assigned to a serial 1/0 device. However, at
Line 20, when the BEEP statement is executed, the assigned file number # 1 is
canceled, and an error is generated at Line 30.
Same thing occurs when the BEEP instruction is executed before the INIT #
instruction.
10
BEEP 5,10
INIT
20
#
30
A=INP(#1)
In the above example, no sound is heard. The BEEP statement specifies the
tone and the length of the tone that the baud rate generator should produce.
When the X-07 has finished specifying these parameters, it executes the follow
ing statement. It does not wait for the sound to be output before executing the
following statement. Therefore, the above example should be:
10
BEEP 5,10
20
BEEP 0,1
30
INIT#1,"COM:"
40
A=INP (#1)
The BEEP statement at Line 20 is a "dummy" statement which delays the
execution of Line 30.
96
1, "COM:"
·