Hello Guest it is October 21, 2021, 10:32:23 PM

Author Topic: Terminate a brain with "run macro M650.m1s" ???????  (Read 34604 times)

0 Members and 1 Guest are viewing this topic.

Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #60 on: March 27, 2013, 06:47:59 AM »
so i HAVE to have a file named macropump and everything in it will run ?
could i have left the name KENNETH_macropump ? and do ALL
the files in userprofile folder run all the time or some do and others are
connected to buttons. trying to understand macropump. is it just
the file name ? is the m1s extension pump related ? :)
Kenneth

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #61 on: March 27, 2013, 10:25:43 AM »
macropump.m1s is the only macro the pump runs and it must be named correctly.  In fact, I don't think if the m on macropump was capitalized it would run.  You need to realize that in a computer, the name is the same as an address.  Some things will allow for discrepancies such as capitol or lower case but most will not.  If you have one digit, space, letter, character wrong, you will be pointing to something other than you planned.  macropump.m1s is the file that the macropump runs.  It is looking for macropump.m1s and no other.  It is also looking for it in the macros folder, sub folder of the profile you created it for.  If one digit is different, not even on the same street as the one it's looking for.  Wrong folder and it might as well be in a different state.  Wrong drive and it's in another world.  This is true for image locations in screens too.

Everything in the macropump will run roughly 10 times a second but be careful.  If your macros are large it will take longer to run through them so the update will be slower making it less than 10 times a second.  Also, you can get yourself into a mess with the wrong bit of code in a macro.  For what your doing I think a brain would be a much better option.

No, not all the macros in a profiles marcos folder run all the time, the macropump.m1s is the only one and only if it is enabled in general config.  The others run only when called by a button, gcode, etc.

Yes, exactly, it is just the file name as most things in a pc are. KENNETH_macropump.m1s would have never ran the first time. Neither would macr0pump.m1s.  All I changed is the o for a zero......... that one has bitten me more than once.

The .m1s extension is a macro. m4.m1s is the spindle CCW macro.

Brett

 
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #62 on: March 27, 2013, 11:24:06 PM »
Quote
I don't think if the m on macropump was capitalized it would run.

I stand corrected........... one of the other good members sent me a PM informing me that in CB, nothing is case sensitive.  I hesitated to post this because I think consistency is very important in some things.  So, you may well have no problems swapping capitalized letters for lower case and visa verse but I think when doing things of this nature, it is all practice and should be used to enforce good habits, not create bad ones.

Brett   
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline BR549

*
  •  6,952 6,952
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #63 on: March 29, 2013, 01:41:33 PM »
Not exactly sure of what yall are doing BUT have you thought of using the "Execute Button Script" function to terminate the brain ?

Just a thought, (;-) TP
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #64 on: March 30, 2013, 12:05:57 PM »
ok.... what i'm trying to do.
i would like to have LEDs light when i'm jogging or a program is running and the axis are moving.
didn't know which to use, brain,script or whatever there is available. so i started
with script as i did a "little" of that before. let me know which would be better and
i'll erase all i have and start on that.

P.S. i do appreciate ALL ya'll help.
THANKS!!!!!!!!!!!!!!!!!!!!!!!!!
Kenneth

Offline BR549

*
  •  6,952 6,952
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #65 on: March 30, 2013, 07:43:46 PM »
OK look at the axis vel dro, if greater than ZERO turn on a LED else (if = to zero) turn the led off.

If GetDro(6) >0 then  ' If A axis is moving
SetUserLed(2000,1)   'A axis LED
Else
SetUserLed(2000,0)
END IF

Same for all axis you want to monitor.  You can run it as a Brain OR a macropump.

IF you run it as a Macropump ypou need to put in some code to bypass the function IF conditions are the same each pass of the pump to keep from bogging down the MP

 OR am I missing something?

Just a thought, (;-) TP
« Last Edit: March 30, 2013, 07:48:41 PM by BR549 »

Offline BR549

*
  •  6,952 6,952
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #66 on: March 30, 2013, 08:51:20 PM »
This works here from the macropump. IF the led function is current then it bypasses the function .

'Axis Motion LED Control**********************
' X axis LED = 2000
' Y axis LED = 2001
' Z axis LED = 2002


'X axis LED Control***************************

If GetDro(6) > 0 And  GetUserLED(2000) = 0 Then
   SetUserLED(2000,1)
End If

If GetDro(6) = 0 And GetUserLEd(2000) = 1 Then
   SetUserLed(2000,0)
End If

' Y axis LED Control***************************

If GetDro(7) > 0 And  GetUserLED(2001) = 0 Then
   SetUserLED(2001,1)
End If

If GetDro(7) = 0 And GetUserLEd(2001) = 1 Then
   SetUserLed(2001,0)
End If

'Z axis LED Control*****************************
If GetDro(8) > 0 And  GetUserLED(2002) = 0 Then
   SetUserLED(2002,1)
End If

If GetDro(8) = 0 And GetUserLEd(2002) = 1 Then
   SetUserLed(2002,0)
End If

'End of File***********************************

End
  
« Last Edit: March 30, 2013, 08:53:20 PM by BR549 »
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #67 on: April 01, 2013, 07:35:27 AM »
thank you TP and BR549.
this works better as the LEDs don't blink if axis moves a longer than a
1/2".  they're either on or off.

which would be 'better' to use to not to make mach3/computer
do a lot of work for nothing? brain or script(micropump)?
« Last Edit: April 01, 2013, 07:39:58 AM by Kenneth »
Kenneth

Offline BR549

*
  •  6,952 6,952
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #68 on: April 01, 2013, 09:34:03 AM »
In this case the macropump as you can run a bypass type code that does not pulse the LED every pass.

(;-)TP
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #69 on: January 20, 2014, 11:00:37 AM »
getting back into mach3 and getting a controller that will work with it.
i'm having trouble getting "all" the macros to work. some do, some don't
beloew is one that doesn't. i figured if i (ya'll) can fix one, the others will follow :)

not me script(thanks TP)

'Axis Motion LED Control**********************
' X axis LED = 1120
' Y axis LED = 1121
' Z axis LED = 1122


'X axis LED Control***************************
If GetOEMDro(800) > 0 And GetUserLED(1120) = 0 Then
   SetUserLED(1120,0)
End If

If GetOEMDro(800) = 0 And GetUserLEd(1120) = 1 Then
   SetUserLed(1120,0)
End If

' Y axis LED Control***************************

If GetOEMDro(801) > 0 And  GetUserLED(1121) = 0 Then
   SetUserLED(1121,1)
End If

If GetOEMDro(801) = 0 And GetUserLEd(1121) = 1 Then
   SetUserLed(1121,0)
End If

'Z axis LED Control*****************************
If GetOEMDro(802) > 0 And  GetUserLED(1122) = 0 Then
   SetUserLED(1122,1)
End If

If GetOEMDro(802) = 0 And GetUserLEd(1122) = 1 Then
   SetUserLed(1122,0)
End If

'End of File***********************************

End
Kenneth