Page 1 of 1

Send key presses to MPU from PLC code

Posted: Mon Apr 26, 2021 4:27 am
by ashesman
I think I know the answer is no, but is it possible to send any key press from PLC logic to MPU11?

I know MPU sends key presses to PLC logic. There is the Aux1-12 functions that can be triggered by the PLC to do a few different actions, but none that are sending a key press. Then there are the SV_PLC_FUNCTION_x variablees but again, only a limited set of pre-configured functions.

I have done most of my PLC control functionality now but are stuck on this one. I have an F8 key on my jog panel as I want to switch to/from the plot screen, but not sure how to make it work. I also have a Set X0, Set Y0, Set Z0 keys to sort out to but I see they can be done through the aux functions.

Re: Send key presses to MPU from PLC code

Posted: Mon Apr 26, 2021 12:07 pm
by cncsnw
Do you mean MPU11 (the control firmware running on your Oak or Allin1DC unit), or do you mean CNC12 (the user interface software running under Windows on your PC)?

Since you are asking about the F8 key to call up the Graph display, I assume you want to send key events to Windows and/or CNC12.

There is currently no mechanism to do that.

Re: Send key presses to MPU from PLC code

Posted: Mon Apr 26, 2021 1:19 pm
by tblough
You would need a keyboard emulator that takes an external switch closure and sends an F8 keyboard character to Windows.
Something like this: https://www.sorion-group.com/products/p ... xis-kbdem/

Re: Send key presses to MPU from PLC code

Posted: Tue Apr 27, 2021 3:26 am
by ashesman
cncsnw wrote: Mon Apr 26, 2021 12:07 pm Do you mean MPU11 (the control firmware running on your Oak or Allin1DC unit), or do you mean CNC12 (the user interface software running under Windows on your PC)?

Since you are asking about the F8 key to call up the Graph display, I assume you want to send key events to Windows and/or CNC12.

There is currently no mechanism to do that.
Yes, sorry I meant CNC12. It was getting late!!!

Re: Send key presses to MPU from PLC code

Posted: Tue Apr 27, 2021 3:29 am
by ashesman
tblough wrote: Mon Apr 26, 2021 1:19 pm You would need a keyboard emulator that takes an external switch closure and sends an F8 keyboard character to Windows.
Something like this: https://www.sorion-group.com/products/p ... xis-kbdem/
Yeah, something like that would work but probably not worth it for just an F8 key. Shame Centroid didn't tell me it couldn't be done when they printed it on the button panel for me but...

I could make a device like you mentioned in a few hours using a microcontroller dev kit. So if I decide I really need it going I will knock something up...

Re: Send key presses to MPU from PLC code

Posted: Thu May 06, 2021 4:22 am
by ashesman
So, I found a workaround for this...

Using the Centroid Skinning DLL, it is possible to create a service that watches the state of PLC memory bits. If it detects a change, then using Windows API calls it is trivial to trigger a key press on a running application. I tested sending of key presses to other applications, just need to do the code for the skinning DLL. Never enough time...