Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Rimmel on July 17, 2024, 08:33:57 AM
-
Hi just converted from Mach3 to Mach4 Lathe. I tend to use G98 (feed per minute mode) unless threading.
In Mach3 there was an on screen indicator showing which mode you were in.
How can I emulate this in Mach4?
thanks
-
Additional - this is a problem because I can't seem to set G98 after a G76 threaafing cycle
e.g. In the Gcode below - if I enable the G98 call then the thread stalls at the start of the thread and won't move.
If I don't call it then it works fine HOWEVER then the mode remains set to G99 and not back to G98
G99 (Feed per Revolution)
G97 S500 (Constant Speed)
M03 (Spindle Forward)
M08 (Flood)
G00 X10.100
G00 Z10.100 (Rapid move to Clearance Height)
G76 P030060 Q0.01 R0.03 K2
G76 X9.02 Z-19.0 R0.0 P0.44 Q0.03 F0.75
G80
M5
M9
(G98)
-
Still for for an on-screen G99 G98 indicator - anyone?
thanks
-
Firstly, add this script to the PLC Script and add some LED's to the screen that are labeled however you want them labeled for G98 and G99.
Then Set the LED's appropriately to Output62 for G98 and Output63 for G99.
-------------------------------------------------------
--Custom Scripts
-------------------------------------------------------
--Feed Type: Per Min or Per Rev
local inst = mc.mcGetInstance()
local FeedType = mc.mcCntlGetPoundVar(inst, 4005)
local Out62 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT62)
local Out63 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT63)
if FeedType == 98 then
mc.mcSignalSetState(Out62, 1)
else
mc.mcSignalSetState(Out62, 0)
end
if FeedType == 99 then
mc.mcSignalSetState(Out63, 1)
else
mc.mcSignalSetState(Out63, 0)
end
--End Custom Scripts
-------------------------------------------------------
Secondly, the issue you're having with the threading cycle not working with the G98 at the end could be coming from the look ahead on the control.
Add a "/" on the G98 line: --> /G98
This forces the control to stop the look ahead at this point.
-
Firstly - thank you very much!!! Very much appreciated.
Secondly - It was the ESS causing the problem. I ditched it for a Pokeys57CNC and it is good now. Thank you for replying though.
** Edit - good tip about the look ahead though... another thing learned today. thank you
-
Firstly, add this script to the PLC Script and add some LED's to the screen that are labeled however you want them labeled for G98 and G99.
Then Set the LED's appropriately to Output62 for G98 and Output63 for G99.
-------------------------------------------------------
--Custom Scripts
-------------------------------------------------------
--Feed Type: Per Min or Per Rev
local inst = mc.mcGetInstance()
local FeedType = mc.mcCntlGetPoundVar(inst, 4005)
local Out62 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT62)
local Out63 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT63)
if FeedType == 98 then
mc.mcSignalSetState(Out62, 1)
else
mc.mcSignalSetState(Out62, 0)
end
if FeedType == 99 then
mc.mcSignalSetState(Out63, 1)
else
mc.mcSignalSetState(Out63, 0)
end
--End Custom Scripts
-------------------------------------------------------
Secondly, the issue you're having with the threading cycle not working with the G98 at the end could be coming from the look ahead on the control.
Add a "/" on the G98 line: --> /G98
This forces the control to stop the look ahead at this point.
Just popped back on to say... I tried the code and it works perfectly! - Thank you so much!!
It may sound a little thing but on that machine I do a lot of Dev stuff in Rev/MM mode. Not having a visual confirmation reference was driving me mad.
thanks again.
-
That's the beauty of Mach4. You can customize the screen almost anyway you'd like. Just get creative with how you display things. You can just change the status of the LED without using an output, but I don't know the code behind it right off, there are plenty of examples on here, but I know how to get the state of an output or an input simple enough and I can make the LED match that, so that is what I chose; besides, odds are you won't get to output 62 or 63 so who cares.
-
That's the beauty of Mach4. You can customize the screen almost anyway you'd like. Just get creative with how you display things. You can just change the status of the LED without using an output, but I don't know the code behind it right off, there are plenty of examples on here, but I know how to get the state of an output or an input simple enough and I can make the LED match that, so that is what I chose; besides, odds are you won't get to output 62 or 63 so who cares.
I don't suppose you know what var is used to store the current Feed setting e.g If I typed in G01 x3.0 F60 then mach3 showed you the current rate setting (with in mm per rev or mm per min.)
Mach4 shows tyou actual moving feedrate but not what it's current set to.
thanks
-
This is a reference I use frequently.
https://www.machinetoolhelp.com/Applications/macro/system_variables.html
This says the modal F is #4109
-
This is a reference I use frequently.
https://www.machinetoolhelp.com/Applications/macro/system_variables.html
This says the modal F is #4109
Thank you