Pattern recognition example – Printronix PrintNet Enterprise User Manual
Page 178
178
Chapter
5
Patterns / Variables
Figure 155. Pattern Screen Tip
To see pattern details, i.e., name and definition, hover the pointer over the
character in the Input field to display a screen tip. See Figure 155.
NOTE:
For some Modes, you cannot insert patterns into the Output field.
Pattern Recognition Example
Normally, the CST only allows you to do an absolute match on a character. It
has not been possible to check if a character is within a given range of
characters (unless you write a very complicated CST).
Pattern recognition allows the user to specify either a range of characters or a
specific pattern with a unique name that can be used to test the input data
against.
Example
The following command sets the label size for thermal printer 1:
where
aaaa
is the length of the label,
bbbb
is the effective print width and
cccc
is the effective print length.
NOTE: aaaa
,
bbbb
, and
cccc
are always fixed at 4 digits with a value range
of 0000 to 9999.
Convert this command (assuming the units are the same) into the PGL
PAPER command for thermal printer 2.
Start with a CST that will translate the
aaaa
since thermal printer 2 can detect the forms length using the
CALIBRATE function. The value of
bbbb
will be used in combination with the
WIDTH function, and the value of
cccc
in combination with the LENGTH
function. This results in the following translation:
Thermal printer 1:
Thermal printer 2: PAPER;CALIBRATE;LENGTH cccc;WIDTH
bbbb
To be able to copy the value of
bbbb
into the WIDTH function and the value of
cccc
into the LENGTH function, label these values and specify their ranges to
be from 0000 to 9999.
To do this, use the Object Definition capability of the datastream adapter.