Hello Guest it is March 28, 2024, 12:43:06 PM

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

0 Members and 1 Guest are viewing this topic.

Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #30 on: March 20, 2013, 08:21:41 AM »
currently
dro 2000 = 0.00
dro 2001 = +10.00
dro 2002 = +27978.00

in the vb editor if i change UserDRO(2002 .CurrZPos)
to UserDRO(2002 .0) the number changes to zero. if set back to
UserDRO(2002 .CurrZPos) changes back to +27978.00
Kenneth
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #31 on: March 20, 2013, 10:08:21 AM »
one more thing. the three userdro(2000,2001,2002)
i can enter info into 2001 and 2002, press enter and the info
remains. when i try that with 2000, it always goes back to zero.
ALL three have the same info in machscreen, except for oem code.
Kenneth

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #32 on: March 20, 2013, 10:33:34 AM »
Are you useing 2000 in another macro or for soemthing else in the screen already?  Looks like the code in last few post is writing to dro 2000.  If that code is running in a macro pump you can enter what you want and every time the macro runs it will rewrite it to what you have told the macropump to.

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!
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #33 on: March 20, 2013, 11:07:59 AM »
no sir, that is the only dro 2000. this is the first
i use 2000,2001 and 2002.
Kenneth
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #34 on: March 20, 2013, 11:34:46 AM »
just to make sure i didn't do something i shouldn't,
i changed from Version R3.043.066 to Version R3.043.062
cause i read 66 was unstable.
Kenneth

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #35 on: March 20, 2013, 02:54:31 PM »
Going back to .062 should be fine.

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!
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #36 on: March 21, 2013, 01:48:57 PM »
got this to work. it changes the dros but the leds only change if dros
are different(off) otherwise if same(on). does change anything
when movement.


X_MovingLED = 1120
Y_MovingLED = 1121
Z_MovingLED = 1122

CurrXPos = GetOEMDRO(800)
OldXPos = GetUserDRO(2001)
CurrYPos = GetOEMDRO(801)
OldYPos = GetUserDRO(2002)
CurrZPos = GetOEMDRO(802)
OldZPos = GetUserDRO(2003)

While IsMoving()
Wend
If CurrXPos <> OldXPos Then
   SetUserLED(X_MovingLED,1)
    SetUserDRO(2001,CurrXPos)
Else
   SetUserLED(X_MovingLED,0)
    SetUserDRO(2001,CurrXPos)
End If
While IsMoving()
Wend

If CurrYPos <> OldYPos Then
   SetUserLED(Y_MovingLED,1)
    SetUserDRO(2002,CurrYPos)
Else
   SetUserLED(Y_MovingLED,0)
    SetUserDRO(2002,CurrYPos)
End If
While IsMoving()
Wend

If CurrZPos <> OldZPos Then
   SetUserLED(Z_MovingLED,1)
    SetUserDRO(2003,CurrZPos)
Else
   SetUserLED(Z_MovingLED,0)
    SetUserDRO(2003,CurrZPos)
End If
         
« Last Edit: March 21, 2013, 01:52:17 PM by Kenneth »
Kenneth

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #37 on: March 22, 2013, 03:58:59 PM »
Isn't that the same code, I posted up for you, with the exception you added while IsMoving()?
If so, DON'T put a while IsMoving() in a macro pump (if that is where you put it), it will cause you PROBLEMS.
Also, If your LED are showing reversed logic, then swap the 1 and 0.
OR, if your mapping them through a brain for some other reason, invert the input.

scott
fun times
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #38 on: March 25, 2013, 05:51:02 AM »
the same code, except i changed my dros from 0,1,2 to 800,801,802 and it started working.
this is a VB script. not using brain or pump(not sure what's a macro pump). it doesn't change
the leds UNLESS i change the position of ON(1) and OFF(0) in the scrip.
so maybe i'm using the scrip wrong.
 Thanks Scott.

there's a reason why there're two sets of dros?
0,1,2 and 800,801,802
« Last Edit: March 25, 2013, 05:57:29 AM by Kenneth »
Kenneth
Re: Terminate a brain with "run macro M650.m1s" ???????
« Reply #39 on: March 26, 2013, 07:38:02 AM »
using your code, the LEDs change if the two DROs are different(on)
OR that same.(off) not if they are moving. so i was trying different things.
Kenneth