Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 11:27:20 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  initialization string problem - Run a script by Macro
Pages: 1   Go Down
Print
Author Topic: initialization string problem - Run a script by Macro  (Read 483 times)
0 Members and 2 Guests are viewing this topic.
mythal
Active Member

Offline Offline

Posts: 4


View Profile
« on: June 20, 2011, 11:45:45 AM »

Hi

I'm trying to semi auto my Mach3 by adding a file-loading Macro(M555) at initialization string.

and wish to have Mach3 to run a Macro (M159) to call a App.exe at the end of my Gcode

However, when I press the RESET button to initial the Mach3, Mach3 run M555 correctly , but launch M159 at same time (which I wish to be run at the very end of the process)


Is there anyone can give me some suggestion to get this right?

Thanks!


here are the codes I use:

M555:
LoadFile ("C:\Sample.NC")

M159:(referenced from http://www.machsupport.com/forum/index.php/topic,13960.0.html)

Option Explicit

Dim CmdString As String

Const Filename = "C:\Run.exe"
Const AppFQFN = "C:\windows\system32\CMD.exe"

CmdString = """" & APPFQFN & """" & " " & """" & FileName & """"
Shell(CmdString) 


my Gcode-Sample.NC:
G00 G49 G40.1 G17 G80 G50 G90
G21
M6 T1
M5 M9
M159
M30




Logged
zealous
Active Member

Offline Offline

Posts: 486



View Profile WWW
« Reply #1 on: June 20, 2011, 12:29:35 PM »

If I understand correctly you dont want Mach to fire off the Mcode will the file is being loaded?

In Config/General Logic Configuration/Ignore M Calls While Loading check

Or in your code you can put:

Code:
If isloading() Then
MsgBox "is loading"
Else
MsgBox "is Not loading"
End IF
Logged

Regards, Jason Blake

www.Fusioncnc.com
mythal
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #2 on: June 20, 2011, 07:46:44 PM »

Super!

I tick the "Ignore M Calls While Loading" and it works !

Thank you zealous.


Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!