BIT

Overview

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

A BIT element consumes 1 bit of memory space and allows you to address single bits of a structure by name (for further information, refer to the paragraph Bit Access in Structures). Bit elements which are declared one after another will be combined in bytes. In contrast to BOOL types, where 8 bits are reserved in any case, the use of memory space can get optimized. On the other hand, the access to bits takes definitely more time. For that reason, use the BIT data type if you want to store several boolean pieces of information in a compact format.