WORD¶
Bit string of 16 bits.
Size |
16 bits |
Range |
16#0000 to 16#FFFF |
Default |
16#0000 |
IEC 61131-3 |
Section 2.3.1 |
Support |
Supported |
Literals¶
WORD#16#FFFF
WORD#16#00FF
WORD#2#1010101010101010
Example¶
status_reg := WORD#16#FF03;
mask := WORD#16#00FF;
masked := status_reg AND mask; (* masked = 16#0003 *)
Bit Access¶
Individual bits can be read and written using .n or .%Xn syntax
(for example, status_reg.5 or status_reg.%X5). Valid indices are
0..15. See Bit Access.
See Also¶
BYTE — 8-bit bit string
DWORD — 32-bit bit string
UINT — 16-bit unsigned integer
Bit Access — selecting an individual bit of a bit-string value