Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: lfleiva on August 26, 2010, 09:20:43 PM
-
Hi!
I want to detect when a jog system keystroke was pressed in order to run a macro before the actual jog is performed for security reasons.
In other words: run a script when a certain keyboard keystroke used as hotkey was made.
Is this possible?
Thanks!
Luis
-
setup a brain that maps all the jog buttons to a user led, say 1010. on your vb you can do something about it, i'm sure.
a = getuserLED(1010)
if (a = 0) then..
else..
end if
-
Not sure if you can actually do anything before it jogs, though??
-
Yes you can do it how your talking about, in a round about way........
Put the VB code in the Jog Buttons you want to watch in screen designer, including the DoOEMButton code for the jog button so it all runs in VB.
you can still set a "HOT KEY" that will activate the button itself.
OR, if you want to execute the SAME security check on multiple jog buttons, I would then make your self a "Security Check" macro.
i.e.
' M1001.m1s
' Security Check Macro
' /// your security check macro code here ///
' end of macro
Then again in your Jog buttons that your watching, there is a Radio button that you tick in screen designer 3 and 4, or (my preference Mach Screen by Klaus), you add all the VB code in the button. NOTE: you can find the Mach Specific VB codes for Buttons, LEDs, and DROS on the Wiki, Ray's stuff, in the Memeber docs is some of mine, and I believe several other people have posted various compliations......... I think the Wiki has the VB organized in USE types, i.e. all buttons together, all LEDs together etc.
scott
-
>Put the VB code in the Jog Buttons you want to watch in screen designer, including the DoOEMButton code for the jog button so it all runs in VB.
>you can still set a "HOT KEY" that will activate the button itself.
I'll try that.
Thanks for all the replies!
Luis