Hello Guest it is October 03, 2023, 03:52:19 PM

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 - rhtuttle

361
Mach4 General Discussion / Re: Lua Fails Me
« on: January 14, 2018, 03:12:57 PM »
Further update:

copied and saved the m6691.mcs as m7791.mcs

ran m7791 from the mdi and nothing happened.

deleted the m6691.mcc and moved the m6691.mcs to another directory.  ran m6691 from the mdi and nothing happened.

copied the m6691.mcs back to the macros directory and ran m6691 from the mdi and it created the new m6691.mcc but still ran with the old finish numbers.

Any ideas?

RT

362
Mach4 General Discussion / Re: Lua Fails Me
« on: January 14, 2018, 02:42:04 PM »
Update:

Decided to give up figuring this out for now so I just deleted the wxMessagebox.

THEN, I changed the finishSpeed and finishFeed to be the same as the roughing feed and speed. Saved it and ran it from the MDI: m6691.  It ran with the old speed and feed for the finish cycle.  Deleted the m6691.mcc and ran it again.  Same result.  Shut windows down and unplugged the pmdx411, restarted windows and plugged the pmdx back in.  Deleted the mcc again and went into the editor checked to make sure that the finish numbers were the same as the roughing and they were, hit compile and the mcc was created again.  Ran it but it still ran the finish cycle with the old numbers!!!

I have searched the computer for any old copies of the mcc file and deleted those in a backup directory along with the mcs and removed them from dropbox as well.  How is it that it is running a file that no longer exists?

TIA

RT

363
General Mach Discussion / Re: Edit X Position (newb, be gentle)
« on: January 13, 2018, 05:05:23 PM »
BTW, you will have much better luck getting answer of you post in the Mach4 general discussion portion of the forum.

364
General Mach Discussion / Re: Edit X Position (newb, be gentle)
« on: January 13, 2018, 05:04:28 PM »
This bug has been known for over a year and should have been corrected in the last release but wasn't.

You will have to edit the screen (my as well dive in head first in the deep end).  Make sure that you have Mach4 in maximized view, go to Operator->Edit Screen.    the screen will change to a screen editor with manager and properties windows on the left and your screen on the right.  Click on the xDro.  The properties window is in the lower left portion of the screen.  Change the 'Editor' property to 'In Place' by clicking on the right side of 'Editor' and a drop down list will appear.  Again select 'Operator->Edit Screen' and mach will ask you if you want to save the screen, select yes.  You should now be able to edit the dro

HTH

RT

365
General Mach Discussion / Re: Edit X Position (newb, be gentle)
« on: January 13, 2018, 03:46:07 PM »
Are you running Mach4 perchance?

366
Mach4 General Discussion / Lua Fails Me
« on: January 13, 2018, 03:30:45 PM »
Just when I think i am starting to understand lua I run into this.  The code below is a macro that I have used many times and today I wanted to alter it a bit.  When the changes didn't do what I thought it should i started putting in wxMessagBox calls in to see where it was failing.  When the first message box didn't pop up I was surprised, but even more surprised that the macro continued to execute including the second popup telling me to switch gearing.  What am I missing?  I deleted the .mcc and .mcs.bak several times and completely restarted windows with the same results.  I am at a total loss on this one.

Code: [Select]
function m6691(hVars)
  local xNow,zNow,maxVal,rc
  local ts,tr,te,sCode
  local currPos
  local plungeFeed=1
  local roughDOC=0.018
  local roughFeed=18
  local roughSpeed=1200
  local finishDOC=0.004
  local finishFeed=8
  local finishSpeed=1800
  local endX=.850 --param1()
 
  local inst=mc.mcGetInstance()

  wx.wxMessageBox('nil')  --HOW  IS THIS SKIPPED?
 
  if mc.mcSpindleGetCurrentRange(inst)~=1 then
    --rt.rtAudio("notify")
    --wx.wxSound('C:\\mach4Hobby\\Sounds\\Notify.wav',0):Play()
    wx.wxMessageBox('Set Spindle Gearing to High Speed')    --THIS ONE DOES GET EXECUTED!!!
    mc.mcSpindleSetRange(inst,1)
  end
  if (hVars ~= nil) then
    local DFlag = mc.mcCntlGetLocalVarFlag(inst, hVars, mc.SV_D)
    if(DFlag == 1) then
      endX = mc.mcCntlGetLocalVar(inst, hVars, mc.SV_D)
      mc.mcCntlSetLastError(inst,"Turning Diameter to "..endX)
    end
  end
  xNow,rc = mc.mcAxisGetPos(inst,0)
  zNow,rc = mc.mcAxisGetPos(inst,2)
  if xNow<=endX then
    rt.rtAudio("chord")
    wx.wxMessageBox("start X diameter "..xNow.." is <= to end diameter of "..tostring(endX))
    return
  end
  if zNow<=0 then
    rt.rtAudio("chord")
    wx.wxMessageBox("start Z is less than or = to 0")
    return
  end
  ts=os.time()

