UD70
Issue code: 70nu2
7-18 Reference
PRINT
Syntax
PRINT
Expression list separated with a “,”.
The PRINT instruction outputs strings or values to the PC RS232 serial port of
the UD70. All items in the expression listing must be separated by commas.
Strings are enclosed in double quotes (“ ”).
A tab character (
ASCII 09) is automatically printed between each character
separated by a comma. Negative values are prefixed by a –– sign; positive
values have no prefix.
Operation in
various
tasks
The way this instruction operates depends on the task, as follows:
In BACKGROUND Task, the PRINT instruction halts program execution until all
characters are transmitted. It is recommended to use the PRINT instruction
in the BACKGROUND task only.
In the
CLOCK and ENCODER Tasks, program execution continues without
waiting. At 19200 baud rate, it takes 0.5ms to transmit one character. The
PRINT instruction would then quickly over-run the CLOCK or ENCODER Task.
If another PRINT instruction is executed before the previous PRINT
instruction is finished the remaining characters are not printed.
The string can contain non–printable characters by using an escape
sequence. This begins with a back-slash [\] character followed by the non–
desired character.
The available characters are as follows:
Character Function ASCII Character
\b Backspace 8
\p Line feed 9
\t Tab 10
Table continued...
Character Function ASCII Character
\f Form feed 12
\r Carriage return 13
\v Vertical tab. 11
\\ Single back-slash 92
\NNN (N is an octal number)
Example
PRINT “Hello\r\n Goodbye\r\n”
This prints the following words:
Hello
Goodbye