Specifications
1070 072 131-102 (96.08) GB
BUEP03E Protocol 8-23
8.7.3.7 FORMATTED OUTPUT Command
Description: The Formatted Output command enables text, variables or
text combined with variables to be output to the printer. This command
interprets the control text and associated variables indicated by the para-
meters (PW5 - PW7). The format instructions have been integrated in the
control text and begin with a % character. The characters which do not
begin with the % character appear unchanged in the output. The format
instructions ensure the required representation method of the next argu-
ment.
The control text is separated from the arguments with a comma. The ar-
guments (variables) are situated one behind the other after the control
text (comma) and always begin at the word boundaries. The numerical
values of the variables must be copied by the PLC program to the appro-
priate location after the comma.
The PG editor inserts a 0 (zero) into the control text if the text ends with
an odd number. This 0 (zero) is ignored by BÜP03E.
The control text and the arguments may be in a data module, for examp-
le. The identifier is passed to this data area with the Formatted Output
command.
Possible control text with two arguments (see also Page 8-15 in the Start
section - Example 4):
Temperature of %3d degrees is too high by %3d degrees,<Arg1><Arg2>
The printer would print the text
Temperature of 100 degrees is too high by 10 degrees
if the value of Arg1 = 100 and Arg2 = 10 . There are as many arguments
as there are format instructions. If this is not the case, a fault message is
returned.
The Formatted Output command provides the following format instructi-
ons:
%+-mu Decimal number (unsigned) 1 word (0..65535)
%+-md Decimal number(signed) 1 word (32767..-32767)
%#x Hex number 1 word
%c Single ASCII character 1 word
%+-m.nf Floating-point number 2 words
m : Total number of positions
n : Positions after decimal point
u, d, x, c, f : Identifiers for format instructions
+ : Output with sign
- : Left-justified output (normal: right-justified)
+- : Left-justified and with sign
# : Output of hex numbers with leading zeros