Hello Guest it is April 25, 2024, 10:29:41 PM

Author Topic: Keyboard enabled on startup?  (Read 956 times)

0 Members and 1 Guest are viewing this topic.

Keyboard enabled on startup?
« on: September 16, 2023, 09:35:09 AM »

i have been trying for a few weeks now to get jogging enabled when Mach4 starts up. I have edited, remmed out, remmed in almost everything i have seen and read on the internet. Nothing seems to work but here's the wierd thing. In my lathe profile it works just fine. In my mill profile it does not. The button toggles and goes green but the arrow keys will not jog the machine. Clicking the enable button disables. Clicking again enables and the machine moves on arrow key presses.

Here is what I have right now.
-------------------------------------------------------
--  PLC First Run
-------------------------------------------------------
if (testcount == 1) then --Set Keyboard input startup state
    --local iReg = mc.mcIoGetHandle (inst, "Keyboard/Enable")
    --mc.mcIoSetState(iReg, 1) --Set register to 1 to ensure KeyboardInputsToggle function will do a disable.
    KeyboardInputsToggle()
   
Here is something I noticed.

Load Mach4 - Click Enable - no DRO movement with arrow buttons - Click disable - click operator - click edit screen - click edit screen again to uncheck - screen loads and arrow buttons will move DRO's

So what is different from Mach4 loading new and Mach4 loading after edits? Is there something more going on after a screen edit that is making the keyboard work that doesn't happen when starting up Mach4?

Has anybody successfully made Mach4 jog on startup in a mill profile? If so, how did you do it? What am I missing?
Re: Keyboard enabled on startup?
« Reply #1 on: September 18, 2023, 08:58:35 PM »
From the amount of replies I'm guessing it's not possible to enable jogging on startup.

GOOMBA

*
Re: Keyboard enabled on startup?
« Reply #2 on: September 19, 2023, 01:54:59 PM »
If you private message me I will tell you how to do this another way.

I won't post it here as it's a concern of safety, say you have machine enable assigned to spacebar. You also have jogging on your arrow keys.

You had set a book on the keyboard last night, now this morning you start up the machine without removing the book.

Now you decide to walk to the torch and swap the consumables while MACH boots.
Well the keyboard plugin doesn't know that, and since the book pressed the space and arrow keys and kept them held, well. It might not be a pretty sight for operator or machine.
I hope this helps, and I do understand the want for this. It's just dangerous.