In short, whatever logic leads to asserting DoCycleStart is what will initiate a cycle on your machine.
Suppose, for example, that you just want to require that the operator press both start buttons any time they want to cause a cycle start (and, therefore, that you are not going to allow use of the cycle start button on the jog panel, nor the Alt-S keyboard equivalent).
In that case you would replace the standard line in the PLC program with one that reads:
Code: Select all
IF (LeftCycle && RightCycle) THEN (DoCycleStart)
However, that does not deliver the level of safety promised by two separate hand switches, because if one of the switches is defeated, then the operator can start a cycle simply by pressing the remaining switch. Ensuring that both switches have been open in between activations will require additional logic, with a memory flag indicating that starting will be allowed and recognized, and another flag indicating that the buttons have been seen and accepted. E.g.:
Code: Select all
HandStartsAllowed_M IS MEM88
HandStartsPressed_M IS MEM89
; If both switches are open, then "arm" system to allow next start
IF !LeftCycle && !RightCycle THEN SET HandStartsAllowed_M
; If system "armed" and both switches closed, then do start
IF LeftCycle && RightCycle && HandStartsAllowed_M THEN SET HandStartsPressed_M
IF HandStartsPressed_M THEN (DoCycleStart)
; If both have been pressed, and now one or both are released, then disarm
IF HandStartsPressed_M && !(LeftCycle && RightCycle) THEN RST HandStartsAllowed_M
; Then (after disarming while "pressed" flag was still set) turn off "pressed" flag
IF !(LeftCycle && RightCycle) THEN RST HandStartsPressed_M
I haven't tested this code, but it should work.
Now suppose that you don't want to require the operator to press both buttons for every "start" action on the control (e.g. homing after powerup, running an MDI command, etc.), but you do want to require both hands at certain points in program cycles. You could define a custom M function, which could be included in a program cycle any time you want to wait for the two hand switches. That M function, rather than waiting for a cycle start action, could wait for the "HandStartsPressed_M" memory bit as used above (and the above code would omit the DoCycleStart action).
In the file "mfunc70.mac" you would have:
Code: Select all
; M70 - wait for both hand switches
M100/70089 ; wait for switches not pressed
M101/70089 ; wait for switches pressed
and, because it is good practice to let the operator know what is going on, you would add to the file "cncxmsg.txt" the lines:
Code: Select all
MEM89
"Waiting for left and right hand switches..."
Clearly, the variations are endless, depending on your needs. Hope this helps.