OK the easy way (programmer,operator and machine) is to use Gcode and Mcodes that way it is easy to CAM the project and let the post write all the code.
G0 X1 Y1 (move to drill point)
M1001 (Lock Bed)
G81 X1.000 Y1.000 Z-1.000 R.5 F5 (drill Cycle)
G80 (cancell cycle)
M1002 (Unlock Bed)
G0 X2.000 Y2.000 (move to new drill point)
M1001 (Lock Bed)
G81 X2.000 Y2.000 Z-1.000 F5 (drill cycle )
G80 ( cancell cycle)
M1002 (Unlock Bed)
G0 X3.000 Y3.000 ( Move to new drill point)
M1001 (Lock Bed)
G81 X3.000 Y3.000 Z-1.000 F5 (drill cycle)
G80 Cancell cycle)
M1002 (Unlock Bed)
G0 X0.000 Y0.000 Move to new drill cycle )
etc
etc
etc
The mcodes code would look like this
'M1001 , Macro to lock bed
Activate(output3)
'M1002 , Macro to unlock bed
Deactivate(output3)
Output 3 would be wired to the bed lock controller
DOES that suite your needs or do you require something more. From here on out it gets more complicated for the Programmer/operator/machine