question about changing parameters with macro

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

question about changing parameters with macro

Postby terastios » Sun Jan 19, 2020 1:45 pm

hello
I would like to make a macro for index homing
in order to do this i thought to change the homing pin to the index pulse
in order to do this i am going to use the Writekey()
Example: exec.Writekey(""axessettingscontrolX","Homepinnumber", "15");
witch changes the profile settings and then saves it with button function 167 "Savesettings Saves all settings to the profile file"
or button function 168 "Apply settings Applies the settings on the setup screens"
by Callbutton()
Example: exec.Callbutton(167); or exec.Callbutton(168);
the other way around maybe is the Setfield()
i dont know if this is going to work but i need to make tests

the question is:
is there any problem rewriting the "default.pro" and saving the settings or applying settings a lot of times within the motion controller?
is it writing in any kind of eeprom that has limited writes and will cause problems to the future?
the controller I am going to use is a UC100 and a AXBB-E


Thank you in advance
terastios
 
Posts: 2
Joined: Sun Jan 19, 2020 1:11 pm
Location: Greece

Re: question about changing parameters with macro

Postby dezsoe » Mon Jan 20, 2020 9:49 am

You can change your settings with AS3.Setfield/AS3.Setfieldtext/AS3.Setcheckboxstate and then you have to apply or save the settings. Save will first apply, so you don't have to call both. However, you have to keep in mind that:
- you must not call this macro from g-code
- you have to wait for apply/save to finish before you do anything

To wait for finishing the apply/save use the code below:

Code: Select all
  exec.Callbutton(167);
  while (AS3.Getbuttonstate(167));

Writing the profile (exec.Writekey) will take effect only on next load of UCCNC.

The motion controller does not save any of your settings, so you may change them anytime.
dezsoe
 
Posts: 1093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: question about changing parameters with macro

Postby terastios » Mon Jan 20, 2020 4:51 pm

Thank you very much for the fast reply :D :D :D :D

This is going to be a homing routine and there are going to be extra limit switches just in case an index signal wont show up
so it is not going to run on a g-code program :shock:

I am also going to take your advise using
Code: Select all
exec.Callbutton(167);
  while (AS3.Getbuttonstate(167));


:D :D :D

Thanks again
terastios
 
Posts: 2
Joined: Sun Jan 19, 2020 1:11 pm
Location: Greece

Re: question about changing parameters with macro

Postby Battwell » Sat Jan 25, 2020 9:53 am

why shouldnt this macro be called by g code? i have my m6 & m3 macros swapping parameters for laser/router usage and it seems to work ok.
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 541
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: question about changing parameters with macro

Postby dezsoe » Sat Jan 25, 2020 10:17 pm

What is your UCCNC version?
dezsoe
 
Posts: 1093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest