Hi guys,
Tinkering of a mpg.hal file and I need some advice here.
Have 3 inputs and I want 1 output go TRUE if one of these inputs is TRUE.
How to do this? 2 XOR2's or what?
+ I want that output to be flashing also.
This is the file so far
# Jog Pendant
loadrt encoder num_chan=1
loadrt mux4 count=1
loadrt xor2 count=2
loadrt siggen num_chan=1
addf encoder.capture-position servo-thread
addf encoder.update-counters base-thread
addf mux4.0 servo-thread
addf xor2.0 servo-thread
addf siggen.0.update servo-thread
# If your MPG outputs a quadrature signal per click set x4 to 1
# If your MPG puts out 1 pulse per click set x4 to 0
setp encoder.0.x4-mode 0
# For velocity mode, set to 1
# In velocity mode the axis stops when the dial is stopped
# even if that means the commanded motion is not completed,
# For position mode (the default), set to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
setp axis.0.jog-vel-mode 1
setp axis.1.jog-vel-mode 1
setp axis.2.jog-vel-mode 1
# This sets the scale that will be used based on the input to the mux4
setp mux4.0.in0 0.1
setp mux4.0.in1 0.01
setp mux4.0.in2 0.001
# The inputs to the mux4 component
net scale1 mux4.0.sel0 <= hm2_7i76e.0.7i73.0.1.input-01
net scale2 mux4.0.sel1 <= hm2_7i76e.0.7i73.0.1.input-02
# The output from the mux4 is sent to each axis jog scale
net mpg-scale <= mux4.0.out
net mpg-scale => axis.0.jog-scale
net mpg-scale => axis.1.jog-scale
net mpg-scale => axis.2.jog-scale
# The MPG inputs
net mpg-a encoder.0.phase-A <= hm2_7i76e.0.7i73.0.1.input-08
net mpg-b encoder.0.phase-B <= hm2_7i76e.0.7i73.0.1.input-09
# The Axis select inputs
net mpg <= hm2_7i76e.0.7i73.0.1.input-03 ### This setting disables the MPG
net mpg-x axis.0.jog-enable <= hm2_7i76e.0.7i73.0.1.input-04
net mpg-y axis.1.jog-enable <= hm2_7i76e.0.7i73.0.1.input-05
net mpg-z axis.2.jog-enable <= hm2_7i76e.0.7i73.0.1.input-06
# The encoder output counts to the axis. Only the selected axis will move.
net encoder-counts <= encoder.0.counts
net encoder-counts => axis.0.jog-counts
net encoder-counts => axis.1.jog-counts
net encoder-counts => axis.2.jog-counts
# Activate MPG - ON flashing light in frontpanel
net mpglight-in1 <= hm2_7i76e.0.7i73.0.1.input-04 xor2.0.in0
net mpglight-in2 <= hm2_7i76e.0.7i73.0.1.input-05 xor2.0.in1
net next-out <= xor2.0.out
net mpglight-in3 <= hm2_7i76e.0.7i73.0.1.input-06 xor2.1.in0
net next-out xor2.1.in1
net mpglight-out <= xor2.1.out
net mpglight-out => hm2_7i76e.0.7i73.0.1.output-15