Author Topic: Brains for Custom Control Panel - Continuous Jog/"States" Question  (Read 2873 times)

0 Members and 1 Guest are viewing this topic.

Offline adage

  • Holding
  • Posts: 2
    • View Profile

I am working on a custom modbus control panel that will use Mach3.  I am trying to write some brains so that specific switches on the control panel will given specific commands in Mach3, however I am running into some issues:

1) Continuous Jog – "X+"
I tried mapping a switch to OEM Code 307 (307-Jog X - right) to simulate the Mach3 "X+" button in the Tab Screen (Jog Selection).  The function that I want to simulate is when the button is clicked and held, the machine jogs, and when you let go of button, the machine stops.

The issue I am running into is that when I press the switch on the control panel, it will still move in the direction even though I let go.  When I press the button itself again, it stops.  This issue is also occurring for the “X-“ button.  In the Incremental Jog, the switches work.

2) "States"
I am trying to figure out how to define certain "states" of a variable.  I have three (3) switches on the control panel for MPG, JOG, and INC JOG.  The functional idea is the following:
  a) If any of the buttons are pressed, turn Jog Mode On
  b) Be able to switch freely between the jog modes.
  c) When the button itself is pressed (e.g. MPG is on and MPG is pressed), it will turn Jog Mode Off.
How would I be able to define (and modify) a “State” (e.g., storing a value to see if Jog Mode is On or Off) in brains to be in order to be able to implement this feature?

Thank you

Offline zafarsalam

  • Active Member
  • Posts: 324
    • View Profile
Re: Brains for Custom Control Panel - Continuous Jog/"States" Question
« Reply #1 on: March 31, 2012, 08:32:29 AM »
I find it more convenient to use keyboard emulators for function switches on a control panel. Just rip open a USB keyboard, pull it's card out and map it's pins with keytest software. Get the connector combinations for the arrow keys and hook them to my axis jog buttons. I use function keys F1, F2 etc. for other keys and program them in the screen designer or use the keygrabber if I want to use the original 1024 screenset. Complex functions such as homing etc. are accessed by assigning macros to keys.