Unsigned Short Integer (or BYTE) data type
Unsigned Short Integer (or BYTE) variables are 8-bit unsigned integers from 0 through 255.
A bit of an Unsigned Short Integer (or BYTE) variable can be accessed using the following syntax:
MyVar.i
If MyVar is an Unsigned Short Integer (or BYTE). MyVar.i is a Boolean, the "i" must be a constant value from 0 through 7.
Unsigned Short Integer (or BYTE) literal expressions represent unsigned integer (8-bit) values from 0 through 255.
Unsigned Short Integer (or BYTE) constants can be expressed with one of the following bases, and the constants must begin with a prefix that identifies the bases used:
Base | Prefix | Example |
---|---|---|
DECIMAL | (none) | 19 |
HEXADECIMAL | "16#" | 16#A1 |
OCTAL | "8#" | 8#28 |
BINARY | "2#" | 2#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.
- If you use a USINT data type variable in a FOR loop, set the boundary less than the maximum of 0 to 255.
Provide Feedback