Can THC min be set in text field?

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

Can THC min be set in text field?

Postby tomsmith » Sat Feb 19, 2022 9:10 pm

hi guys, trying to set 3 values in macros, THC MIN, THC MAX and THC FEEDRATE, but are these internal variables that can't be changed with a set field,as I cant seem to get it working, code below:

{

AS3.Setfieldtext("222", 10);
exec.Wait(100);
exec.Callbutton(168);
exec.Wait(100);

}
tomsmith
 
Posts: 22
Joined: Wed Jan 19, 2022 2:33 pm

Re: Can THC min be set in text field?

Postby Robertspark » Sun Feb 20, 2022 10:52 pm

you have to validate the field too

Function: void Setfield(double value, int fieldnumber)

Description: This function sets the value of a field object. If the field exists on the screen on any tab pages then it will update it's value. If it does not exist then this function will do nothing.

Note that there are fields like the position DROs and feedrate, spindle speed etc. DROs which are updated in the UCCNC from internal variables in loops, these fields cannot be updated permamently using this method,

because the internal functions will rewrite these fields with the internal variable values. Call the Validatefield after the Setfield function to change the value of these kind of fields.

Example: AS3.Setfield(15.23, 100);



Function: void Validatefield(int fieldnumber)

Description: This function validates the value of a field object. If the field exists on the screen on any tab pages then the function executes. If it does not exist then this function will do nothing.

When this function is called then the field value changed event is called inside the UCCNC core and the software will make the actions nessessary to validate the actual value of the field.

Example: AS3.Setfield(12.34, 97); //Sets the value of the X current coordinate field to 12.34

AS3.Validatefield(97); //Validates the 12.34 valuefor the X current coordinate field with writting the offset coordinates as nessessary.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Can THC min be set in text field?

Postby tomsmith » Mon Feb 21, 2022 11:37 am

Working now, thanks Robert
tomsmith
 
Posts: 22
Joined: Wed Jan 19, 2022 2:33 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest