Toolchange message

Post anything you want to discuss with others about the software.

Toolchange message

Postby Mark81 » Thu Jul 04, 2019 2:41 pm

Hi, I searched in the old posts but I cannot find anything related. Perhaps I'm using the wrong keywords.
I want to display a messagebox every time a toolchange command is executed, reading the text in the gcode itself.
Of course I will configure the post processor to include a comment right before (or after) the M6 Tx instruction.

This would be very useful to me for a couple of reasons:

1. instead of manually looking at the gcode to remember what is the next tool to mount, it would be clearly stated in the message box (i.e. "Insert tool #3: 3 mm Z2 end-mill down-cut")
2. for some special application the toolchange instruction is just a way to let the operator to do some other operations (i.e. "Please, do this and that", or "Go ahead or end the job?")

Is it possible to read a comment on the line before (or after) the toolchange instruction and display a message box with that text?
Mark81
 
Posts: 42
Joined: Thu Feb 14, 2019 4:38 pm

Re: Toolchange message

Postby Vmax549 » Thu Jul 04, 2019 4:18 pm

Look in teh UCCNC tool box first line M56.

There are also many other ways to do it as well. But that one is an easy way. Note teh version number needed for it to work.

(;-) TP
Vmax549
 
Posts: 331
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Toolchange message

Postby Dan911 » Thu Jul 04, 2019 4:27 pm

Keeping it even simpler would be adding a MessageBox to the start of your M6 macro, the Gcode would be paused where tool# is easily readable.
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Toolchange message

Postby Mark81 » Thu Jul 04, 2019 4:57 pm

Vmax549 wrote:Look in teh UCCNC tool box first line M56.


I'm sorry, what is the "tool box"? I looked in the Profiles folder for macro M56 but I don't have it.
Perhaps I didn't understand what you suggested :?
Mark81
 
Posts: 42
Joined: Thu Feb 14, 2019 4:38 pm

Re: Toolchange message

Postby Vmax549 » Thu Jul 04, 2019 5:05 pm

I believe he was wanting teh CAM to be able to POST the message and for UCCNC to be able to read it. BUT I could be wrong.

To use teh M6 method you would have to coordinate BOTH tool tables (Cam & UCCNC). Then UCCNC would have to be able to READ teh tool table to get description, etc. I dont think that currently works in UCCNC. You could read the desciption from teh PRO file BUT it may or may not be up to date.

I did do a function where teh CAM wrote teh CAM tool data to teh Gcode file and UCCNC used that to program teh UCCNC tool table on teh fly.

Like I said there are many ways to do it.

(;-) TP
Vmax549
 
Posts: 331
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Toolchange message

Postby Vmax549 » Thu Jul 04, 2019 5:07 pm

The UCCNC Tool Box is on teh UCCNC website down near teh bottom of teh list of discussion topics.

(;-) TP
Vmax549
 
Posts: 331
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Toolchange message

Postby Mark81 » Thu Jul 04, 2019 5:16 pm

Vmax549 wrote:I believe he was wanting teh CAM to be able to POST the message and for UCCNC to be able to read it. BUT I could be wrong.

To use teh M6 method you would have to coordinate BOTH tool tables (Cam & UCCNC). Then UCCNC would have to be able to READ teh tool table to get description, etc. I dont think that currently works in UCCNC. You could read the desciption from teh PRO file BUT it may or may not be up to date.


Yes, but on the CAM side I have no problem at all. Example:

Code: Select all
G21 G90 G64 G40
G0 Z3.0
( T2 : 2.0 mm ball-nose)
M6 T2
...


I would to read, in the M6 macro, the line before M6 Tx and display a message with the content of that line: "T2 : 2.0 mm ball-nose".
No needs to sync the tool-table.
Mark81
 
Posts: 42
Joined: Thu Feb 14, 2019 4:38 pm

Re: Toolchange message

Postby Mark81 » Thu Jul 04, 2019 5:20 pm

Vmax549 wrote:The UCCNC Tool Box is on teh UCCNC website down near teh bottom of teh list of discussion topics.


Found!
I'm reading the M56 macro code right now.
Mark81
 
Posts: 42
Joined: Thu Feb 14, 2019 4:38 pm

Re: Toolchange message

Postby Vmax549 » Thu Jul 04, 2019 5:56 pm

The M56 macro normally sends teh Message to teh Status line BUT you can change it to display teh message in a MessageBox with options as to how to proceed (ok,cancel,exit,etc)

As I don't think UCCNC has a global text variable for teh M6 to get access to teh message BUT you COULD write teh message to a label on screen and then read it into teh M6 macro as needed.

Just a thought for one way t do it.

(;-) TP
Vmax549
 
Posts: 331
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Toolchange message

Postby Mark81 » Thu Jul 04, 2019 6:31 pm

Well it was very easy indeed. Basic example as starting point:

Code: Select all
// in M6 macro
int lineNo = exec.Getcurrentgcodelinenumber();
string myLine = exec.Getgcodelinetext(lineNo - 1);
MessageBox.Show(myLine);
Mark81
 
Posts: 42
Joined: Thu Feb 14, 2019 4:38 pm

Next

Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: Bing [Bot] and 10 guests