Hello Guest it is April 25, 2024, 02:57:49 AM

Author Topic: How do I detect a jog system hotkey was pressed?  (Read 3970 times)

0 Members and 1 Guest are viewing this topic.

How do I detect a jog system hotkey was pressed?
« 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
Re: How do I detect a jog system hotkey was pressed?
« Reply #1 on: August 31, 2010, 03:40:32 PM »
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

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: How do I detect a jog system hotkey was pressed?
« Reply #2 on: August 31, 2010, 04:12:28 PM »
Not sure if you can actually do anything before it jogs, though??
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: How do I detect a jog system hotkey was pressed?
« Reply #3 on: September 03, 2010, 09:24:31 AM »
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



fun times
Re: How do I detect a jog system hotkey was pressed?
« Reply #4 on: September 04, 2010, 12:16:55 PM »
>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