Danaher Motion
06/2005
BASIC Moves Development Studio
M-SS-005-03 Rev
E
29
On the other hand, expressions separated by a semicolon or a space in the
print command are printed
adjacently.
Print 1,2
1 2
Print 1;2
12
Print 1 2
12
PrintUsing
introduces formatting for printing. You can control the format and
the number of digits that print. For example, by using the “#” sign and the
decimal point, you can specify a minimum number of characters to be
printed.
PrintU "The number is #, # ";j1,j2
-->The number is 1, 2
Be aware that using a single format to print more than one expression will
result in repetition of any text written within string format according to the
number of printed expressions.
PrintU "The number is #, ";j1,j2
-->The number is 1, The number is 2,
By specifying the number of digits to print, data can be printed in tabular form
since the number of places printed will not vary with the value of the number.
PrintU “Keep numbers to a fixed length with PrintUsing:
######” ; 100
Be aware that if the number requires more digits than you have allocated, it
overruns the space.
PrintU “Overrun: ##” ; 1000000
Takes 7 spaces for 1,000,000 even though
PrintU
allocates only 2.
For printing of double type expressions, formatted printing also enables to
control precision, i.e. number of digits printed after the decimal point.
PrintU “Print PI with 3 digits after decimal point: #.###” ; 3.14159
Prints only 3 digits after the decimal point, while rounding the PI’s value to
3.142.
You can also precede the “#” signs with a “+” to force PrintU to output a sign
character (+ or -). Normally, the sign is printed for negative numbers, not
positive numbers.
Finally, you can terminate the format string with “^^^^” to force the number to
print in exponential format.
PrintU “Exponential format: ####.##^^^^” ; 100
Prints 1e+02. You must include exactly four “^” characters for this format to
work.
Be aware that while
and
PRINTUSING
allow you to print out many
expressions on a single line, these expressions are not
synchronized
to
each other. The values can and usually do come from different servo cycles.
If you are monitoring motion and need the command to be synchronized, you
must use
Record
.
Normally, printing of longs is done in decimal format. To change printing to
Hexadecimal
format, type:
System.PrintMode = HEX