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