Page 1 of 1
Can THC min be set in text field?

Posted:
Sat Feb 19, 2022 9:10 pm
by tomsmith
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);
}
Re: Can THC min be set in text field?

Posted:
Sun Feb 20, 2022 10:52 pm
by Robertspark
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.
Re: Can THC min be set in text field?

Posted:
Mon Feb 21, 2022 11:37 am
by tomsmith
Working now, thanks Robert