Motion Coordinator Technical Reference Manual
Trio BASIC Commands 8-57
Input / Output Commands
PRINT "DISTANCE=";mpos
DISTANCE=123.0000
Note how in this example the semi-colon separator is used. This does not tab into
the next column, allowing the programmer more freedom in where the print items
are put. The
PRINT
command prints variables with 4 digits after the decimal point.
The number of decimal places printed can be set by use of [x] after the item to be
printed. Where x is the number of decimal places from 1..4
params:PRINT "DISTANCE=";mpos[0];" SPEED=";v[2];
DISTANCE=123 SPEED=12.34
Example 5:
15 PRINT "ITEM ";total" OF ";limit;CHR(13);
The
CHR(x)
command is used to send individual ASCII characters which are referred
to by number. The semi-colon on the end of the print line suppresses the carriage
return normally sent at the end of a print line. ASCII (13) generates CR without a
line feed so the line above would be printed on top of itself if it were the only print
statement in a program.
PRINT CHR(x); is equivalent to PUT(x) in some other versions of BASIC.
Note:
The
PRINT
statements are normally transmitted to serial port 0. They can be redi-
rected to other output ports by using
PRINT#
.
PRINT#
Type:
Command
Description:
This performs the same function as
PRINT
but the serial output device is specified
as part of the command. The device is selected for the duration of the
PRINT#
com-
mand only. When execution is complete the output device reverts back to that
specified by the common parameter
OUTDEVICE
.
Parameters:
n: Output device:-
0Serial port 0
1Serial port 1
2Serial port 2
3 Fibre optic port
4 Fibre optic port duplicate
5 RS-232 port A - channel 5
6 RS-232 port A - channel 6