Preset buttons for feedrate

If you created a new screenset and want to share it with others then please post it here. You can talk about screens here.

Preset buttons for feedrate

Postby Algone » Fri Jul 12, 2024 6:46 pm

Hi everyone,
I'm new on UCCNC, I was on Mach3 before, I'm looking to create several buttons to control the "feedrate", 10%, 25%, 50% and 75%. On Mach3 I succeeded thanks to a script but I don't understand how to do it on UCCNC.
Does anyone have the solution?

Alex
Algone
 
Posts: 11
Joined: Thu Jun 20, 2024 10:23 pm

Re: Preset buttons for feedrate

Postby cncdrive » Sat Jul 13, 2024 4:57 pm

You can write into the DRO using AS3.Setfield( number, fieldnumber); and then AS3.Validatefield(fieldnumber);

First make some buttons using the screen editor, edit the button number to in the range of 20000 to 21999 and then create a macro file with the same number in the Profiles/Macros folder and edit the file using a text editor like Notepad and then add the code to it.
Then pressing the button will call the same number of macro as the buttonnumber parameter of the button on the screen.
If the script has an error then you can see the compiler's error message in the same folder in the Errorlog.txt file.
cncdrive
Site Admin
 
Posts: 4980
Joined: Tue Aug 12, 2014 11:17 pm

Re: Preset buttons for feedrate

Postby Algone » Sat Jul 13, 2024 7:37 pm

Thank you very much but I didn't succeed.
I created the button:
bouton.JPG

I created the macro "M20001.txt" in the "Profiles/Macro_Default" folder, I entered the two lines:
AS3.Setfield(20001, 010);
AS3.Validatefield(010);

What did I do wrong?
Algone
 
Posts: 11
Joined: Thu Jun 20, 2024 10:23 pm

Re: Preset buttons for feedrate

Postby cncdrive » Sun Jul 14, 2024 2:38 am

You mixed up the 2 parameters, the 2nd parameter should be the fieldnumber 20001 and the first one should be the value 10 in your case.
the second problem is 010 is not a valid number, 10 is a number.
If you want to add text strings like 010 you can do that, then you have to use the Setfieldtext( "string" , fieldnumber); function and use the Validatefield after that the same way.
cncdrive
Site Admin
 
Posts: 4980
Joined: Tue Aug 12, 2014 11:17 pm

Re: Preset buttons for feedrate

Postby Algone » Sun Jul 14, 2024 4:34 pm

In fact, I understood it backwards. :oops:
I just fixed it but nothing happens when I press the button, not even an error message.
What I don't understand is how UCCNC knows that the button corresponds to the feedrate % ?
In Mach3 "SetDRO(21,50)", 21 was the number corresponding to the % feedrate.
Sorry as you will have understood, I'm trying to understand but I don't have enough experience.
Algone
 
Posts: 11
Joined: Thu Jun 20, 2024 10:23 pm

Re: Preset buttons for feedrate

Postby cncdrive » Mon Jul 15, 2024 9:49 pm

It works the same in UCCNC, you have to lookup the DRO number you want to change and change it with Setfield and then validate the new value for the UCCNC using the validatefield function.
You can look up the DRO number in the UCCNC/Documentation folder.
cncdrive
Site Admin
 
Posts: 4980
Joined: Tue Aug 12, 2014 11:17 pm

Re: Preset buttons for feedrate

Postby Algone » Mon Jul 15, 2024 11:11 pm

Thank you very much for your help, that's work fine, i understand better now. ;)
The number to set the % of feedrate is 232.
If anyone else is interested the macro (for 10%) is:

AS3.Setfield( 10, 232);
AS3.Validatefield(232);

I have a touch screen, the sliders do not work, I find it practical to have presets to reduce or accelerate the feedrate instantly.
Best regards

Alex
Algone
 
Posts: 11
Joined: Thu Jun 20, 2024 10:23 pm


Return to Custom Screensets

Who is online

Users browsing this forum: No registered users and 1 guest