Hello Guest it is April 19, 2024, 01:37:23 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 - ByrdMan

Pages: 1
1
Mach4 General Discussion / Re: Loop-d-loop G41
« on: June 01, 2020, 08:47:24 AM »
I am using Mach4 4.2.0.4300 Build 4300

2
Mach4 General Discussion / Loop-d-loop G41
« on: May 14, 2020, 12:52:26 PM »
When I use a G41 to compensate, my radius cut goes crazy with another loop to prep for the next move. Between the G02 and the next G01 is where I get the circled prep move.

g41
g01 x.671 y-.0729
g02 x.8957 y-.333 r.282
g01 x1.2837 y-.33

ByrdMan

3
Mach4 General Discussion / Re: Mach4 screen not updating while running Macro
« on: September 28, 2017, 02:57:24 PM »
OK,
  I've read the current API docs, looked and tried examples. Can I just get a sample code of a button script that has more than one gcode line that echoes to the screen realtime?

4
Mach4 General Discussion / Re: Mach4 screen not updating while running Macro
« on: September 27, 2017, 02:49:18 PM »
I've tried both "Execute" and "Mdi" and am still not getting a result.  I'm also getting a message when I open my code file.
      "Invalid value 2 for a boolean key "WholeWord" in config file"
Here is the code, if that helps:

--Grind to this dimension
function M200()

-----
--Variables
-----
local inst = mc.mcGetInstance()
local FinishDiameterText = scr.GetProperty ("GrindDimensionText", "Value")
local PlungeFeedText = scr.GetProperty("PlungeFeedText", "Value")
local RoughIncText = scr.GetProperty("RoughIncText", "Value")
local FinishIncText = scr.GetProperty("FinishIncText", "Value")
local SparkOutsText = scr.GetProperty("SparkOutsOnlyText", "Value")
local LeftXText = scr.GetProperty("EndLeftText", "Value")
local RightXText = scr.GetProperty("EndRightText", "Value")
local LeftFeedText = scr.GetProperty("FRLeftText", "Value")
local RightFeedText = scr.GetProperty("FRRightText", "Value")
local LeftDwellText = scr.GetProperty("DwellLeftText", "Value")
local RightDwellText = scr.GetProperty("DwellRightText", "Value")
local FeedRightLED = scr.GetProperty("FeedOnRightLED", "Value")
local FeedLeftLED = scr.GetProperty("FeedOnLeftLED", "Value")
local EndLeftLED = scr.GetProperty("EndOnLeftLED", "Value")
local EndRightLED = scr.GetProperty("EndOnRightLED", "Value")

local FinishDiameter = tonumber(FinishDiameterText)
local PlungeFeed = tonumber(PlungeFeedText)
local RoughInc = tonumber(RoughIncText)
local FinishInc = tonumber(FinishIncText)
local SparkOuts = tonumber(SparkOutsText)
local LeftX = tonumber(LeftXText)
local RightX = tonumber(RightXText)
local LeftFeed = tonumber(LeftFeedText)
local RightFeed = tonumber(RightFeedText)
local LeftDwell = tonumber(LeftDwellText)
local RightDwell = tonumber(RightDwellText)
local FeedRightLED = scr.GetProperty("FeedOnRightLED", "Value")
local FeedLeftLED = scr.GetProperty("FeedOnLeftLED", "Value")
local EndLeftLED = scr.GetProperty("EndOnLeftLED", "Value")
local EndRightLED = scr.GetProperty("EndOnRightLED", "Value")
local CurrentY = scr.GetProperty ("droCurrentY", "Value")
local ToGrindNum = (CurrentY - FinishDiameter)
local ToGrind = ToGrindNum
local ToGrindVar = 0
local SparkOutCtr = 0
local SparkOutCounter = 0


-----
--Rough Grind
-----
mc.mcCntlSetLastError(inst,"Start Rough Grind.")
mc.mcCntlGcodeExecute(inst,"M3M8")

while (ToGrind > (RoughInc + FinishInc)) do
    FeedLeftLED = scr.GetProperty("FeedOnLeftLED", "Value")
    if (FeedLeftLED == "1") then
        mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
        mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
        mc.mcCntlGcodeExecute(inst, "G04" .. LeftDwell)
        mc.mcCntlGcodeExecute(inst, "G91G00Y-" .. RoughInc)
        mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
        mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
        mc.mcCntlGcodeExecute(inst, "G04" .. RightDwell)
           
        ToGrindVar = (ToGrind - RoughInc) -- How much is actually left grind.
        ToGrind = ToGrindVar
           
    end --If
           
    FeedRightLED = scr.GetProperty("FeedOnRightLED", "Value")
    if (FeedRightLED == "1") then
        if (ToGrind > (RoughInc + FinishInc)) then
            mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
            mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
            mc.mcCntlGcodeExecute(inst, "G04" .. RightDwell)
            mc.mcCntlGcodeExecute(inst, "G91G00Y-" .. RoughInc)
            mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
            mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
            mc.mcCntlGcodeExecute(inst, "G04" .. LeftDwell)
           
            ToGrindVar = (ToGrind - RoughInc) -- How much is actually left grind.
            ToGrind = ToGrindVar
           
        end --If
           
    end --If
