Dear all,
This is my halrun cmd, everthing goes well.
Code:
halcmd: loadrt threads name1=master period1=1000000
halcmd: loadusr -W lcec_conf /home/lab428/hiwin.xml
halcmd: loadrt lcec
halcmd: addf lcec.read-all master
halcmd: addf lcec.write-all master
halcmd: start
setp lcec.0.0.drivecontrol-1 1
setp lcec.0.0.drivecontrol-2 1
setp lcec.0.0.drivecontrol-0 1
However, when i use .hal file with linuxcnc, the statusword stuck in 0x650 no matter how i set the controlword.
My .hal file as below.
Code:
#load the XML config & the ethercat hal parser.
loadusr -W lcec_conf /home/lab428/hiwin.xml
loadrt lcec
#load the motion component
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
#add the function we need to the servo-thread
addf lcec.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf lcec.write-all servo-thread
#set the control word to 6 and the state will be ready to switch on.
setp lcec.0.0.drivecontrol-1 1
setp lcec.0.0.drivecontrol-2 1
#check if the state is in OP mode then enable emc and go to switched on state.
net ready_to_switch lcec.state-op => iocontrol.0.emc-enable-in => lcec.0.0.drivecontrol-0
The change of statusword as below.
Thanks for help.