Class InputBits


  • public class InputBits
    extends java.lang.Object
    Utility Class supporting input from Maple HMI's

    All of the Maple HMI panels are configured with the same input bits. As each HMI is polled, the results are ORed together in an input array that is initialized to all 0 when a polling cycle is initiated. That way, if a bit is 1 in any of the HMI's, it will be 1 in the input array at the end of the polling cycle. At the end of each polling cycle, each input bit is compared to the input bit from the last polling cycle. If a bit has changed, or if this is the first polling cycle, the correspnding Sensor state is updated. No updating occurs if all panels timed out. Serial systems with unique input bits for each node keep their input array in each node. That code has been moved to this utility class for Maple Systems because all nodes share the same set of input bits. Coil bits within Maple Systems HMI's are divided into input (1-1000) and output (1001-9000), so input bits are read starting from HMI address 1, and output bits are written starting at HMI address 1001.

    • Method Detail

      • markChanges

        public void markChanges​(SerialReply l)
        Use the contents of the poll reply to mark changes Bits from all the polled panels are ORed together. So if any panel has the bit on (after any inversion is provided for), the resulting bit will be on when the polling cycle is complete.
        Parameters:
        l - Reply to a poll operation
      • makeChanges

        public void makeChanges()
        This routine is invoked at the end of each polling cycle to change those Sensors that have changed during the polling cycle. After making whatever changes are warranted, this routine clears the array for accumulating a new polling cycle. Only sensors that are actually defined are updated
      • registerSensor

        public void registerSensor​(Sensor s,
                                   int i)
        The numbers here are 0 to MAXSENSORS, not 1 to MAXSENSORS.
        Parameters:
        s - Sensor object
        i - 0 to MAXSENSORS number of sensor's input bit on this node