Hello Guest it is March 28, 2024, 04:27:42 PM

Author Topic: Add Cont-Step-MPG Leds to Cntrl Pnl.  (Read 4843 times)

0 Members and 1 Guest are viewing this topic.

Offline johnv

*
  •  43 43
    • View Profile
Add Cont-Step-MPG Leds to Cntrl Pnl.
« on: June 05, 2010, 04:29:20 PM »
Hi All,
I put a momentary switch (OEM Code 245) on my control panel to toggle thru Cont, Step, MPG modes.  I would like to add a LED for each position so I know where I am after a toggle, but don't know how.   I think the OEMLeds are 14, 15, 57.  All help would be appreciated.
Johnv

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #1 on: June 06, 2010, 02:39:55 AM »
Hi Johnv,

I agree with the OEMLed values you have shown.
I use Screen4 and LED's are added and defined in exactly the same way as you have added the momentary switch so I don't quite see where the problem lies.

Tweakie.
PEACE

Offline johnv

*
  •  43 43
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #2 on: June 06, 2010, 09:11:31 PM »
I think that is the way they are added to a screen, but doesn't a real life LED need an Output to sense when the screen LED went on to turn the real life LED on?

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #3 on: June 07, 2010, 06:16:23 AM »
Think I misunderstood the original question.  :-[

If you are using physical led's on a physical control panel then yes you will need an output to turn them on.
There is more than one way of doing this but Using VB the Jog Cont led can be detected with GetOemLed(14) and output #1 can be turned on with ActivateSignal(Output1). Obviously you would need to assign an output for each LED.
So something like:-

If GetOemLED(14)=True Then
ActivateSignal(Output 1)
Else DeActivateSignal(Output 1)
End If

Could be used for each virtual LED you wish to detect and physical LED you wish to switch.

Does this help ?

Tweakie.
« Last Edit: June 07, 2010, 06:19:53 AM by Tweakie.CNC »
PEACE

Offline johnv

*
  •  43 43
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #4 on: June 07, 2010, 10:01:38 AM »
Thanks Tweakie.CNC, How or where do I attach the VB to Mach3?

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #5 on: June 07, 2010, 11:25:24 AM »
How have you connected and programmed your physical momentary switch to perform the DoOemButton(245) function ?.

Tweakie.
PEACE

Offline johnv

*
  •  43 43
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #6 on: June 07, 2010, 12:36:49 PM »
I checked port 2 pin 13 in Ports & Pins/Input Signals screen and SystemHotkeys/TriggerOEMCode 13 to 245.

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #7 on: June 08, 2010, 03:30:33 AM »
Hi Johnv,

You need to create a 'set trigger macro' (OEM 301) containing the VB LED detection and output switching code plus DoOemButton(245) to trigger the jog mode toggle. (with a bit of ingenuity you could multiplex two outputs to control three LEDs to save on outputs here) and set your hotkey trigger for pin 13 to 301.

Brian has described the whole process, better than I can, in this thread  http://www.machsupport.com/forum/index.php/topic,918.0.html

Tweakie.


PEACE

Offline johnv

*
  •  43 43
    • View Profile
Re: Add Cont-Step-MPG Leds to Cntrl Pnl.
« Reply #8 on: June 08, 2010, 08:37:56 AM »
Thanks again Tweakie. I will work on this.
Johnv