--rough cuts 
  mc.mcCntlGcodeExecuteWait(inst,"M3 S"..tostring(roughSpeed).."\ng04 p3.0")
  currPos,rc=mc.mcAxisGetPos(inst,0)
  while ((currPos-2*roughDOC)>(endX+finishDOC*2)) do
    maxVal=math.max(endX+2*finishDOC,currPos-roughDOC)
    sCode="G01 F"..tostring(plungeFeed).." X"..tostring(maxVal-roughDOC)
    mc.mcCntlGcodeExecuteWait(inst,sCode)
    currPos,rc=mc.mcAxisGetPos(inst,0)
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(roughFeed).." Z0")
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    currPos,rc=mc.mcAxisGetPos(inst,0)
    maxVal=math.max(endX+2*finishDOC,currPos-roughDOC)
    if currPos==endX+2*finishDOC then
      break
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(math.max(endX+2*finishDOC,currPos-roughDOC)))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(roughFeed).." Z"..tostring(zNow))
    if (currPos)==endX+2*finishDOC then
      break
    end 
  end
  tr=os.difftime(os.time(),ts)/60
  mc.mcCntlSetLastError(inst,"Roughing Time: "..string.format("%.1f min",tr))

  --finish cuts
  mc.mcCntlGcodeExecuteWait(inst,"M3 S"..tostring(finishSpeed))
  while (mc.mcAxisGetPos(inst,0)>=(endX+finishDOC)) do
    currPos,rc=mc.mcAxisGetPos(inst,0)
    maxVal=math.max(endX,currPos-finishDOC)
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(maxVal))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(finishFeed).." Z0")
    currPos,rc=mc.mcAxisGetPos(inst,0)
    if currPos==endX then
      break
    end 
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(endX))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(finishFeed).." Z"..tostring(zNow))
    currPos,rc=mc.mcAxisGetPos(inst,0)
    if currPos==endX then
      break
    end 
  end
  mc.mcCntlGcodeExecuteWait(inst,"M5\nM9")
  te=(os.time()-ts)/60
  mc.mcCntlSetLastError(inst,"Roughing Time: "..string.format("%.1f min",tr).." - Total Time: "..string.format("%.1f min",te))
end

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


TIA

RT

367
Mach4 General Discussion / Re: sms to phone
« on: January 12, 2018, 02:43:10 PM »
thanks dbt3000files,

I use t-mobile so instead of the @msg.fi.google.com I use @tmomail.net, each carrier has a gateway.  

I put the following in a button left up script to test whether a batch file is needed, you don't, and it works.  I think making a function in the load script that takes a string and appends that as the message (-m) would make it more useful.  You could call it with a more specific message.
 
os.execute('c:\\Mach4Hobby\\sendEmail.exe -f myemail@mail.com -t 1111111111@tmomail.net -s smtp.mail.com:587 -xu myemail@mail.com -xp mypassword -u "test" -m "hello world"')

Thanks for providing the links.

RT

368
Mach4 General Discussion / Re: sms to phone
« on: January 05, 2018, 06:26:54 PM »
Has anyone successfully got the C:\Mach4Hobby\Modules\ smtp-Example.lua to work?

369
General Mach Discussion / Re: Flat bottom Hole
« on: December 29, 2017, 07:51:23 PM »
that was my first thought but I had the end mill and it seems as they both have two flutes but of different geometry.  Is there really that much difference?

370
General Mach Discussion / Re: Flat bottom Hole
« on: December 29, 2017, 07:05:08 PM »
Seems like a sound plan if I was using a mill and not a lathe ;^)