Hello Guest it is October 24, 2021, 11:23:15 PM

Author Topic: User DRO (Counter)  (Read 11486 times)

0 Members and 1 Guest are viewing this topic.

User DRO (Counter)
« on: March 04, 2013, 09:46:17 AM »
i usually cut pockets and i woud like a userdro to count each time Z move to the
next depth to cut the pocket. ex.  g1 f4 z-.1 DRO 1...g1 f4 z-.2 DRO 2 ....etc.
but not count just because Z moves. is this possible and do i use a brain ?
Thanks for any help !
Kenneth
Re: User DRO (Counter)
« Reply #1 on: March 04, 2013, 12:18:20 PM »
can someone at least let me know if this is possible ?
brain....script .... voodoo ?

Thanks :)
Kenneth
Re: User DRO (Counter)
« Reply #2 on: March 04, 2013, 02:25:32 PM »
i wrote this(with a lot of reading)don't think it's posssible from what i read.
it works in the VB editor. but not in Mach3.
do i use M1001 in the MDI ?

file name = C:\Mach3\macros\MyMill\M1001.m1s
Count = GetUserDRO(1010)
Count = GetUserDRO(1010)+1
While IsMoving
Wend
SetUserDRO(1010 , Count)   
« Last Edit: March 04, 2013, 02:39:16 PM by Kenneth »
Kenneth
Re: User DRO (Counter)
« Reply #3 on: March 04, 2013, 03:19:32 PM »
in the VB editor, it changes the dro with each run.
but if i use m1001 in mdi, nothing.
can someone tell me what i'm missing ?
Thanks
Kenneth
Re: User DRO (Counter)
« Reply #4 on: March 04, 2013, 04:56:51 PM »
Try a sleep after the SetUserDRO

sleep (1000) 'command is either in seconds or milliseconds depending on your defaults.
might be, it is blowing right thru the command and never get a screen updated.
  or you could try another while loop
sounds like your close. Never give up

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: User DRO (Counter)
« Reply #5 on: March 04, 2013, 05:04:57 PM »
Try this Kenneth

Count = GetUserDRO(1010)
Count2 = Count+1
SetUserDRO(1010,Count2)

Not my work so I can't take credit but I bet it will work.

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 Dan13

*
  •  1,208 1,208
    • View Profile
    • DY Engineering
Re: User DRO (Counter)
« Reply #6 on: March 05, 2013, 01:26:52 AM »
In order for it to work at all you need to call your macro (M1001) after each time your Z is lowered. Unless you actually have M1001 in your Gcode it will do nothing.

Dan
Re: User DRO (Counter)
« Reply #7 on: March 05, 2013, 06:01:54 AM »
thanks Ya-Nvr-No, Brett and Dan13.
Ya-Nvr-No   don't know where the sleep setting is.
i tried it but no idea if working :)
Brett, i used what you had and same results. works in
VB but not in MDI.
Can13. i have it in the gcode but it does nothing. i should be able to
use mcodes in the MDI, shouldn't i ?
Thanks

and the brain is enabled in control
« Last Edit: March 05, 2013, 06:11:59 AM by Kenneth »
Kenneth
Re: User DRO (Counter)
« Reply #8 on: March 05, 2013, 06:03:12 AM »
code....
G20 G40 G49 G54 G80 G90 G91.1
G0 Z0.2
M1001
M06 t4
G00 G90 G54 X1.435 Y1.435
Kenneth
Re: User DRO (Counter)
« Reply #9 on: March 05, 2013, 06:44:04 AM »
i set sleep 200 and can see the hesitation. still same output.

Count = GetUserDRO(1010)
While IsMoving( )
Wend
Count2 = Count+1
While IsMoving( )
Wend
Sleep 200
SetUserDRO(1010,Count2)
End
     
Kenneth