Page 1 of 1

Re: DRO for Requested tool

PostPosted: Thu May 10, 2018 1:21 pm
by dezsoe
You can find it in:

Code: Select all
int NewTool = exec.Getnewtool();

If it is -1 then M6 was called without T parameter. You can copy it to a user DRO, if needed.

Re: DRO for Requested tool

PostPosted: Thu May 10, 2018 5:13 pm
by kig23
Hi Terry, i don't think you need a macroloop. Just use something like this :
Code: Select all
int newTool = exec.Getnewtool();
if (!exec.Ismacrostoped())
{
   AS3.Setfield (Conver.ToDouble(newTool), int fieldnumber);
   AS3.Validatefield(int fieldnumber);
}
else
{
   return;
}


in M6 macro to update the user DRO value every time you use M6 command.

Re: DRO for Requested tool

PostPosted: Thu May 10, 2018 5:46 pm
by dezsoe
If you have a prestage macro, why don't you give a parameter to it?

Code: Select all
M66 P<tool>

Re: DRO for Requested tool

PostPosted: Thu May 10, 2018 5:57 pm
by kig23
You can create a custom LoadFile button that executes a macro. Inside the macro :
1. First read the file to by loaded and get all prestage tools values (M66 ( Prestage Tool)) in order, then create an array or you can use uccnc user variables to store that data.
2. Load the file.
and you have all prestage tools values in advance. Maybe i'm missing something, It's just an idea.

Re: DRO for Requested tool

PostPosted: Thu May 10, 2018 5:58 pm
by dezsoe
I made a quick test, and M66 can use the Getnewtool() function, so the example g-code that you wrote works!

Code: Select all
// M66
int NewTool = exec.Getnewtool(); // -1 -> nem volt T!
string NewToolName =
  "T" + NewTool + " " + ((NewTool > 0) ? exec.Readkey("Tooltablevalues", "Description" + NewTool.ToString(), "") : "No tool");
if (NewToolName == "") NewToolName = "T" + NewTool + "?";
AS3.Additemtolistbeginning("Insert " + NewToolName, 2);

Re: DRO for Requested tool

PostPosted: Fri May 11, 2018 9:46 am
by kig23
Vmax549 wrote:Yes I can program UCCNC to provide it but I should not have to as then it only works for me in this application. It does nothing for other users that could use it as well.


Hi Terry,
i appreciate your desire to help others, but you can write a macro with your solution and then post it. This way the people can use it and if they need can make some changes. Maybe i'm wrong but UCCNC gives you all the tools that you need to implement this method. Am i missing something?