- Posts: 393
- Thank you received: 0
Python toolchanger, problem while loading program
I am working on a python tool changer project that is mostly already doing what we wanted. In fact we were already saying that it is ready as we tested several time with MDI mode.
When preparing gcode to test the tool changer in a repeat manner, we found that any gcode file during load though errors that are present on the python tool changer. It looks like the preview runs the toolchanger (that makes sense). However there are conditions that are not meet during the load of a file that are effective errors if the tool changer is really called.
To avoid this error I have tested several things including trying to get the linuxcnc.status or mode, without success, so that in python the tool changer routine is aborted if the machine is not running in AUTO or MDI.
Any ideia to overcome this problem?
Please Log in to join the conversation.
I used it when building and troubleshooting python remap. I pulled it from the code but the function is still there.
Please Log in to join the conversation.
So I have to split it up.
Please Log in to join the conversation.
We were not able to use your function as the return state during a MDI code or for example a touch off where the same, and during the touch off the routine trigger a error.
Or solution was to implement on the top of the python file a verification check for a digital pin that we know that is always "1". If it would be impossible to fetch the status of the pin or returned a value different than "1", it means that the python toolchanger script could not be used and returned without any toolchange.
Please Log in to join the conversation.
emcPT wrote: Thank you.
We were not able to use your function as the return state during a MDI code or for example a touch off where the same, and during the touch off the routine trigger a error.
Or solution was to implement on the top of the python file a verification check for a digital pin that we know that is always "1". If it would be impossible to fetch the status of the pin or returned a value different than "1", it means that the python toolchanger script could not be used and returned without any toolchange.
Whats driving that pin?
Please Log in to join the conversation.
We set it on hal to be true, always.
Please Log in to join the conversation.
linuxcnc.org/docs/devel/html/remap/remap...apped-code-execution
Please Log in to join the conversation.
Thank you
Please Log in to join the conversation.
I do it like this.... first thing to do in remap file, that will exit if in preview. If in milltask, it will run your code.
Please Log in to join the conversation.
