Action Source 21 - Compare Digital Outputs
Some actions need to be triggered based on the state of multiple digital inputs. For such cases, the Compare Digital Inputs action source provides a mechanism for specifying a combination of digital input values.
A 32-bit word containing the states of all DIN pins (DIN.STATES) and bidirectional digital IO pins (DIO.STATES) is updated prior to running the action table rows. DINs are assigned bits 0-19, and DIOs are assigned bits 20-31.
To set up an action to run based on a digital input combination, set ACTION#.SOURCE to 21 (Compare Digital Inputs). ACTION#.SOURCEID is unused, and ACTION#.SOURCEPARAM defines a mask corresponding to the pins you wish to check. For example, to check DIN2, DIN5, and DIO3, set ACTION#.SOURCEPARAM to 4194322 (0x00400012).
Set ACTION#.CONDITIONVALUE to the specific value of the digital input combination you want to match. Continuing the example, to match the combination DIN2 = 1, DIN5 = 0, and DIO3 = 1, set ACTION#.CONDITIONVALUE to 4194306 (0x00400002).
When ACTION#.CONDITION is 2 (Follows) the comparison is continuously true if the digital input match is successful. When ACTION#.CONDITION is 1 (Inverts) the comparison is true if one or more of the digital inputs does not match its specified value. When ACTION#.CONDITION is 5 (Rising Edge) the comparison triggers the action task on the first sample where the digital input matches. When ACTION#.CONDITION is 6 (Falling Edge) the comparison triggers the task on the first sample where one or more digital inputs fails to match.






