MPG with Mach3 using mach3 controls
Moderators: TomKerekes, dynomotion
MPG with Mach3 using mach3 controls
So I have been using my kflop for several years now with Mach3 and it still works great, the one thing I miss is my MPG Pendant, it worked with Mach3 though modbus which wont work so well with kflop. So I did a bit of rewiring in the MPG and brought the encoder lines out and connected them to Encoder Channel 0 on JP7 and I can see the lines toggle though the kmotion app. Everything else on the pendant still works though modbus, start/stop/feedhold, FRO, axis select, units.
So my question is, how do I merge the existing mpg .c programs to take the axis and unit selections from Mach3?
-Jerry
Attached a copy of my init file to show where I stand setup wise.
So my question is, how do I merge the existing mpg .c programs to take the axis and unit selections from Mach3?
-Jerry
Attached a copy of my init file to show where I stand setup wise.
- Attachments
-
- InitStepDir3AxisSupermax2.c
- (7.42 KiB) Downloaded 100 times
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: MPG with Mach3 using mach3 controls
Hi Jerry,
The simplest thing would be to also wire the axis select and units to KFLOP as well and use the example: MPGServiceSmoothHardwareEncFilteredRev3.c
I suppose you could have Mach3 read those inputs and write them to Virtual Bits in KFLOP using a Macro Pump in Mach3 but that would be more complicated.
The simplest thing would be to also wire the axis select and units to KFLOP as well and use the example: MPGServiceSmoothHardwareEncFilteredRev3.c
I suppose you could have Mach3 read those inputs and write them to Virtual Bits in KFLOP using a Macro Pump in Mach3 but that would be more complicated.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: MPG with Mach3 using mach3 controls
That would mean I would have to buy a new pendant. The pendant has an internal microcontroller which reads the switch positions and sends that via modbus serial to mach3. I used up any extra wires routing out the encoder.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: MPG with Mach3 using mach3 controls
Maybe you could use a Mach3 Brain to read the Modbus bit and write it to a Mach3 Output Pin which is configured as a KFLOP Virtual Bit.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: MPG with Mach3 using mach3 controls
Would there be a way to read whatever oem LED changes and whatever DRO handles the increment on the screen and feed that into kflop somehow?
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: MPG with Mach3 using mach3 controls
If you can read the increment you could write it to KFLOP using this method.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: MPG with Mach3 using mach3 controls
Looks like I can read DRO 828 to get that info. OEM Leds 400,402,404,406,408,410 for Axes X,Y,Z,A,B,C.
How would I pass LEDs? same way?
-Jerry
How would I pass LEDs? same way?
-Jerry
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: MPG with Mach3 using mach3 controls
Yes you might check the LEDs and determine the Axis number and pass that number in the same way.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: MPG with Mach3 using mach3 controls
So I can do something like this in Mach
GetOEMDRO(828) 'Put a value in a Mach DRO
NotifyPlugins(19007) 'Send it to KFLOP
GetOEMLED(400)
NotifyPlugins(19008)
And so on...
And then in the notify program:
#include "KMotionDef.h"
#define DROIN 7
#define LEDIN 8
main()
{
do stuff
}
GetOEMDRO(828) 'Put a value in a Mach DRO
NotifyPlugins(19007) 'Send it to KFLOP
GetOEMLED(400)
NotifyPlugins(19008)
And so on...
And then in the notify program:
#include "KMotionDef.h"
#define DROIN 7
#define LEDIN 8
main()
{
do stuff
}
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: MPG with Mach3 using mach3 controls
Hi Jerry,
I believe:
Gets the increment but doesn't put it anywhere. I think you would need something like:
You would need to do something similar with the LEDs. I was thinking that sending the axis number would be more efficient. Something like
HTH
I believe:
Code: Select all
GetOEMDRO(828) 'Put a value in a Mach DRO
Code: Select all
Increment = GetOEMDRO(828) 'Get Increment
SetOEMDRO(1007, Increment) ' put it in User DRO 7
NotifyPlugins(19007) 'Send it to KFLOP
Code: Select all
If (GetOEMLED(400) = 1) Then Axis = 0
else If (GetOEMLED(401) = 1) Then Axis = 1
else If (GetOEMLED(402) = 1) Then Axis = 2
else If (GetOEMLED(403) = 1) Then Axis = 3
else Axis = 4
SetOEMDRO(1008, Axis) ' put it in User DRO 8
NotifyPlugins(19008) 'Send it to KFLOP
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.