end --While


-----
--Finish Rough Grind
-----
mc.mcCntlSetLastError(inst,"Start Finish Grind.")
mc.mcCntlGcodeExecute(inst,"M3M8")

while (ToGrind > FinishInc) do
    FeedLeftLED = scr.GetProperty("FeedOnLeftLED", "Value")
    if (FeedLeftLED == "1") then
        mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
        mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
        mc.mcCntlGcodeExecute(inst, "G04" .. LeftDwell)
        mc.mcCntlGcodeExecute(inst, "G91G00Y-" .. FinishInc)
        mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
        mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
        mc.mcCntlGcodeExecute(inst, "G04" .. RightDwell)
           
        ToGrindVar = (ToGrind - FinishInc) -- How much is actually left grind.
        ToGrind = ToGrindVar
    end --If
         
    FeedRightLED = scr.GetProperty("FeedOnRightLED", "Value")
    if (FeedRightLED == "1") then
        if (ToGrind > RoughInc) then
            mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
            mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
            mc.mcCntlGcodeExecute(inst, "G04" .. RightDwell)
            mc.mcCntlGcodeExecute(inst, "G91G00Y-" .. FinishInc)
            mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
            mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
            mc.mcCntlGcodeExecute(inst, "G04" .. LeftDwell)
           
            ToGrindVar = (ToGrind - FinishInc) -- How much is actually left grind.
            ToGrind = ToGrindVar
        end --If
    end --If
end --While

-----
--Finish Finish Grind
-----
mc.mcCntlSetLastError(inst,"Grinding Remainder.")
mc.mcCntlGcodeExecute(inst,"M3M8")

FeedLeftLED = scr.GetProperty("FeedOnLeftLED", "Value")
if (FeedLeftLED == "1") then
    mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
    mc.mcCntlGcodeExecute(inst, "G04" .. LeftDwell)
    mc.mcCntlGcodeExecute(inst, "G90G00Y" .. FinishDiameter)
    mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
    mc.mcCntlGcodeExecute(inst, "G04" .. RightDwell)
end   
           
FeedRightLED = scr.GetProperty("FeedOnRightLED", "Value")
if (FeedRightLED == "1") then
    mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
    mc.mcCntlGcodeExecute(inst, "G04" .. RightDwell)
    mc.mcCntlGcodeExecute(inst, "G90G00Y" .. FinishDiameter)
    mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
    mc.mcCntlGcodeExecute(inst, "G04" .. LeftDwell)
end --If
         
-----
--SparkOut
-----
mc.mcCntlSetLastError(inst,"Sparkouts.")
while (SparkOutCounter < SparkOuts) do
    mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
    mc.mcCntlGcodeExecute(inst, "G04" .. LeftDwell)
       
    mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
    mc.mcCntlGcodeExecute(inst, "G04" .. RightDwell)

    SparkOutVar = (SparkOutCounter + 1)
    SparkOutCounter = SparkOutVar
end

-----
--End on left or right?
-----
mc.mcCntlSetLastError(inst,"End on Left or Right?")
if (EndLeftLED == "1") then
    mc.mcCntlGcodeExecute(inst, "F" .. RightFeed) --FR from the right.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. LeftX)
    mc.mcCntlSetLastError(inst,"End on the left.")
end 

if (EndRightLED == "1") then
    mc.mcCntlGcodeExecute(inst, "F" .. LeftFeed) --FR from the left.
    mc.mcCntlGcodeExecute(inst, "G90G01X" .. RightX)
    mc.mcCntlSetLastError(inst,"End on the right.")
end 

mc.mcCntlGcodeExecute(inst, "M5M9")
mc.mcCntlSetLastError(inst,"Finished Grinding!!")

end --Macro End

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

5
Mach4 General Discussion / Mach4 screen not updating while running Macro
« on: September 25, 2017, 10:55:54 AM »
mcCntlGcodeExecuteWait() seems to work fine, but the screen doesn't update while the code is running.  It updates after the button script is done. I can compile and step through the lua code and it works fine in debug mode. When I try to run my M file from MDI or in a gcode line it ignores it. If I copy and paste the code to a button, without the function title and debug snip at the end, it operates correctly but does not update the screen till it is finished. I really need the screen dro's updated while it is running. Is there a function I can drop in my lua code that will update the screen while it is running?

6
Mach4 General Discussion / Re: mcCntlGcodeExecuteWait Inside a macro
« on: September 20, 2017, 01:12:42 PM »
I have the same issue where I can compile and step through the lua code it works fine in debug mode. When I try to run my M file from MDI or in a gcode line it ignores it. If I copy and paste the code to a button, without the function title and debug snip at the end, it operates correctly but does not update the screen till it is finished. I really need the screen dro's updated while it is running. Is there a function I can drop in my lua code that will update the screen on demand?

Pages: 1