Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: Kissling on September 11, 2023, 07:59:13 AM
-
Hello
I'm optimizing my Screenset.
The Basis of my Sreenset is from PA.
But I did so many imprvements and Errorcorections.
Now I try to build a button where set the x-coordinate an then the Spindle goes to this coordinate.
Simply: Goto X Goto Y Goto Z
Im try to do this with machsreen.
My question is:
How can I build a Button that reads the valeu and then executes a VB-Script where i can Use the value?
I only find something where I can define the Value and something where I can execute Code.But I need a Button whitch is dooing both!
Thanks a lot
-
you can use a Button Standard code 34 -> run basic script
then you can program your own VB-Script within this button.
-
Thanks to TPS
But than I have to Insert 2 thinks.
one to write the value
and
as you wrote
one for executing the script
I there no way to way to get this:
write the value in the feeld
by pressing Enter the macro is executed
Regards
-
[1] first select function - execute basic script
[2] doubleclick execute Code value, then editor for basic script is comming up
and now you can proramm your basic code to enter the value and execute G-code
-
Hello TPS,
this is all no problem!
My Problem is:
How can i execute the basic Sript when I write a new value to the UserDRO?
Do I have to design a UserDRO AND a Button?
Regards
-
put a transparent button above the DRO
this is just a simple example how you can do it:
Dim DROValue As String
DROValue = AskTextQuestion("Please enter new Value:")
SetOEMDRO(800,CDbl(DROValue))
Message "Hello you entered , " & DROValue & " into DRO800!"
if you do a search for "simple numeric keyboard" you will find a code snipped i have posted years ago witch is an
other solution
-
Thanks a lot for this solution.
Works well.
But I try to find a solution where no "AskTextQuestion" is used to enter the value.
I try to find a way where i can write the value in the DRO-Feld and the macro is executed when pressing Enter
Maybe there is another way?
Grüße aus Bayern nach Bayern :-)
-
there is no "direct" way to do this, because the is no "event driven" input possibility for screen's.
a work arround would be to use the macropump macro, with is running as a background task, do
do this.
example:
-use in screenset OEMDro(1300) to change a value
-in macropump check OEMDro(1300) cyclic and if it has changed exceute code
example for macropump code:
'check OEMDro(1300) for change
If (GetOEMDro(1300)<>GetOEMDro(1301)) Then
'put here the code witch should be exceuted
Message "i was here"
End If
'save OEMDro(1300) for next cyclic change
SetOEMDro(1301,GetOEMDro(1300))
Gruß Tom.
Ich schreibe das hier in Englisch, nun ja in meinen bayrischen Englisch,
das es für die Anderen lesbar bleibt.