Hello Guest it is March 28, 2024, 01:38:31 PM

Author Topic: Mach4 ESS Probing Problems  (Read 5316 times)

0 Members and 1 Guest are viewing this topic.

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach4 ESS Probing Problems
« Reply #10 on: May 16, 2017, 01:11:52 PM »
Ok lets see if we can get you on the right track, I do not know anything about mach3 VB so bear with me.

So the first few lines looks like you are defineing some variables and getting the FeedRate

CurrentFeed = GetOemDRO(818)
PierceHight = -10.0
ProbeFeed = 1300.0

would become something like

Code: [Select]
local inst = mc.mcGetInstance()
local CurrentFeed = mc.mcCntlGetPoundVar(inst, 2134)
local PierceHight = -10.0
local ProbeFeed = 1300.0

Code "G90 F" &ProbeFeed

would become something like

Code: [Select]
mc.mcCntlGcodeExecute(inst,"G90 F"..ProbeFeed)
If GetOemLed(825) = 0 Then
Code "G31 Z-117 F" &ProbeFeed

While IsMoving()
Wend

Not sure what OemLed(825) is but you can combine the execution of the G31 and While is moving by using mc.mcCntlGcodeExecuteWait
Code: [Select]
if (what ever Oem825 is == 0) then
mc.mcCntlGcodeExecuteWait(inst, "G31 Z-117 F"..ProbeFeed)
else
--whatever
end

I watched the video and my sugestion is to write down a series of events/steps and then use the API Docs found in the docs directory for the commands to do each step as I have above.

Hope this gets you on track, but like I say I do not know mach3.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Mach4 ESS Probing Problems
« Reply #11 on: May 16, 2017, 06:25:55 PM »
Here to help if I can!

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Mach4 ESS Probing Problems
« Reply #12 on: May 18, 2017, 03:34:35 PM »
Study the code I have given you earlier.  There is no shortcut to learning Lua but it will do the same thing as you have written in basic.  You can go line by line to translate what you did in Mach3 to Lua in Mach 4.  It seems difficult at first. I realize now looking back to where I was when I was asking the same questions you are, that it was worth the effort.

Awesome!
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!