One of the guys on the IRC was wondering how to do an adjustable on the fly pre-heat delay for his Oxy/Acc torch. After some discussion and suggestions I came up with this example using digital input, digital output, and oneshot.
.ini file additions
[DISPLAY]
...
PYVCP = panel.xml
[HAL]
...
POSTGUI_HALFILE = postgui.hal
panel.xml
<?xml version='1.0' encoding='UTF-8'?>
<pyvcp>
<!--
slider for torch delay
-->
<scale>
<font>("Helvetica",16)</font>
<width>"25"</width>
<halpin>"delay"</halpin>
<resolution>0.1</resolution>
<orient>HORIZONTAL</orient>
<initval>0.1</initval>
<min_>0.1</min_>
<max_>10</max_>
</scale>
</pyvcp>
postgui.hal
loadrt oneshot names=torch-delay
addf torch-delay servo-thread
net delay-time torch-delay.width <= pyvcp.delay-f
net delay-start torch-delay.in <= motion.digital-out-00
net go-torch motion.digital-in-00 <= torch-delay.out-not
anonimasu.ngc
G0 X2 Y2
Z-0.999
M62 P0 (turn on the delay)
Z-1 (gotta move after M62)
M66 P0 L1 Q25 (wait for delay to finish)
M63 P0
G1 X3 Y3 F10
M2
Enjoy
John