Hello Guest it is April 29, 2024, 01:09:07 AM

Author Topic: Using M2xx codes  (Read 1684 times)

0 Members and 1 Guest are viewing this topic.

Offline MDub

*
  •  26 26
    • View Profile
Re: Using M2xx codes
« Reply #10 on: February 01, 2022, 12:48:22 PM »
Thanks. My diagnostics screen (attached) already  had a Parts Finished indicator but after running Gcode files this indicator has never turned on. A thought came to mind; we are using the wxRouter set. Is it possible that Mach4 thinks that we'll never make a "part" with a router? Probably not so the question goes back to the forum or ArtSoft....what is the condition or event that triggers a Parts Finished condition.

Going back to the original need. All we want to do it to set toggle a Port/Pin at the end of a GCode file. Digging a little more I see there is a G65 which calls a macro. Not up on macro development yet so could I get a little help in getting sample macros for turning on and off OutPut 1?

I really appreciate the time and effort all the forum members have put in to assist me.

As an aside I did send an email to ArtSoft asking what condition triggers Parts Finished. If or when they respond I'll update here.
« Last Edit: February 01, 2022, 12:54:19 PM by MDub »

Offline jbuehn

*
  •  101 101
    • View Profile
Re: Using M2xx codes
« Reply #11 on: February 01, 2022, 01:17:37 PM »
If all you want to do is toggle output 1 on/off, maybe easiest to use M64 PX and M65 PX? Explanation of that is in the "Mill GCode Programming" pdf in the Mach4Hobby\docs folder.

Offline MDub

*
  •  26 26
    • View Profile
Re: Using M2xx codes
« Reply #12 on: February 01, 2022, 09:52:16 PM »
Yep. M65 calling a macro to toggle on an Output seems the best solution. However I'm hung up on how to write that macro. I've looked at the sample macros ion my profile's macro directory and the structure is fairly straightforward. What I'm missing is the function that enables and disables an Output. Anyone who can show me a sample of how that function would be called in a macro would be most appreciated.
Re: Using M2xx codes
« Reply #13 on: February 01, 2022, 11:25:03 PM »
Hi,

Quote
My diagnostics screen (attached) already  had a Parts Finished indicator but after running Gcode files this indicator has never turned on.

Could it be that it turn on and then off again that fast that you don't see it?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline jbuehn

*
  •  101 101
    • View Profile
Re: Using M2xx codes
« Reply #14 on: February 02, 2022, 11:55:10 AM »
Yep. M65 calling a macro to toggle on an Output seems the best solution. However I'm hung up on how to write that macro. I've looked at the sample macros ion my profile's macro directory and the structure is fairly straightforward. What I'm missing is the function that enables and disables an Output. Anyone who can show me a sample of how that function would be called in a macro would be most appreciated.

M64 and M65 are existing macros in Mach4. From the "Mill GCode Programming" pdf in the Mach4Hobby\docs folder...

M64 – Immediate Output On
The specified output is turned on immediately.
Format: M64 P__
P specifies the output number to turn on. For example: Output0 = 0, Output3 = 3, Output10 = 10, etc.

M65 – Immediate Output Off
The specified output is turned off immediately.
Format: M65 P__
P specifies the output number to turn on. For example: Output0 = 0, Output3 = 3, Output10 = 10, etc.

Offline MDub

*
  •  26 26
    • View Profile
Re: Using M2xx codes
« Reply #15 on: February 02, 2022, 07:40:39 PM »
Never found those macros but with ArtSoft's help desk support they pointed me to 2 macros that are provided in my profile's macros directory.
m114 will turn on an output, defined in the macro
m115 will turn off the output.