User M-code M100-199 not executed but terminated with on_abort_command

More
24 Nov 2021 20:21 - 24 Nov 2021 20:26 #227528 by alkabal
Hi

I have some trouble trying to use user M-code

I have configured the path : 
[RS274NGC] 
USER_M_PATH = ./nc_subroutines/remap


Create a file without extension M160 (and do sudo chmod +x M160)
Inside the file : 
#!/bin/bash 
# file to clear axis info 
halcmd setp axisui.notifications-clear 0 
sleep .200 
halcmd setp axisui.notifications-clear 1 
sleep .200 
halcmd setp axisui.notifications-clear 0 
exit 0


Also trying : 
#!/bin/bash 
echo 
echo "Example for User M code invocation:" 
echo "M code File" 
halcmd setp and2.combined-probe.in1 0 
exit 0


The only things i get is the result to
[RS274NGC] 
ON_ABORT_COMMAND=<backup_restore> call



I haven't any error message displayed from terminal.
Trying to call some inexistant Mcode return error Mcode unknow.

I use freshly compiled 2.82 run in place rpi4 raspibian x64
Last edit: 24 Nov 2021 20:26 by alkabal.

Please Log in or Create an account to join the conversation.

More
25 Nov 2021 00:58 #227549 by chen1234
I think the user-defined code (M100-M199) only needs to be in the .../linuxcnc../nc_files/ directory so that it can be recognized by Linuxncnc (I have encountered it before, this is just my solution,http://linuxcnc.org/docs/2.8/html/config/ini-config.html#sec:display-section)

Please Log in or Create an account to join the conversation.

More
25 Nov 2021 01:15 #227551 by alkabal
Thanks a lot for reply

I will have see your topic and try your solution without success

Test done with and without specified USER_M_PATH =

Imo the file are correctly found because i have a error message trying to use inexistant Mcode

I don't understand
#!/bin/bash
echo
echo "Example for User M code invocation:"
echo "M code File"
exit 0


the only result i get is the ON_ABORT_COMMAND

Please Log in or Create an account to join the conversation.

More
26 Nov 2021 01:16 #227602 by alkabal
Problem solved with : changing the Character Coding from CR+LF to LF

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum