Writing to field on Jog screen

This is where you talk about Plugins. How they are made and how they work, show examples.

Writing to field on Jog screen

Postby ger21 » Wed Dec 29, 2021 2:35 pm

I'm saving my jogging values to the profile with M99999,
And I want to load them using a VB plugin, but it doesn't seem to work.
Using this code:

Code: Select all
keystring = UC.Readkey("2022_Jog_Speeds", "913", "False") '// Jog Speed %
        If keystring = "" Then
            UC.Setfieldtext(True, "10", 913) : UC.Validatefield(True, 913)
        Else
            UC.Setfieldtext(True, keystring, 913) : UC.Validatefield(True, 913)
        End If

        keystring = UC.Readkey("2022_Jog_Speeds", "2027", "False") '// Jog Distance
        If keystring = "" Then
            UC.Setfieldtext(True, "0.001", 2027) : UC.Validatefield(True, 2027)
        Else
            UC.Setfieldtext(True, keystring, 2027) : UC.Validatefield(True, 2027)
        End If


Is there way to specify AS3Jog in a plugin, or is it something else? Thanks.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing to field on Jog screen

Postby eabrust » Wed Dec 29, 2021 8:14 pm

Gerry, you're close, change the 'true' to 'false' in the setfieldtext call:

Code: Select all


        If keystring = "" Then
            UC.Setfieldtext(False, "10", 913) : UC.Validatefield(True, 913)
        Else
            UC.Setfieldtext(False, keystring, 913) : UC.Validatefield(True, 913)
        End If



I just made the above change and tested it quick.

regards,
Eric
CraftyCNC: Plugins for UCCNC (and other neat stuff): http://www.craftycnc.com/plugins-for-uccnc/
eabrust
 
Posts: 357
Joined: Fri Sep 16, 2016 2:32 am
Location: Near Shirland IL, USA

Re: Writing to field on Jog screen

Postby ger21 » Wed Dec 29, 2021 10:42 pm

Damn. I tried that, but I set the Validate to false as well.
I found one little line in Robert's manual that mentioned not true was for the jog screen.

Thanks.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing to field on Jog screen

Postby ger21 » Thu Dec 30, 2021 3:17 am

Next question.
How to get the Button State of a button on the jog screen?

Code: Select all
Dim Btnstate1 As Boolean = UC.Getbuttonstate(161)
Dim Btnstate2 As Boolean = UC.Getbuttonstate(162)
MsgBox(Btnstate1)
MsgBox(Btnstate2)


These always return False? (They are both Toggle Type)
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing to field on Jog screen

Postby ger21 » Thu Dec 30, 2021 3:32 am

Answering my own question, use this instead:

Code: Select all
Dim Btnstate1 As Boolean = UC.GetLED(145)
Dim Btnstate2 As Boolean = UC.GetLED(146)
MsgBox(Btnstate1)
MsgBox(Btnstate2)
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am


Return to Plugins

Who is online

Users browsing this forum: No registered users and 5 guests