rendered paste body# HAL config file for Mesa Electronics 5i20 PCI board
#
# Install driver.
#loadrt hal_m5i20
# Classicladder for machine logic (load the realtime portion).
#loadrt classicladder_rt numRungs=4 numBits=16 numWords=4 numTimers=2 numMonostables=2 numPhysInputs=16 numPhysOutputs=8 numArithmExpr=4 numSections=1
# Invoke the user part of CL to silently load the program.
#loadusr -w classicladder --nogui ../configs/common/bridgeport.clp
# Add I/O to servo thread so they will be evaluated
# every servo period.
# inputs are read at the beginning of the thread
addf m5i20.0.misc-update servo-thread 1
#addf m5i20.0.adc-read servo-thread 1
addf m5i20.0.digital-in-read servo-thread 1
#addf classicladder.0.refresh servo-thread 1
# outputs are updated at the end of the thread
addf m5i20.0.digital-out-write servo-thread -1
#
# Connect motion controller I/Os
#
# Connect limit/home switch outputs to motion controller.
newsig Xminlim bit
newsig Xmaxlim bit
newsig Xhome bit
linksp Xminlim <= m5i20.0.in-00-not
linksp Xminlim => axis.0.neg-lim-sw-in
linksp Xmaxlim <= m5i20.0.in-01-not
linksp Xmaxlim => axis.0.pos-lim-sw-in
linksp Xhome <= m5i20.0.in-00
linksp Xhome => axis.0.home-sw-in
newsig Yminlim bit
newsig Ymaxlim bit
newsig Yhome bit
linksp Yminlim <= m5i20.0.in-04-not
linksp Yminlim => axis.1.neg-lim-sw-in
linksp Ymaxlim <= m5i20.0.in-05-not
linksp Ymaxlim => axis.1.pos-lim-sw-in
linksp Yhome <= m5i20.0.in-04
linksp Yhome => axis.1.home-sw-in
newsig Zminlim bit
newsig Zmaxlim bit
newsig Zhome bit
linksp Zminlim <= m5i20.0.in-08-not
linksp Zminlim => axis.2.neg-lim-sw-in
linksp Zmaxlim <= m5i20.0.in-09-not
linksp Zmaxlim => axis.2.pos-lim-sw-in
linksp Zhome <= m5i20.0.in-09
linksp Zhome => axis.2.home-sw-in
# Connect amp faults to motion controller.
newsig Xfault bit
newsig Yfault bit
newsig Zfault bit
linksp Xfault <= m5i20.0.in-03-not
linksp Xfault => axis.0.amp-fault-in
linksp Yfault <= m5i20.0.in-07-not
linksp Yfault => axis.1.amp-fault-in
linksp Zfault <= m5i20.0.in-11-not
linksp Zfault => axis.2.amp-fault-in
# Connect amp enables to motion controller.
linksp Xenable => m5i20.0.out-08
linksp Yenable => m5i20.0.out-09
linksp Zenable => m5i20.0.out-10
# Connect amp enables to m5i20 dac enables
linksp Xenable => m5i20.0.dac-00-enable
linksp Yenable => m5i20.0.dac-01-enable
linksp Zenable => m5i20.0.dac-02-enable
# Connect watchdog reset to motion controller.
#newsig WatchdogRst bit
#linksp WatchdogRst <= m5i20.watchdog-reset
#linksp WatchdogRst => motion.watchdog-reset-out
#
# Connect I/O controller I/Os
#
# Connect e-stop write/sense to I/O controller.
#
# The estop from the opto module should be jumpered to one of the
# m5i20 estop pins. This will notify the motion of the estop condition
# and it will zero the DACs and turn off all output even if the PC
# has crashed.
#
newsig EstopSense bit
newsig EstopWrite bit
# create a signal for the estop loopback -- remove for external
linkpp iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
# use this if you have an external estop switch
# linksp EstopSense <= m5i20.0.estop-in-not
# linksp EstopSense <= m5i20.0.in-15
# linksp EstopSense => iocontrol.0.emc-enable-in
# linksp EstopWrite => m5i20.0.out-07
# linksp EstopWrite <= iocontrol.0.user-enable-out
# Connect spindle fwd/rev to I/O controller.
newsig SpindleFwd bit
newsig SpindleRev bit
linksp SpindleFwd => m5i20.0.out-00
linksp SpindleFwd <= motion.spindle-forward
linksp SpindleRev => m5i20.0.out-01
linksp SpindleRev <= motion.spindle-reverse
# Connect spindle brake to I/O controller.
newsig SpindleBrakeOn bit
linksp SpindleBrakeOn => m5i20.0.out-02
linksp SpindleBrakeOn <= motion.spindle-brake
# Connect mist/flood coolant to I/O controller.
newsig MistOn bit
newsig FloodOn bit
linksp MistOn => m5i20.0.out-05
linksp MistOn <= iocontrol.0.coolant-mist
linksp FloodOn => m5i20.0.out-06
linksp FloodOn <= iocontrol.0.coolant-flood
# Connect lube motor run to I/O controller.
newsig LubeOn bit
linksp LubeOn => m5i20.0.out-12
linksp LubeOn <= iocontrol.0.lube
# Connect lube level to I/O controller.
newsig LubeLevel bit
linksp LubeLevel <= m5i20.0.in-14
linksp LubeLevel => iocontrol.0.lube_level
# Loop back tool loading pins
linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
linkpp iocontrol.0.tool-change iocontrol.0.tool-changed