Axis log

More
17 Aug 2011 20:22 #12553 by Andinc
Axis log was created by Andinc
Hello,

is there a way to log the name and time of a loaded nc file?
Also the time when the manual tool change pops up and when the program is started again.

Thanks
Andy

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

More
18 Aug 2011 10:05 #12573 by ArcEye
Replied by ArcEye on topic Re:Axis log
Hi

You don't say why you ask, can only assume for job estimating or logging.

see
www.linuxcnc.org/index.php?option=com_ku...start=0&lang=russian
as a starter (don't worry its not in russian)

I know there have been other discussions but can't trace them at present.

Beyond that it would be entirely possible to log events, by inserting code into the Axis code ( and even the toolchanger component if that is really relevant ) to trigger timestamps, depends upon your programming skills.

Another way would be to set up a M1xx file which timestamps a log file, along with a descriptor of the event being logged and insert it into your gcode at the relevant junctures.

regards

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

More
18 Aug 2011 14:08 #12583 by ArcEye
Replied by ArcEye on topic Re:Axis log
Hi again

The below is an example of what I described regards using a M1xx routine, you can add to and adapt it as you wish.

M120 below takes the 1st parameter passed (P), converts to int from float and switches that value to the appropriate subroutine.
The subroutine prints the reason for logging to file along with a date/time stamp.

You just need to write a .ngc file that has entries like

M120 P1
G80 G90 G94
G21 G18 G7
G40
......... Do stuff
.
M120 P2
M6T2
M120 P3
.
...........Do stuff
.
M2
M30
M120 P4

You will of course have to 'chmod 0755 M120' to make it executable, place it in the directory pointed to by PROGRAM_PREFIX etc
(see docs for using user defined M codes)

It will produce an output like this in logfile
Started machining
Thu Aug 18 14:47:47 BST 2011
Toolchange started
Thu Aug 18 14:48:31 BST 2011
Toolchange ended
Thu Aug 18 14:48:37 BST 2011
Stopped machining
Thu Aug 18 14:48:43 BST 2011


regards
#!/bin/bash

## writes a log based upon gcode calls to M120 n
## where n = the occurence to be logged

if [ ! $# -ge 1 ]; then
  echo "Usage: M120 n - where n log entry type num"
  exit 1
fi

float=$1
int=${float/\.*}

case $int in

    1 ) echo "Started machining" > ~/emc2/logfile
        date >> ~/emc2/logfile;;


    2 ) echo "Toolchange started" >> ~/emc2/logfile
        date >> ~/emc2/logfile;;


    3 ) echo "Toolchange ended" >> ~/emc2/logfile
        date >> ~/emc2/logfile;;


    4 ) echo "Stopped machining" >> ~/emc2/logfile
        date >> ~/emc2/logfile;;

esac

exit 0
The following user(s) said Thank You: +Jan+

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

Time to create page: 0.077 seconds
Powered by Kunena Forum