Wud - Word Unsigned Decimal (Bcd); Lhd - Extended Precision (Bcd); Wso - Word Signed Octal - Allen-Bradley SLC 500 Manual

Hide thumbs Also See for SLC 500:
Table of Contents

Advertisement

WUD - Word Unsigned Decimal (BCD)

The WUD variable type is very similar to the WSD type. The only difference is that the number does
not have any sign, overflow or underflow bits associated with it. Instead, the number has four BCD
digits instead of three. The format of the WUD variable is shown below.
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
1000's Digit
100's Digit
10's Digit
Example:
The following binary value is present in a PLC2/15 at address 250.
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
0 1 0
1
0
1
0
1
0
1
Reading this variable would result in the value 5555 because all the digits contain the BCD value of 5.
Note that although the data in the word was the same as used in the WUB and WSD examples, the
result obtained by reading the value as a WUD variable is not.

LHD - Extended Precision (BCD)

A LHD variable type is used to read an extended precision BCD type with a range of -79999999 to
+79999999. Two words are required.

WSO - Word Signed Octal

A WSO variable type is used to read a word as a four-digit octal number. This is the same thing as a
12-bit binary number , since each octal digit represents exactly three binary bits. A WSO variable also
includes overflow, underflow, and sign bits, in the same manner as a WSD variable.
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
Digit 3
Digit 2
Not used
Underflow Bit (1 = value is between -1 and +1
Sign Bit (1 = negative, 0 = positive)
Overflow Bit (1 = value < -4095 or > 4095)
When the number is read, its sign will be returned from the sign bit while the overflow and underflow
bits are ignored.
Example:
The following binary value is present in a PLC2/15 at address 250.
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
0 1 0
1
0
1
0
1
0
1
Reading this variable would result in the value -1365 because the sign bit was set and the octal number
in the register was 2525 or 1365 decimal. Note that although the data in the word was the same as used
in the WUB and WSD examples, the result obtained by reading the value as a WSO variable is not.
34 • • • • Allen-Bradley
1's Digit
0
1
0
1
0
1
Digit 1
Digit 0
0
1
0
1
0
1
QUICKDESIGNER

Advertisement

Table of Contents
loading

Table of Contents