Code Example, 'Two-Hand Anti-Tie Down'
For safety purposes, machine builders will sometimes integrate a control method known as "two-hand no tie down" that eliminates the ability of a machine operator to override the two-hand button cycle start.
Two-hand cycle start control assures that the operator has both hands on the start buttons before the machine runs and effectively eliminates the possibility for the operator to cause injury. The problem with the method, without the "no tie down" implemented, is the operator will sometimes "tie" or fasten down the second button so that they only need one hand to run the machine. A "two-hand no tie down" routine eliminates this by performing a timed check on the two separate inputs to make sure one is not tied down.
Our code example allows for a 0.5 sec window of time in which the second button must be pressed. If it is not pressed within 0.5 sec of the first one, a flag turns on (flag 900) and a check is made to make sure the first button is released (not tied down).
Under normal operation (e.g. both buttons are pressed w/in 0.5 seconds of each other and neither is tied down) flag 900 stays off, and the program falls out of the loop. If there is a two-hand failure, 900 turns on and causes the inputs to be re-checked before the cycle is actually started.