Hello Guest it is April 26, 2024, 11:26:45 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

281
any lua/dll module/library that is located in the 'modules' directory that conforms to lua 5.2 can be loaded at run load time, see the screen load script:

--Master module
package.loaded.MasterModule = nil
mm = require "mcMasterModule"
   
--Probing module
package.loaded.Probing = nil
prb = require "mcProbing"
--mc.mcCntlSetLastError(inst, "Probe Version " .. prb.Version());

If the module extension is different than .lua then change your load path to search for that as well.

package.path = path .. "\\Profiles\\" .. profile .. "\\Modules\\?.lua;" .. path .. "\\Modules\\?.lua;"

LuaJIT is a compiler.  Mach4 runs it's own compiler to compile all lua, mcs files at each load and I don't believe you can just include the compiled module in the modules directory, but then again I haven't tried.  Good question though.

I'm not sure if the sci modules are 5.2 compatible.

MTCW

RT

282
Mach4 General Discussion / Re: mcCntrlGcodeExecuteWait fail
« on: April 23, 2018, 12:31:51 PM »
When I first started coding with Mach4 I put everything in the button mouse up script.  I generated a line of gCode and then ran mcCntlGcodeExecuteWait for each line.  I was told that was wrong that I needed to generate a string consisting of lines of gcode separated by newline characters.  Which I did.  I then started getting a huge amount of code included in the screen button scripts so I created a module to reduce the amount within the screens.  I then thought I should just write macros that called the module's functions and create the string.  That's when I ran into this 'new' limitation that nobody seems to know the answer to (lua defaults to 4096 characters for a string which this example doesn't exceed).  No one knows if this is due to a look ahead problem or a line limit with mcCntlGcodeExecuteWait.

So I thought that I would just run the macro to generate and save it as gcode file, load and run it.  No can do.  Can't load a gcode file while running a macro (error: not now).

So I am back to button scripts that generate the gcode file, save, load and start it.

RT

283
Mach4 General Discussion / Re: mcCntrlGcodeExecuteWait fail
« on: April 09, 2018, 10:18:18 PM »
All of them have a \n

284
Mach4 General Discussion / mcCntrlGcodeExecuteWait fail
« on: April 09, 2018, 01:19:25 PM »
I have a macro that generates a string of gcode listed below.  If I pass that string to mc.mcCntlGcodeExecuteWait(inst,s) it executes to the x1.320 then skips the rest of the gcode in the string and executes the remaining macro code after the mc.mcCntlGcodeExecuteWait(inst,s). Is there a limitation as to how many characters/commands that can be included and executed in a string with executeWait?  This code executes as a gcode file so I know it is not the code.

Code: [Select]
m3 s1400
g1 x1.5800 f1.000
g1 z0.0000 f12.000
g1 x1.5600 f1.000
g1 z0.2000 f12.000
g1 x1.5400 f1.000
g1 z0.0000 f12.000
g1 x1.5200 f1.000
g1 z0.2000 f12.000
g1 x1.5000 f1.000
g1 z0.0000 f12.000
g1 x1.4800 f1.000
g1 z0.2000 f12.000
g1 x1.4600 f1.000
g1 z0.0000 f12.000
g1 x1.4400 f1.000
g1 z0.2000 f12.000
g1 x1.4200 f1.000
g1 z0.0000 f12.000
g1 x1.4000 f1.000
g1 z0.2000 f12.000
g1 x1.3800 f1.000
g1 z0.0000 f12.000
g1 x1.3600 f1.000
g1 z0.2000 f12.000
g1 x1.3400 f1.000
g1 z0.0000 f12.000
g1 x1.3200 f1.000  (executes up to and including this line)
g1 z0.2000 f12.000
g1 x1.3000 f1.000
g1 z0.0000 f12.000
g1 x1.2800 f1.000
g1 z0.2000 f12.000
g1 x1.2600 f1.000
g1 z0.0000 f12.000
g1 x1.2400 f1.000
g1 z0.2000 f12.000
g1 x1.2200 f1.000
g1 z0.0000 f12.000
g1 x1.2000 f1.000
g1 z0.2000 f12.000
m5

TIA

RT

285
While manual editing of the output works you can eliminate this by selecting the in-feed option every time.  While the GUI shows something as being selected, like 'Flank In-Feed, Constant Depth', it will always output a k=0 value unless you re-select an option each time.

Just one of many flaws in the turn cycles wizard.

I think this may be time to open a ticket with NFS to determine if it Mach or motion control related.  sorry I can't help more.

TIA

RT

286
Mach4 Plugins / Re: unPlugin V1.0.0
« on: April 09, 2018, 10:53:31 AM »
mc.mcRegGethandle(inst, "unPlugin/GuiCommand")

mc.mcRegGetHandle(inst, "unPlugin/GuiCommand")

287
I'm surprised that the threading code ran at all.  the N0085 G76 contains a k value of zero which is not valid.  Are you running hobby or industrial?

288
G-Code, CAD, and CAM discussions / Re: Conditional programming
« on: March 20, 2018, 10:37:28 PM »
M98 calls a subroutine not a tap/gcode file.  The subroutine is defined after.the main gcode(m30) and starts with the letter o followed by the same numbers that follow the p parameter in the m98 call.

289
G-Code, CAD, and CAM discussions / Re: Conditional programming
« on: March 20, 2018, 10:27:07 PM »
Your m98 is calling p02

You don't have a
o02
You have a
o2 defined

290
When you load mach it re-compiles all scripts and macros so if you have checkProbe() defined in any other file that contains an error mach will not compile correctly.

Move any files with the code you are trying to debug to a directory outside of your mach directory.  Start mach.  If you still get an error like the 'failure while running chunk something else is wrong.  If not then:

From Operator->edit/debug scripts select any m???.mcs file.  Then when in the editor select file->new.  With notepad cut and paste the code into this new file and hit F7.  Now you should get where the offending line of code is. 

HTH

RT