- Configuring LinuxCNC
- Advanced Configuration
- m144.sh (m100-m199) to timestamp begin/end of G-code run?
m144.sh (m100-m199) to timestamp begin/end of G-code run?
- clunc
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 256
- Thank you received: 37
05 Nov 2016 22:58 #82502
by clunc
m144.sh (m100-m199) to timestamp begin/end of G-code run? was created by clunc
Would this work? (Not sure where m144.sh would need to be stored.)
Thank you.
--
cLUnc
[inside G-code][the m144.sh bash script]
Thank you.
--
cLUnc
[inside G-code]
... at beginning of G-code
M144 201 1 ; M144, relies on m144.sh, reminiscent of old AT&T 411 service, followed by modelnumber and "begin" flag
... do the program
M144 201 0 ; "begin" flag not equal 1, thus, "end"
M5
M2
#!/bin/bash
# Filename: m144.sh
# LinuxCNC log modelnumber and time-of-day
modelnumber=$1 # first arg
begin=$2 # second arg, begin = 1, end = 0
#daat = `date` # FAIL no spaces allowed
daat=`date` # fine, call linux os 'date' command
echo "Model$modelnumber: $daat" >> /CNCMODELS/m144_time.log
if [ $begin -eq 0 ] ; then # my, what strange syntax you have my dear...
echo '' >> /CNCMODELS/m144_time.log &
fi
exit 0
Please Log in or Create an account to join the conversation.
- clunc
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 256
- Thank you received: 37
05 Nov 2016 23:24 #82503
by clunc
Replied by clunc on topic m144.sh (m100-m199) to timestamp begin/end of G-code run?
> (Not sure where m144.sh would need to be stored.)
...but a reasonable guess is in the directory specified by the "SUBROUTINE_PATH = " entry in the "[RS274NGC]" section of the "~/linuxcnc/configs/<machine-name>/<machine_name>.ini" file.
whew.
...but a reasonable guess is in the directory specified by the "SUBROUTINE_PATH = " entry in the "[RS274NGC]" section of the "~/linuxcnc/configs/<machine-name>/<machine_name>.ini" file.
whew.
Please Log in or Create an account to join the conversation.
- dgarrett
- Offline
- Platinum Member
-
Less
More
- Posts: 567
- Thank you received: 325
06 Nov 2016 00:30 #82504
by dgarrett
Replied by dgarrett on topic m144.sh (m100-m199) to timestamp begin/end of G-code run?
Search rules for user-defined M commands:
linuxcnc.org/docs/2.7/html/config/ini-config.html
File requirements for user-defined M commands:
linuxcnc.org/docs/2.7/html/gcode/m-code.html
note:
linuxcnc.org/docs/2.7/html/config/ini-config.html
2.4 [RS274NGC] Section
File requirements for user-defined M commands:
linuxcnc.org/docs/2.7/html/gcode/m-code.html
23. M100-M199 User Defined Commands
note:
no extension and a capitol M are expected
Please Log in or Create an account to join the conversation.
- clunc
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 256
- Thank you received: 37
06 Nov 2016 14:11 #82509
by clunc
Replied by clunc on topic m144.sh (m100-m199) to timestamp begin/end of G-code run?
Very nice. Thank you for the hand-up.
separated list of up to 10 directories to be searched when single-file subroutines are specified in gcode."
Indeed,
So, I'll:
* add a "USER_M_PATH=" line under the RS274NGC section of the INI file
* rename 'm144.sh' to 'M144'
* and double-check that it's executable
(NOW I remember the word: "homage". "144 is an homage to AT&T's old 411 directory assistance service." That's what I wanted to say.)
Thanks, dgarrett!
The "USER_M_PATH" parameter "specifies a colon (Search rules for user-defined M commands:
linuxcnc.org/docs/2.7/html/config/ini-config.html2.4 [RS274NGC] Section

File requirements for user-defined M commands:
linuxcnc.org/docs/2.7/html/gcode/m-code.html23. M100-M199 User Defined Commands
note:no extension and a capitol M are expected
Indeed,
The error Unknown M code used denotes one of the following:
* The specified User Defined Command does not exist
* The file is not an executable file
* The file name has an extension
* The file name does not follow this format M1nn where nn = 00 through 99
* The file name used a lower case M
So, I'll:
* add a "USER_M_PATH=" line under the RS274NGC section of the INI file
* rename 'm144.sh' to 'M144'
* and double-check that it's executable
(NOW I remember the word: "homage". "144 is an homage to AT&T's old 411 directory assistance service." That's what I wanted to say.)
Thanks, dgarrett!
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- m144.sh (m100-m199) to timestamp begin/end of G-code run?
Time to create page: 0.197 seconds