Page 1 of 1

Retaining custom textfield data between UCCNC sessions

PostPosted: Thu Jul 06, 2017 12:09 am
by CNC22369
I would like to add some Textfields to my screenset to hold some data specific to my application. As a test, I added a couple of Textfield objects (type textfieldnb) to my screenset --- they work fine except that the data I enter during a session is not retained so that it is already there when I later start another UCCNC session. I've tried invoking Save Settings before exiting, but it had no effect. So, is there a way to cause data entered in a custom Textfield to be saved for a later session? If not, is this a change you would consider making to UCCNC?

Frank

Re: Retaining custom textfield data between UCCNC sessions

PostPosted: Thu Jul 06, 2017 12:24 am
by ger21
It is actually saved to your profile, if you are using the current release version. If you open the .pro file in Notepad, you should see the saved data at the end of the file.

In order to load the values when you restart UCCNC, you need to use the Constructor macro (M99998.txt)
Here's some sample code that i use for field #20342:

readfield = exec.Readkey("UserTextfields", "20342", "0.000");
AS3jog.Setfieldtext(readfield, 20342);


You need to do this for each field.

Re: Retaining custom textfield data between UCCNC sessions

PostPosted: Thu Jul 06, 2017 2:05 am
by CNC22369
Gerry, thank you for the solution information and your time to post it. Using it I was able to get my test example to work correctly.

Frank