Indirect bit addressing

Use a SINT variable to perform indexed bit addressing on 8-bit, 16-bit, 32-bit, and 64-bit integers or words in
Micro800
controller programs using the syntax of
Var1.[Var2]
.
For consistency, the indirect bit addressing syntax also supports using a defined word or constant in place of
Var2
, which results in direct bit addressing.
TIP:
  • For indirect bit addressing, if the value of the variable used for the bit index is out of range at runtime, a controller fault occurs.
  • Direct bit addressing is supported in all versions using the syntax
    Var1.Constant
    , where
    Constant
    is an integer from 0 through 63.
Bit number ranges for direct bit and indirect bit addressing
Integer Type
Range
8-bit integer
From 0 through 7
16-bit integer
From 0 through 15
32-bit integer
From 0 through 31
64-bit integer
From 0 through 63
Example: Indirect bit addressing syntax
Var1.[Var2]
The example uses a SINT variable as the index.
Var1 is a UDINT variable. Each bit can be referenced as a Boolean by using Var 2, a SINT variable, to index through the Booleans.
Example: Direct bit addressing syntax
MyInteger.[3] MyInteger.[MY_DEFINED_WORD]
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal