12/31/2024 3:37 PM | |
Joined: 2/1/2010 Last visit: 9/3/2025 Posts: 212 Rating:
|
I assume you mean this part:
That is not shifting to the left by 1. It's shifting to the left by the called parameter 'i' and comparing it to 0. so its just basically a case statement, based on when each bit & operation is != 0. where only 1 IF can be true because of the construction of the Status1 by the design of the block for this purpose
evaluates the {...} section only when bit 3 passes the test in that case. Same for each other If/else test. So it's doing exactly what you said, its evaluating each bit directly. |
If my post helped you, please rate. Thanks. |
|
1/3/2025 2:02 PM | |
Joined: 2/1/2010 Last visit: 9/3/2025 Posts: 212 Rating:
|
As I already said, It is not "shifting left by 1". It is shifting '1' left by the index ' i ' value # of positions. This is a standard bitwise function in many programming languages. Like this table.
That means that in this case, their values will look like this in binary and then this value is & with the Status1 for the logical test.
where BIT is the function as we both mentioned:
so when i = 3 from above table will be be the word value as shown & with the Status1 bit pattern to test for OOS is true or not. if Status 1 bit 3 = 1 then execute the If statement will be true, else go to the next one, etc. |
If my post helped you, please rate. Thanks. |
|
This contribution was helpful to
1 thankful Users |
Follow us on