UPD:
It was a type mismatch. After I changed the spindle-controlword to float from u32 in xml, now is working. But its weird, since the servo controlword still u32 and working as well.
Why?
Anyway, thanks for the help, now I understand what I'm doing in hal.
After testing, is not working yet.
How can I check these signals:
mux2.spindle-enable.in0
mux2.spindle-enable.in1
spindle-ctrl-cmd
they are not appearing in halshow
This is the full scpindle code:
...
...
loadusr -W lcec_conf /home/eduard/linuxcnc/custom/ethercat-conf.xml
loadrt lcec
loadrt cia402 count=1
loadrt mux2 names=mux2.spindle-enable
addf lcec.read-all servo-thread
addf cia402.0.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf cia402.0.write-all servo-thread
addf lcec.write-all servo-thread
addf mux2.spindle-enable servo-thread
...
...
#*******************
# SPINDLE
#*******************
#Spindle OFF
setp mux2.spindle-enable.in0 0
#Spindle ON
setp mux2.spindle-enable.in1 15
net spindle-vel-cmd-rpm => lcec.0.MX2.spindle-target-velocity
net spindle-vel-fb-rpm => lcec.0.MX2.spindle-actual-velocity
net spindle-enable => mux2.spindle-enable.sel
net spindle-ctrl-cmd mux2.spindle-enable.out => lcec.0.MX2.spindle-controlword
#net qtdragon.spindle-fault <= lcec.0.MX2.spindle-statusword
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-enable <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
# ---Setup spindle at speed signals---
sets spindle-at-speed true