Unsigned Integer (WORD/UINT) data type

Unsigned Integer (UNIT or WORD) variables are 16-bit unsigned integers from 0 through 65535.
  • A bit of an Unsigned Integer or WORD variable can be accessed using the following syntax:
    • MyVar.i
      , where MyVar is an unsigned integer or WORD and MyVar.i is a Boolean. The "i" must be a constant value from 0 through 15.
    • Var1.[Var12]
      , where Var12 is a 16-bit Unsigned Integer (UINT) variable.
    • Var1.[Bit12]
      , where Bit12 is a Defined Word (WORD) that equals 12.
  • Direct bit addressing using a constant value:
    • MyInteger.[3]
    • MyInteger.3
Unsigned Integer (or WORD) literal expressions represent unsigned integer (16 bit) values from 0 through 65535.
Unsigned Integer (or WORD) constants can be expressed with one of the following bases, and must begin with a prefix that identifies the base:
Unsigned Integer constants
Base
Prefix
Example
DECIMAL
(none)
+33000
HEXADECIMAL
"16#"
16#80E8
OCTAL
"8#"
8#100350
BINARY
"2#"
2#0101_0101_0101_0101
TIP: The underscore is used to separate groups of numbers. It has no significance other than to improve the readability of the literal expression.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal