Hello Guest it is January 23, 2020, 08:36:28 AM

Author Topic: PeriodicScripts - - - do these work? No luck here.  (Read 2938 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,374 1,374
    • View Profile
PeriodicScripts - - - do these work? No luck here.
« on: June 27, 2012, 05:32:44 PM »
Title says it all. Programmers manual shows start, stop and Is. Nothing seems to work for me.

Offline BR549

*
  •  6,923 6,923
    • View Profile
Re: PeriodicScripts - - - do these work? No luck here.
« Reply #1 on: June 27, 2012, 08:59:45 PM »
Works Here (;-)


Create Script , store it in Mach3 directory. Lets  say Count.m1s

Call  StartPeriodicScript( "Count" , 10)

Then Mach3 will Call the script"Count" every ten seconds.

To stop

Call StartPeriodicScript("Count")


Part of the trick is the script location. Mach3 assumes the first part of the file location as C:\Mach3 (or wherever you installed it) . You have to add the rest of the file location IF it is not in the mach3 directory.

Mach also assumes the file extention as m1s so you do not  add that part either.

C:\mach3\   (known)      You add from here    Macros\Machmill\COUNT

So that leaves a call as

StartPeriodicScript("macros\machmill\COUNT" , 10)


Hope that helps, (;-) TP

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: PeriodicScripts - - - do these work? No luck here.
« Reply #2 on: June 28, 2012, 09:06:01 AM »
BR,

THANKS very much!  You are most helpful and right on the money . . as usual.

Additional detail; the calling macro still has to be with it's buddies in macro land.  I had already tried a qualified name a couple of different ways and that is still not working. That was obviously the problem because when I put the script under \Mach3 all is well.     I'm on Win7 64bit so that may be a factor.

For inquiring minds, the application here is to monitor Mach for any A axis moves and take action if the 4th axis is either disabled or not in index mode. If there is no program running, the operator just gest a warning. If there is a program running, it is stopped and the operator then gets a message. Working nicely now and after it is debugged and reliable, I will expand it to cover the servo controlled spindle as well.

Offline BR549

*
  •  6,923 6,923
    • View Profile
Re: PeriodicScripts - - - do these work? No luck here.
« Reply #3 on: June 28, 2012, 10:53:11 AM »
You do have to watch the / separators there is a specific combination that works and ONLY that combo. I will do some testing for you also.

(;-) TP

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: PeriodicScripts - - - do these work? No luck here.
« Reply #4 on: June 28, 2012, 11:56:44 AM »
You do have to watch the / separators there is a specific combination that works and ONLY that combo. I will do some testing for you also.

Where are the .. that's what I want to know. Mach is totally 'illegal'. Just wait till Bill finds out . . .  he'll probably BUY out MACH3 and add it to Windows 8 . . . .  LOL!

Offline BR549

*
  •  6,923 6,923
    • View Profile
Re: PeriodicScripts - - - do these work? No luck here.
« Reply #5 on: June 28, 2012, 12:07:11 PM »
OK did some testing and it still works here. Here is what I tested with  and it is a good troubleshooter. I have ALSO notice that CB has gotten picky about SOME Calls being CASE sensitive. In the past it was strictly NOT case sensitive. I think the NEW stuff messed it all up.


'MACRO "CheckScript.M1s"

MsgBox"" &Dir ("C:\Mach3\Macros\Mach3mill\Count.m1s")          'Verify it exists

StartPeriodicScript("macros\Mach3mill\count" ,10)          'StartScript , NOTICE NO leading "\"

If ISPeriodicScriptRunning("macros\Mach3mill\count") Then      'Verify it running
MsgBox"YEP"
Else
MsgBox"NOPE"
End If

StopPeriodicScript("macros\Mach3mill\count")         'Stop Script



*******************************************************************

'Macro "Count.m1s"
Count= GetVar(100)
Message" Number = " &count
SetVar(100, (GetVar(100) + 1))
End

« Last Edit: June 28, 2012, 12:11:42 PM by BR549 »