Basic Principles of Serial Data Transmission
2.7 Data transmission with the printer driver
CP 341 Point-to-Point Communication, Installation and Parameter Assignment
76
Manual, 09/2008, A5E02191071-01
Format string
The format string allows you to define the display type and composition of a message text.
The format string can consist of:
●
Text (all printable characters, for example: The level ... l was reached at ... hours.)
●
Conversion statements for variables (e.g., %N = pointer to message text number x, where
x is the value of a variable (see example 2 below))
There must be one (and only one) conversion statement for each variable in the format
string or configured message text. The conversion statements are applied to the variables
in the sequence in which they occur.
●
Control statements with control characters for bold, condensed, expanded, italic, and
underlining (e.g., \B = bold type on) or with additional control characters you have defined
You can use other control characters if you enter them in the control character table in the
CP 341: Point-to-Point Communication, Parameter Assignment parameter assignment
interface and reassign the CP 341 parameters.
Additional functions
In addition to outputting message texts, you can use the following functions for printout. To
execute one of these functions, simply specify it in the format string in the same way.
●
Set page number (format string = %P)
●
Begin new page (format string = \F)
●
Print with/without line break (\x at the end of the format string)
Note that a line feed is carried out by default after each output.
Examples
Example 1: The level "200" l was reached at "17.30" hours.
Format string = The level %i l was reached at %Z hours.
Variable 1 = time
Variable 2 = level
Example 2: The pressure in the chamber "is falling"
Format string = %N %S
Variable 1 = 17 (message text no. 17: The pressure in the chamber ...)
Variable 2 = reference to string (string variable: ... is falling)
Example 3: (Setting the page number to 10)
Format string = %P
Variable 1 = 10 (page number: 10)
长沙工控帮教育科技有限公司
www.gkbpx.com