开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: G-code in a macro:Needs more useful examples and docs


Art
 

Murky indeed...

Macro's were originally designed so I could reuse code, but they didn't
work out that way. Instead they are used to create usefrull subroutines for
specific purposes. Doc's are a little sketchy. John's idea is a good one, as
functions are needed I will add more. This is a troublesome area however, as
the macro's are run in a separate thread, so unknown interactions may occur.
This is evident in the serial output macro (on my immediate list for
repair) in that while it runs in testing mode, it will not transmit during a
program run. I will be spending some time to strengthen this over the next
little while to allow more complex programs with more stable interaction.
I'm attempting to make the main interpreter loop stop until the macro thread
is finished. This may cure the serial problem and allow for more
functionality. I have many requests for more output, so I am trying to make
the macro facility be able to transmit bytes to port addresses unknown to
Mach2, this would allow a 48pin IO card, for example, to be configured and
used as M-Code I/O no matter what card is desired. It may be the solution
for IO required for toolchangers and such.

I'll get back to you on specifics as I go. In regards to the question, "Can
I execute G-Code in a macro, yes, I believe the command is GCode("G0X0") for
example, but I will have to look this up...

Thanks,
Art
www.artofcnc.ca

----- Original Message -----
From: "japrenticeuk" <john@...>
To: <mach1mach2cnc@...>
Sent: Monday, August 04, 2003 5:08 PM
Subject: [mach1mach2cnc] Re: G-code in a macro:Needs more useful examples
and docs


--- In mach1mach2cnc@..., "Lee Studley"
<indigo_red@q...> wrote:
Hi Todd,
I was wondering this also, at least can I call a function or
similar
also, I think its a subset of VB scripting and can call some
predefined( not user defined (?)) routines Art has setup. The
manual
covers some specific macros, buts its really murky if your trying
to
do your own stuff.
<snip>

I agree it's murky! Documenting macros seemed a bit like writing the
user manual for a Swiss Army Knife!

It would be very helpful if you and others on the Group would like
to post explaining what you would like to do in your macros or,
perhaps easier, what you cannot do at present in Mach2. For example
is it to make MDI easier through less typing, to get round problems
with an existing post-processor, to control special features like a
part catcher etc.

With this sort of background established, I will try to document
sone more interesting examples.

John Prentice



To unsubscribe from this group, send an email to:
mach1mach2cnc-unsubscribe@...



Your use of Yahoo! Groups is subject to

Join MachCNC@groups.io to automatically receive all group messages.