Remember the values are the bit values 1,2,4,8 each represents a valid position...
yes, I understand how bits and integers relate, and bits and floats, and bits and anything; I am base-agnostic.
If you look at my tripper_drbitboy.* files
here, you will see that I am comfortable moving between in bit- and integer-space
So I am looking at your code in post #19, and I am thinking about
1) the tripper cart at station 4, so N7:0 = N7:1 = 8.
2) Let's say the operator moves the selector switch to Station 3, so N7:1 changes to 4.
3) The next time rung 5 runs it unlatches IN_POSITION to 0, and after that next time rung 3 runs it sees N7:1 = 4 < 8 = N7:0, and set the MC_REV contact to 1, which starts the motor in reverse.
4) The cart starts moving from station 4 (where N7:0 is 8) toward station 3 (where N7:0 will be 4).
5) When the cart leaves the station 4 prox, N7:0 changes to 0, but it has still not reached station 3.
6) The next time rung 2 executes, it sees N7:1 = 4 > 0 = N7:0 and it starts the motor in forward, back toward station 4
6.1) Rung 3 is now irrelevant since its LES instruction evaluates to False.
7) The cart moves to station 4, N7:0 changes from 0 to 8, and we start looping from (3) above to here.
What am I missing? Does the code not expect N7:0 to be set to 0 between stations? Because, again, you stated this:
Remember the values are the bit values 1,2,4,8 each represents a valid position...