Hello Guest it is May 12, 2024, 12:56:33 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 - Cbyrdtopper

331
TTalma,
The code you supplied was almost there; make the following changes and it should work fine.

You have to assign your "Blow Off" output to an Output# in the Mach4 Configuration.
Once you assign that to an output you can then use the following code in a macro to get the handle of the output to change it's state.

function m6()
 ------ Turn on Blow off ------
    local BlowOff = mc.mcSignalGetHandle (inst, mc.mcOSIG_OUTPUT#) --Use the Output # you assigned the Blow Off in Mach4 configuration.
    mc.mcSignalSetState(BlowOff , 1)

    ------ Move to current tool change position ------
    local GCode = ""
    GCode = GCode .. "G00 G91 G53 Z-1.0\n"
    mc.mcCntlGcodeExecuteWait(inst, GCode)

    ------ Turn off Blow off ------
    mc.mcSignalSetState(BlowOff , 0)
end
if (mc.mcInEditor() == 1) then
    m6()
end


To answer your question about "inst".  Here is a post that Craig made this past week that sums it up nicely.

"It is possible and may become fact one day, that multiple instances of Mach can run at once. This was allowed for
in the original 'design' of Mach. As a consequence there are many instructions in Mach which need to be applied
to a particular instance of Mach. As it turns out Mach as currently deployed allows only one instance, usually instance
'0' and thus if you used the variable 'inst' in any part of Mach it will probably work. The safe way is to ensure that
the proper and current instance is used....ergo mc.mcGetInstance() is used within each scope."

332
Mach4 General Discussion / Re: Un-Supported wxNumberEntryDialog
« on: January 20, 2019, 08:10:37 PM »
Easy enough.   I'll open it up and try it again. 
I wonder who should show uo to a meet up if one was put together.   

333
Mach4 General Discussion / Re: Un-Supported wxNumberEntryDialog
« on: January 20, 2019, 04:50:34 PM »
Steve, great suggestion converting text to number; I just had to try it out, works great!

I remember going to the class that Scott had up in Michigan when Mach4 was first released, he strongly suggested downloading wxFormBuilder to make stuff.  I have tried to mess with wxFormBuilder before, I just don't know where to start with the code.  Maybe it's worth another try, it has been a while since I have opened it up.

334
Mach4 General Discussion / Re: Poor Mans Wizard
« on: January 20, 2019, 01:30:56 PM »
Yes I agree!   
I have used dialog boxes to get user input, text and integers.  There is a thread on here somewhere with that information.   Brett pointed me in the right direction for that.   If I were on my laptop I would find the post and copy a link;  but I'm on my phone at the moment.

335
Mach4 General Discussion / Re: Poor Mans Wizard
« on: January 20, 2019, 12:53:38 PM »
Craig,
That's  some in depth research. 
I was trying to just make a macro that would, when ran, open a save dialog box that would write to a text file.  And that's all.  I kept getting a panel error using your example and the M400 or M401 example. 
So, from what you have said, it wasn't getting the parent components, I was trying to ignore the mainframe and it wasn't going right.
So, I've got to have the mainframe to do this.


336
Mach4 General Discussion / Re: Poor Mans Wizard
« on: January 19, 2019, 02:20:52 PM »
Thanks, Craig.   Once I'm at my laptop again I'm going to comb through this.

337
Mach4 General Discussion / Re: How to generate gcode to do pearling
« on: January 19, 2019, 09:25:21 AM »
Craig,
I took the bolt hole wizard and stripped it down once before, last year sometime so I barely remember what I did, but I took that shell to make a wizard.
Do you know the syntax to make GCode output and to save ot to a file? That would be awesome for some ideas I have in mind for some second op stuff at work; I couldnt find any examples of just outputting to GCode and then saving to a file.   

338
Mach4 General Discussion / Re: G-Code Just Cutting Circles
« on: January 19, 2019, 12:27:47 AM »
Cutter compensation problem?   Share your G code file on here so we can try it out.   I've never had that kind of issue with my Fusion posts.

339
Mach4 General Discussion / Re: How to generate gcode to do pearling
« on: January 19, 2019, 12:25:26 AM »
I like this.   Very good use for LUA.   I'm curious though, and want to make a macro program out of it.   I'll try this tomorrow and see what happens.   Great code, Craig!   Curious, will this lock the GUI or run fine?   I left my laptop at work so I can't test it.

340
Mach4 General Discussion / Re: How to generate gcode to do pearling
« on: January 18, 2019, 03:09:13 PM »
How are you achieving this?
Taking a brush and jogging down onto the material?