Hello Guest it is April 19, 2024, 12:36:18 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - CNCUserDK

Pages: 1
1
Mach4 General Discussion / Re: M3 macro does not start spindle
« on: October 24, 2021, 12:52:34 PM »
mc.SV_S returns a value of 19 not 5000 as it should.

A have used this macro to test it.

Code: [Select]
function m3()
    inst=mc.mcGetInstance()

        local lRPM = mc.SV_S
lRPM = math.tointeger(lRPM)
mc.mcCntlSetLastError(inst, tostring(lRPM))

end
 
if (mc.mcInEditor() == 1) then
    m3()
end

2
Mach4 General Discussion / Re: M3 macro does not start spindle
« on: October 24, 2021, 06:00:12 AM »
The following code works as it should.
Speed is set and the spindle starts.

Now I just need to read the speed of the spindle from the g code.

Code: [Select]
function m3()
    inst=mc.mcGetInstance()

local lRPM = 5000; -- How do I read the rpm from the g code?

mc.mcSpindleSetCommandRPM (inst, lRPM);
mc.mcSpindleSetDirection(inst, 1);

end
 
if (mc.mcInEditor() == 1) then
    m3()
end

3
Mach4 General Discussion / Re: M3 macro does not start spindle
« on: October 23, 2021, 10:01:59 AM »
I get your point.
Why make it harder than necessary.
Unfortunately, it does not make you any wiser.

So, whether I need to use it for something or not, I still would like to know how to read spindle speed from the g code.

4
Mach4 General Discussion / Re: M3 macro does not start spindle
« on: October 22, 2021, 10:03:29 AM »
Okay. Thanks for the information.

How do I read spindle speed from the g code so I can start the spindle afterwards.

5
Mach4 General Discussion / M3 macro does not start spindle
« on: October 21, 2021, 04:07:45 PM »
I have created a macro that is activated every time the M03 g code occurs. It works as it should.
The two commands I have inserted in the macro also work.
However, the spindle is not started. The G code continues without the spindle rotating.

Do I need a command to activate the spindle

Code: [Select]
function m3()
    inst=mc.mcGetInstance()
mc.mcCntlGcodeExecute(inst, "G00 Z36.000");
mc.mcCntlGcodeExecute(inst, "G04 P3.00");
end
 
if (mc.mcInEditor() == 1) then
    m3()
end

Pages: 1