beautypg.com

Rockwell Automation 1775-S4B,D17756.5.3 User Manual SCANNER/MSG HND User Manual

Page 91

background image

Formatting Data in Report Generation

Chapter 9

9Ć3

character, the output displays a flush right margin with spaces filling any
unused areas.

Examples of formatting margins and pads are given below:

If you enter:

A=456
B=678
P B!+010D
P B!+.10D
P B!–*10D

The 1775–S4B scanner displays:

0000000456
.......678
678*******

Looking at the printout, variables A and B contain each input value.
Variable A prints out flush right preceded by zeros, and variable B prints
out flush right preceded by periods. Finally, variable B prints out flush left
followed by asterisks.

In the example above, you will notice that the number 10 follows the fill
character. This number, denoted by W in the format specification, indicates
the width of the output display, or the number of characters that can appear
for the output display. In the example, ten character spaces were allotted.
Thus, the integer value 678 takes up three spaces and seven asterisks fill
the remainder of the line. The field width character, W, enables you to
specify an output display’s width on a line. Remember, more than one
output display can appear on a line.

To specify a field width, simply enter the desired number after the fill
character, or after the! if margin justification is not specified. If you enter a
zero, or do not enter a value for the field width, then space will
automatically be allotted for the output display.

An example is given below:

If you enter:

A=2
PA!+*8D
PA!+0D
PA!+*8D
PA!D

9.1.3
Displaying Data