Hello Guest it is October 04, 2023, 10:03:49 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

471
Mach4 General Discussion / Re: Lua Macro Parameters
« on: March 07, 2017, 04:45:17 PM »
Chasing my tail again. ???

I created a module 'rtModule.lua' in the modules folder
...
local rtModule = {}
  function rtModule.rtMessage(msg)
   wx.wxMessageBox(msg)
  end

return rtModule
...

Added this to the screen load script under the load modules section
...
package.loaded.rtModule = nil
rt = require "rtModule"
...



I created, since none existed, a load_modules.mcs file and put it in the same macro folder as my profile macros 'C:\Mach4Hobby\Profiles\My4Lathe\Macros'
...
package.loaded.rtModule = nil
rt = require "rtModule"
...



Created a macro 'm9002.mcs' under the profile macros folder
...
function m9002()
  rt.rtMessage('Another Hello')
end

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


Added 2 buttons to the screen

btn1 leftup script
...
rt.rtMessage('Hello from a Button')
...


btn2 leftup script
...
inst=mc.mcGetInstance()
mc.mcCntlMdiExecute(inst,'m9002')
...


btn1 gives me the expected 'Hello from a Button'
btn2 does nothing
put m9002 in the mdi and press cycle start, nothing.

So I know that the rtModule.lua is getting loaded and functiong correctly.
Do I have a syntax error in the macro?  Compiles.
Is there more to the load_modules.mcs that I am missing?

HELP!

472
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 07, 2017, 02:36:22 PM »
George,

Glad to hear it is coming along.

I am confused as to why you want distance mode set to Inc.  This means every time you issue a G0 A45 it will advance the turret 45 degrees not go to home + 45 degrees.  Some of your other gcode may override either distance mode by issuing a G90(absolute-go to dro position X) or G91(Inc-move an additional X amount)

Your macro assumes that you want to be in Abs mode so start by adding the code "G90" to your macro.  You can get fancy later and add to your macro, read and save the current mode, execute your current macro and then reset the mode back to what it was.

Let me know if I misunderstood you.

473
Mach4 General Discussion / Combo List Box
« on: March 07, 2017, 01:06:45 PM »
I don't see a list box or combo list box in the screen designer.  Is that something I missed or is going to be added or do we have to create one in lua?

TIA

RT

474
Mach4 General Discussion / Re: Optional Stop Output
« on: March 07, 2017, 12:41:59 PM »
I'll be interested to hear how/if it can be done with an M1 but why not just create another macro and use it instead of M1?

function m7777()
ringBuzzer()
mcCntlWaitOnCycleStart 
end

I'm sure you have a valid reason, just offering another idea.


475
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 07, 2017, 10:23:29 AM »
I don't have a turret to check out the movement (where's Hood when you need him ;) ) so I can't test it for you but some things to try

put a code "G90" at the beginning of the macro and see if you get the same behavior.  Eliminates some other code changing it to G91 mode.

If the error is repeatable then perhaps your steps per rev are messed up, unlikely.

If the movement is truly random then it is either mechanical, loosing steps from too great speed/acceleration or loose coupling, or electrical noise on the line.

My two cents.

HTH

RT

476
Mach4 General Discussion / Re: G76 threading cycle bug ?
« on: March 07, 2017, 09:55:21 AM »
Under mach4hobby/docs there is a lathe GCode programming pdf automatically installed with mach4.  Your looking at mach3 turn manual.

Additionally with the Mach4 threading wizard you need to select the infeed each time you use it or you will get a 0 for the K value.

HTH

RT

477
Mach4 General Discussion / Re: Optional Stop Output
« on: March 06, 2017, 05:08:20 PM »
Page 10 of the scripting manual says you may not change M00 or M01.

478
Mach4 General Discussion / Re: Single block mode
« on: March 02, 2017, 12:00:37 PM »
You probably aren't getting any response because no one has used it yet.

Using M4 Mill in Sim mode it does appear to work the way you would think.  Press single block, cycle start and it executes that line.  You then have to press single block to turn it off and then again to turn it back on and then cycle start for the next line to execute. 

The Cycle Start button left up event calls the cycleStart() function in the screen start script which calls mcCntlCycleStart() which you can't change.  Someone more adpt at lua than I could probably alter the button event to check if the single block is in effect and enable itself but that is beyond my knowledge.

Seems that the default behavior should be that after the line is executed you should again be able to do another cycle start.  Maybe someone else knows why it was implemented this way.

TIA

RT

479
Mach4 General Discussion / Re: UC100 Mach4 Lathe G83 fail
« on: February 28, 2017, 06:37:03 PM »
New Information,

Did a reinstall of Mach4, no difference.

I decided to just write a gcode file to do this one peck drill.  It skipped every g1 line, executed every g4 and g0.  After 3 or 4 runs it wouldn’t run at all. 

Code: [Select]
M3 S500
G00 Z0.100
G01 F4 Z-.3
G4 P250
G00 Z0.100
G4 p1000
G00 Z-.3
G01 F4 Z-.6
G4 P250
G00 Z0.100
G4 p1000
G00 Z-.6
G01 F4 Z-.9
G4 P250
G00 Z0.100
G4 p1000
G00 Z-.9
G01 F4 Z-1.2
G4 P250
G00 Z0.100
G4 p1000
G00 Z-1.2
G01 F4 Z-1.5
G4 P250
G00 Z0.100
G4 p1000
G00 Z-1.5
G01 F4 Z-1.8
G4 P250
G00 Z0.100
G4 p1000
G00 Z-1.8
G01 F4 Z-2.1
G4 P250
G00 Z0.100
G4 p1000
G00 Z-2.1
G01 F4 Z-2.4
G4 P250
G00 Z0.100
G4 p1000
G00 Z-2.4
G01 F4 Z-2.5
G00 Z0.100
M9

Went back to Mach3 turn and ran the G83, worked great.  Totally at a loss.

480
Mach4 General Discussion / Re: UC100 Mach4 Lathe G83 fail
« on: February 28, 2017, 10:44:54 AM »
Just when I think I'm getting good at communicating I get hit upside the head with a 2x4.

Hidden in my posts is that, I had tried it in SIM, figured it was the UC100, contacted them and their initial response is that they think it is a Mach4 problem.  Their response:
...
Hi,

Thanks for the bug report, but this does not looks like a UC100 plugin bug, it seems more a Mach4 bug.
My reasoning is that motion controllers do not know anything about the g-code being executed on the computer by Mach3/4,
what a motion controller sees is a stream of motion data which the software calculates and the plugin reads and executes those datas.
For the UC100 there is no difference if a command is G0 or G1 or G2 or G3 or ... G83, it only sees a stream of movement vectors array which Mach4 is sending.
...

So...why not ask for some user help here.  Surely someone else is running Mach4 on a lathe and can verify that it works or doesn't on their setup. 

Not trying to bash either Mach4 or CNCdrive, just trying to solve a problem.

I'll try and do better next time with my communications.

RT