Hello Guest it is July 06, 2020, 02:49:17 AM

Author Topic: Where can I find the script for M98 and M8?  (Read 3501 times)

0 Members and 1 Guest are viewing this topic.

Where can I find the script for M98 and M8?
« on: December 21, 2009, 05:44:21 PM »
I would like to see the script used for the M98 command.  I looked in the macro's folder and it's not in there.  Any help would be appreciated.

Thanks

Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: Where can I find the script for M98 and M8?
« Reply #1 on: December 21, 2009, 05:59:56 PM »
Not really sure what you are wanting, M98 is to call a sub and does not have a macro,  as far as I am aware..
Your title also mentions M8, if you want an M8 macro to do something other than the normal outputs then you will have to make one.
Hood
Re: Where can I find the script for M98 and M8?
« Reply #2 on: December 21, 2009, 06:20:31 PM »
I would like to see how the M98 command loads the subprogram of gcode from the file directory.  I would like to be able to  insert a line of script or a custom M code at the end of a gcode program that would automatically  load a new gcode program into mach3 from a specified file directory.
Example of what it might look like.
....
G0 Z1
M5
LoadProgram (c:\Mach3\gcode\folder2\program5.nc)

As far as the M8,  I was just curious to see what the script looks like the controls output pins for the flood.

Thanks

Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: Where can I find the script for M98 and M8?
« Reply #3 on: December 21, 2009, 06:34:06 PM »
If you want to open a new file at the end of the code then just write a custom macro and place it in your profiles macro folder. Custom macros are from m101 up but some are already used by wizards so check in the macro folder first to see you are not using a number thats already taken.
In your macro you would just have
Loadfile("c:\Mach3\gcode\folder2\program5.nc)

then you would name it and save it in your macro folder, the name would be your chosen m number followed by m1s, eg m101.m1s
When you called m101 from code or MDI it should do your macro and load the code.


For the M8 you can either set up an output and enable that output on the Ports and Pins, Spindle Setup page or if you wished you could write your own M8, if you do that you will also need to write your own M9.
You would need a custom M8 if you were wanting to activate several outputs from the M8 command, the macro would contain something like this

ActivateSignal (OutPut1)
ActivateSignal (OutPut3)


Your M9 would need

DeActivateSignal (OutPut1)
DeActivateSignal (OutPut3)

Hood
Re: Where can I find the script for M98 and M8?
« Reply #4 on: December 21, 2009, 06:45:08 PM »
Thanks for you help. When I try and run the this line in the script editor, I get and compile error/ syntax error. Do you know what I'm doing wrong?

Loadfile("c:\Mach3\gcode\folder2\program5.nc)


Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: Where can I find the script for M98 and M8?
« Reply #5 on: December 21, 2009, 06:55:17 PM »
My mistake, sorry, missed out the " at the end, it should be
Loadfile("c:\Mach3\gcode\folder2\program5.nc")