I don't get it? As long as you define the bools next to each other, they'll fill up the byte before moving on to the next. How it works on a PLC at least, I don't know of anything else that could care about this level of inefficiency.
That's not how it works in the majority of low level programming languages; the primary reason for that is that single bits aren't addressable.
As far as I can tell that's also true in PLC-land. Structured Text dictates BOOL has a logical size of 1 bit, but both codesys and beckhoff use a full byte. C and C++ will also use a full byte. There's ways to pack bits, but it usually comes at the cost of addressability.
View all comments
-1
u/Alacritous13 Oct 08 '26
I don't get it? As long as you define the bools next to each other, they'll fill up the byte before moving on to the next. How it works on a PLC at least, I don't know of anything else that could care about this level of inefficiency.