QUICKDESIGNER
Allen-Bradley
••••
33
The WUB variable type can be used to read bits by adding the backslash character to the variable
name. The format for the variable is shown below. Any WUB variable can be read as a bit type.
ONLY
the WUB variable has the bit read option.
WUB00000/00
Bit Select 00-07, 10-17
Word Address
WUB Variable Type
Example: To read bit 05 from word 300, the variable name would be WUB300/05.
Example: To read a variable from a PLC address on the Data Highway, you must include the PLC
address. To read bit 05 from word 300 in a PLC-2 located at address 5, the variable would be
WUB300/05_5.
The WUB variable type can also be used to write bits, but
ONLY
to addresses above 200. Remember
that addresses below 200 are reserved for I/O. The format for writing bits is the same as for reading
bits.
Example: To write bit 12 of word address 230, the variable would be WUB230/12.
WARNING
Writing bits in the areas above address 200 requires three operations. (1) the entire 16 bit word is read,
(2) the individual bit is modified, (3) the modified word is written back to the PLC. Therefore,
DO
NOT
associate any ladder logic with words used for bit addressing.
WSD - Word Signed Decimal (BCD)
The WSD variable type will read a signed three digit BCD value from a word in the PLC. The format
of the word is shown below.
17 16 15 14 13 12 11 10 7 6
5
4 3
2
1 0
1's Digit
10's Digit
100's Digit
Not used
Underflow Bit (1 = value is between -1 and +1)
Sign Bit (1 = negative, 0 = positive)
Overflow Bit (1 = value less than -999 or greater than 999
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
1
0
1
0
0
0
0
0
0
0
1
1
1
1
1
1
Reading this variable would result in the value -555 because the sign bit of the word was set, and the
digits each contained the BCD value of 5. Note that although the data in the word was the same as used
in the WUB example, the result obtained by reading the value as a WSD variable is not.