rendered paste body# HAL config file for Vital Systems MOTENC-100 PCI board
#
# Install driver.
#loadrt hal_motenc
# Classicladder for machine logic (load the realtime portion).
# Just uncomment the following line if you want a Software PLC
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.
# Just uncomment the following line if you want a Software PLC
loadusr -w classicladder --nogui MTE.clp
# Add I/O to servo thread so they will be evaluated
# every servo period.
# inputs get read at the beginning of the thread
addf motenc.0.misc-update servo-thread 1
#addf motenc.0.adc-read servo-thread 1
addf motenc.0.digital-in-read servo-thread 1
addf classicladder.0.refresh servo-thread 1
loadusr classicladder
# outputs get refreshed at the end of the thread
addf motenc.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 <= motenc.0.in-00
linksp Xminlim => axis.0.neg-lim-sw-in
linksp Xmaxlim <= motenc.0.in-01
linksp Xmaxlim => axis.0.pos-lim-sw-in
linksp Xhome <= motenc.0.in-02
linksp Xhome => axis.0.home-sw-in
newsig Yminlim bit
newsig Ymaxlim bit
newsig Yhome bit
linksp Yminlim <= motenc.0.in-04
linksp Yminlim => axis.1.neg-lim-sw-in
linksp Ymaxlim <= motenc.0.in-05
linksp Ymaxlim => axis.1.pos-lim-sw-in
linksp Yhome <= motenc.0.in-06
linksp Yhome => axis.1.home-sw-in
# Connect amp faults to motion controller.
newsig Xfault bit
newsig Yfault bit
linksp Xfault <= motenc.0.in-03
linksp Xfault => axis.0.amp-fault-in
linksp Yfault <= motenc.0.in-07
linksp Yfault => axis.1.amp-fault-in
# linksp Zfault <= motenc.0.in-11
# Connect amp enables to motion controller.
linksp Xenable => motenc.0.out-08
linksp Yenable => motenc.0.out-09
## linksp Zenable => motenc.0.out-10
# Connect watchdog reset to mot ion controller.
#newsig WatchdogRst bit
#linksp WatchdogRst <= motenc.watchdog-reset
#linksp WatchdogRst => motion.watchdog-reset-out
# Connect classicladder I/O
#newsig I0 bit
#newsig I1 bit
#newsig I2 bit
#newsig I3 bit
#newsig I4 bit
#newsig I5 bit
#newsig I6 bit
#newsig I7 bit
#newsig I8 bit
#newsig I9 bit
#newsig I10 bit
#newsig I11 bit
#newsig I12 bit
#newsig I13 bit
#newsig I12 bit
#newsig I14 bit
#newsig I15 bit
#linksp I0 => classicladder.0.in-00
#linksp I1 => classicladder.0.in-01
#linksp I2 => classicladder.0.in-02
#linksp I3 => classicladder.0.in-03
#linksp I4 => classicladder.0.in-04
#linksp I5 => classicladder.0.in-05
$linksp I6 => classicladder.0.in-06
#linksp I7 => classicladder.0.in-07
#linksp I8 => classicladder.0.in-08
#linksp I9 => classicladder.0.in-09
#linksp I10 => classicladder.0.in-10
#linksp I11 => classicladder.0.in-11
#linksp I12 => classicladder.0.in-12
#linksp I13 => classicladder.0.in-13
#linksp I14 => classicladder.0.in-14
#linksp I15 => classicladder.0.in-15
#
# 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
# motenc estop pins. This will notify the moten 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
#linksp EstopSense <= motenc.0.estop-in {not functional}
linksp EstopSense <= motenc.0.in-15
linksp EstopSense => iocontrol.0.emc-enable-in
linksp EstopWrite => motenc.0.out-07
linksp EstopWrite <= iocontrol.0.user-enable-out
# ESTOP loopback, only use this for a simple machine without external ESTOP
# you really SHOULDN'T use a servo machine without proper ESTOP
#linkpp iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
# Connect spindle fwd/rev to I/O controller.
#newsig SpindleFwd bit
#newsig SpindleRev bit
#linksp SpindleFwd => motenc.0.out-23
#linksp SpindleFwd <= iocontrol.0.spindle-forward
#linksp SpindleRev => motenc.0.out-22
#linksp SpindleRev <= iocontrol.0.spindle-reverse
# Connect spindle brake to I/O controller.
#newsig SpindleBrakeOn bit
#linksp SpindleBrakeOn => motenc.0.out-21
#linksp SpindleBrakeOn <= iocontrol.0.spindle-brake
# Connect spindle speed up/down to I/O controller.
#newsig SpindleUp bit
#newsig SpindleDown bit
#linksp SpindleUp => motenc.0.out-20
#linksp SpindleUp <= iocontrol.0.spindle-incr-speed
#linksp SpindleDown => motenc.0.out-19
#linksp SpindleDown <= iocontrol.0.spindle-decr-speed
# Connect mist/flood coolant to I/O controller.
#inksp MistOn => motenc.0.out-05
#linksp MistOn <= iocontrol.0.coolant-mist
#linksp FloodOn => motenc.0.out-16
#linksp FloodOn <= iocontrol.0.coolant-flood
# Connect lube motor run to I/O controller.
#newsig LubeOn bit
#linksp LubeOn => motenc.0.out-18
#linksp LubeOn <= iocontrol.0.lube
# Connect lube level to I/O controller.
#newsig LubeLevel bit
#linksp LubeLevel <= motenc.0.in-17
#linksp LubeLevel => iocontrol.0.lube_level