Hello Guest it is April 19, 2024, 05:26:32 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 - smurph

561
Mach4 General Discussion / Re: Calling one G-Code file from another
« on: September 28, 2018, 11:58:30 PM »
In a word, subprograms.  :)  Watch this video and see the magic.  https://www.youtube.com/watch?v=fT0wjbO4NpE

The idea would be that each of your different functions would be a a subprogram.  Then any main part program could call them. 

Steve

562
Mach4 General Discussion / Re: Macros for lathe spindle range change
« on: September 16, 2018, 12:27:02 AM »
local NextSpindleRange = mc.mcCntlGetLocalVar(inst, hVars, mc.SV_P)

That line pulls the P word from the G code line.  It will be hard to debug in the editor since you can't really execute a G code line.  There are also these related functions available:

flag, rc = mc.mcCntlGetLocalVarFlag(number inst, number hVars, number varNumber)  -- This one tels you if the G code word was set on the G code line.  e.g.  "M101 P1"

Code: [Select]
local flag
flag, rc = mc.mcCntlGetLocalVarFlag(inst, hVars, mc.SV_P)  -- flag would equal 1 because P1 was specified on the G code line.
flag, rc = mc.mcCntlGetLocalVarFlag(inst, hVars, mc.SV_Q)  -- flag would equal 0 because Q was specified on the G code line.

comment, rc = mc.mcCntlGetLocalComment(number inst, number hVars) -- retrieve the comment on the G code line that contains the M code. 

As I said earlier, it is hard to debug these things because no G code line has been executed when debugging in the script editor.  So I put in a little helper API function that will simulate it.  :)

hVars, rc = mc.mcCntlCreateLocalVars(number inst, string gCodeLine)

It would be used in the function call stub like this:

Code: [Select]
if (mc.mcInEditor() == 1) then
   -- The function call stub is only ever executed when in the editor debugging, so it is safe to leave this in for testing.
   local inst = mc.mcGetInstance()
   local hVars, rc
   hVars, rc = mc.mcCntlCreateLocalVars(number inst, string gCodeLine)
   M101(hVars)
end

There are caveats to passung G code words to M codes.  One is you can't use the M word as a variable.  You can use a word more than once.  And finally, the M code that takes variables has to be the only thing on the line. 

Steve

563
Mach4 General Discussion / Re: Macros for lathe spindle range change
« on: September 15, 2018, 02:22:03 AM »
A lot of machines use M40 and up to set the range.  For example, M40, M41, and M42 for a three range spindle.  All of those M code macro script would be implemented like GerdS example with the exception of no input parameter.  The range would be hard coded. 

Steve

564
Mach4 General Discussion / Re: mcTouchOff Dialog
« on: September 12, 2018, 01:53:43 AM »
There is the API manual in the docs folder that addresses the mc. namespace/library/table.  As for the wx. stuff, that is wxLUA and the documentation is on that web site.  However, they kind of expect you to know the wxWidgets API or use the wxWidgets C/C++ API docs and "translate" the C/C++ functions to the LUA syntax.  The wxWidgets API is expansive and there is no possible way we would ever document it.  Unless you are writing wizards or GUI stuff, there really isn't any need for the wx. stuff.  But it is there if you want to get crafty and don't mind a learning curve. 

Steve

565
Mach4 General Discussion / Re: DRO,s scaling error
« on: September 12, 2018, 01:33:47 AM »
What build are you running?  Try the latest from the website. 

Steve

566
Mach4 General Discussion / Re: IMTS 2018
« on: September 05, 2018, 05:17:33 PM »
I won't be there this year.  :(  I do plan on going to FabTech in Atlanta on Nov. 6, 7, and 8. 

Steve

567
Using the PMC is even easier.  Do the same creation of inputs in the the keyboard plugin and map them directly to the desired action in the PMC.  You don't have to map them to Mach signals this way. 

Steve

568
Mach4 General Discussion / Re: Run in parallel 2 Gcode files
« on: August 01, 2018, 01:04:55 AM »
The connections will be made electrically.  An output on the label machine goes high when it loads the cutting machine.  The cutting machine is looking at an input that is tied to the label machine's output, etc...

The Mach instance on the label machine doens't have to be seen.  Just stuff it in a cabinet.  Turn it on first and then turn on the cutting machine's Mach. 

Steve

569
Mach4 General Discussion / Re: Run in parallel 2 Gcode files
« on: July 30, 2018, 07:56:58 PM »
It looks like two machines to me.  Two G code interpreters that are linked together with inputs/outputs.  Two PCs with Mach each would be required.  Or wait for our muilt-path version of Mach which can run as many as 6 paths (interpreters).  And possibly one Mach machine and a PLC may be able to do the labeling? 

Steve

570
You only need to re-generate the tool path if the work offsets have been changed.  Otherwise, Mach doesn't redraw the whole tool path.  It only draws the entire tool path when you load a file or hit re-gen.  All it draws is the cross hairs and changes the color of the cut path after that.  I fear that there is something wrong with your graphics driver if you think it is trying to re-draw the tool path all of the time. The build on the website (3804) has all of the optimizations I was talking about the you quoted. 

I would:

1. see if there is an updated video driver.
2. make sure you are not swaping to disk (low memory).

Steve