2 string values – Rockwell Automation 1775-S4B,D17756.5.3 User Manual SCANNER/MSG HND User Manual
Page 94

Formatting Data in Report Generation
Chapter 9
9Ć6
The 1775–S4B scanner returns the following:
1775ĆS4B Printout
Description of Value
0000010011010010
4D2
1234
2322
Binary value for 1234
Hexadecimal value for 1234
Decimal value for 1234
Octal value for 1234
The S base specifier serves when you are displaying strings of data.
Suppose you have the following procedure:
If you enter:
A=1234
P ‘THE VALUE IS’A!S
The 1775–S4B scanner displays:
THE VALUE IS R
You may wonder why an R appears after the three spaces. R represents the
ASCII character for the lower seven bits of the value 1234. The 1775–S4B
scanner displays the ASCII value(s) in hex for these bits any time you
assign a string or address to a symbol using an equal sign.
To print out the actual data, you would need to use the special assignment
statement =? which tells the 1775–S4B scanner that the symbol represents
a string of information:
A=?’1234’
P’THE VALUE IS’A!S
The 1775–S4B scanner displays:
THE VALUE IS 1234
9.1.4.2
String Values