I am trying to find a better (cleaner) way to code this. In this example B3:45 should only have 1 bit on in its 0-3 range. It is a selection of what area the code will execute on. In this case it is 4 bits I am checking so these lines of code do work. In a program I am planning to write next I will need to test up to 8 bits (only one on) to detect only one train in a mainline block.
In this sample code, if more then one bit is on, it simply sets an alarm code indicating a selection error.
Any suggestions?
Mike
In this sample code, if more then one bit is on, it simply sets an alarm code indicating a selection error.
Any suggestions?
Mike




