Page 1 of 1

Writing to field on Jog screen

PostPosted: Wed Dec 29, 2021 2:35 pm
by ger21
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.

Re: Writing to field on Jog screen

PostPosted: Wed Dec 29, 2021 8:14 pm
by eabrust
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

Re: Writing to field on Jog screen

PostPosted: Wed Dec 29, 2021 10:42 pm
by ger21
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.

Re: Writing to field on Jog screen

PostPosted: Thu Dec 30, 2021 3:17 am
by ger21
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)

Re: Writing to field on Jog screen

PostPosted: Thu Dec 30, 2021 3:32 am
by ger21
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)