Hello Guest it is May 22, 2019, 05:31:01 PM

Author Topic: CAUTION! User LED's Turn on with opening wizards  (Read 7972 times)

0 Members and 1 Guest are viewing this topic.

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #20 on: February 20, 2013, 11:10:02 AM »
Dan I home externally but I use VB calls not LEDs.
Hood

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #21 on: February 20, 2013, 12:04:35 PM »
Ian,

You're right, it doesn't matter who does the homing first. I just feel more comfortable having the drive finish its task and then allow Mach to take control over. I agree though that the end result is the same.

Dan I home externally but I use VB calls not LEDs.
Hood

And you don't use buttons 22, 23,, 24?

Dan

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #22 on: February 20, 2013, 01:03:35 PM »
Fair enough Dan.

BTW - if you don't mind me asking - did you build your RS485 yourself or is it out of a box?

Ian

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #23 on: February 20, 2013, 01:20:43 PM »
The RS485 is out of a box, Ian.

Dan

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #24 on: February 20, 2013, 01:21:41 PM »
Yes Dan I use them but not User LEDs.
Heres my button script

DoOemButton (240)                     'De-Reference All axis
 Sleep(10)
 If GetOemLED (809) Then               'Check that Ref Z LED is RED
  Do
   Call SetModOutput (21,1)             'Activate ModOutPut 20
    If GetInput(19) Then Exit Do       'Loop until ModInPut 18 is seen
    Sleep (10)
    Loop
    End If
    Call SetModOutPut (21,0)            'DeActivate ModOutPut 20
    DoButton (24)  

etc etc
Hood

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #25 on: February 20, 2013, 01:23:12 PM »
Just bought a RS485 to connect the new servo drives I have to their config software, its working well and price wasnt too bad :-)

http://www.ebay.co.uk/itm/280710974444?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

Hood

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #26 on: February 20, 2013, 02:13:01 PM »
Thanks for the snippet, Hood. I don't understand your first If statement. You first de-referenced the axes and then you're checking if it's really de-referenced? Why? Also, the conditional is not clear to me - your checking if LED 809 is active? Should it be '1' when red? Just tried to map it to a DRO and it's showing -1 for red and 0 for green.

The Do loop is interesting. Didn't know you could use such syntax to exit the loop. Will read the manual about the Do loop. Was always using While loops.

Dan

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #27 on: February 20, 2013, 02:49:45 PM »
I am looking at the state of the Ref LED for starting the loop so I have to de-ref first step so that it is in the correct state.
The Red for the homed LEDs are seen as active state, green inactive (if thats proper terminology ;) )

I have used the DoLoop for years, first used it on the big lathes turret, found it in a VB for dummies book I think, which incidentally is still too advanced for me to read and understand

Hood

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #28 on: February 20, 2013, 03:30:28 PM »
I am looking at the state of the Ref LED for starting the loop so I have to de-ref first step so that it is in the correct state.
The Red for the homed LEDs are seen as active state, green inactive (if thats proper terminology ;) )

Not sure I understand. Still think it would work even without that If statement...

I have used the DoLoop for years, first used it on the big lathes turret, found it in a VB for dummies book I think, which incidentally is still too advanced for me to read and understand

;D afraid we are in the same boat there.

Dan

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #29 on: February 20, 2013, 04:43:21 PM »
Yes Dan it would work fine without the If statement, at the time I thought I would need it but have since done some without and they work fine. Just dont change what works is my motto :-)

Hood