Data Type ‘BIT’ΒΆ

You can use the BIT data type only for single variables in structures or in a function block. The possible values are TRUE (1) and FALSE (0).

A BIT element requires 1 bit of memory. Therefore, you can reference single bits of a structure by name. BIT elements that are declared in succession are bundled in bytes. In this way, you can optimize memory use as opposed to BOOL types, which reserve 8 bits each. On the other hand, bit access is significantly more time-consuming. Therefore, you should use the BIT data type only when you need to define data in a predefined format.

See also