While I was toying with a tool startup problem from the forum, I discovered that iocontrol.cc never runs the EMC_TOOL_INIT NML message even though taskclass.cc sends it.
After adding print statements and scratching my head I see that just before the switch statement for detecting the message type it checks to see if the message has been already run: emcioCommand->serial_number == emcioStatus.echo_serial_number) unfortunately just before that when checking halpins for changes the echo_serial_number is advanced, I guess to sent the pin changes to status. So when iocontrol is first run the serial number is 0 and the echo is immediately advanced to 1 when updating the HAL pins. When the EMC_TOOL_INIT message comes it has a serial number of 1 and echo already has a number of 1. So the EMC_TOOL_INIT is never run but the serial/echo number synchs and everything works from there. If I move the function that update the HAL pins after the switch then EMC_TOOL_INIT is called. I get a compiler warning and i don't know the what the effects of running command before updating the HAL pins but it's probably not good. I would appreciate some ideas. related: ! see that iotaskinf.cc is unused and I think it should be removed - it really confused me for a while until I realized taskclass.cc is used instead. EMC_IO_INIT is _never_ called at all (EMC_IO_INIT is suppossd to init the HAL pins, EMC_TOOL_INIT is reads the tool table in) Chris M _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
