Hello Guest it is April 18, 2024, 11:55:25 PM

Author Topic: Hole Counter  (Read 5976 times)

0 Members and 1 Guest are viewing this topic.

Hole Counter
« on: May 30, 2012, 03:02:19 AM »
I am new to brains and not sure if this will work.  I would like to count the number of time I drill a hole.  This way I can see what life I am getting out of the bit.  Can brains do this?

Thanks.  Eddy

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Hole Counter
« Reply #1 on: May 30, 2012, 03:22:36 AM »
Eddy - please do not cross post - especially numerous times. you already have an active thread for this here http://www.machsupport.com/forum/index.php/topic,20499.msg142371.html#msg142371
« Last Edit: May 30, 2012, 03:25:51 AM by stirling »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Hole Counter
« Reply #2 on: May 30, 2012, 10:59:16 PM »
You really don need a macro pump or brains to do that. Just some simple Gcode.

I assume you are using a Sub program to do the drilling. If so then insert a

#500 = [#500+1]

 at the end of the sub. Each time the sub cycles it increments the #var 1 number. The #vars 500-600 are persistant and Mach3 SAVES them in the XML when it shuts down.

You can use the Var monitor to Do a query on the value of #500 and you have your running hole count.

IF you need to ZERO the VAR from the MDI #500=0 enter.

Just a thought, (;-) TP

Re: Hole Counter
« Reply #3 on: June 01, 2012, 01:19:16 AM »
Thanks for you help.  Is there a way with Screen 4 to display that variable?  I found the GCode Var Monitor.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Hole Counter
« Reply #4 on: June 01, 2012, 08:52:24 PM »
SUre, Drop a UserDro on the screen say OemDro(2000)

Then you would need to create a macropump or add to the existing MP

'Macro to update Dro
SetOemDro(2000, GetVar(500))

(;-) TP

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Hole Counter
« Reply #5 on: June 02, 2012, 04:37:49 AM »
just as an alternative view, the reason you used a gcode var in the first place was...

You really don need a macro pump or brains to do that. Just some simple Gcode.
which of course was quite right, but now that you want to display it in a DRO you HAVE to use some macro coding so there's no point in using the gcode var anymore as the DRO will act as the var/counter.

Plus it seems a tad round the houses setting a gcode var to some value and then monitoring it in the macropump to see what it was you just set it to so you can copy it to another place.  ;)

So like T says you'd drop a DRO onscreen and then in your gcode in place of your #500 = [#500+1]  you'd have (say) M666 (other numbers are available), where its code would be:

SetOEMDRO(2000, getOEMDRO(2000) + 1)

Plus of course you can now set/reset the val anytime to anything by typing in the DRO itself.

Ian