Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Saumur on April 24, 2009, 09:42:10 AM

Title: Axis Home question
Post by: Saumur on April 24, 2009, 09:42:10 AM
Guys, I wanted to know if there is an option that doesn't allow you to start an automatic cycle if the light box of the home axis didn't turn green.

As you know the home axis light is red untill you do the home and then turn green.

In other words I'd like to know if yo can choose to block the automatic movement in case the lights( both of them) didn't turn green.

Thanks
Title: Re: Axis Home question
Post by: Hood on April 24, 2009, 09:57:40 AM
You could probably replace the Start button with a VB one and have something like this in the button.

If GetOemLED(807) Or GetOemLED(808) Or GetOemLED(809) Then
 DoOemButton(1003)
  Sleep (100)
   MsgBox("Axis not referenced")
  Else
   DoOemButton(1000)
End If
Title: Re: Axis Home question
Post by: Saumur on April 24, 2009, 11:15:19 AM
Thanks for your fast answer,

from what I understand you can create a VB button and then set it so it sayr error if the lights are not green.

If that is right can you tell me how can I do that?

Thanks again
Title: Re: Axis Home question
Post by: ger21 on April 24, 2009, 11:25:37 AM
Open the screen in Screen4, right click on the button, and set it to VB script. In Mach3, under Operator menu, choose select button script. Click the button, and the script editor will open, allowing you to add the script to the button.
Title: Re: Axis Home question
Post by: Saumur on April 24, 2009, 12:01:11 PM
Thanks for your reply.

One last thing: To open the screen with screen4 do I need a program? if yes where can I download it?

Sorry but I'm a nub on this.

Thanks and regards
Title: Re: Axis Home question
Post by: SteinarN on April 24, 2009, 12:15:03 PM
You find screen4 in the download section here.
Title: Re: Axis Home question
Post by: Saumur on April 24, 2009, 12:42:43 PM
Guys with your help I could do that,

the only problem is that if I put what Hood said it says "terminating script" when I press on Cycle start.

It says the same thingh even if the home lights are green.

Can some1 confirm me if what Hood said to put is right?

Thanks again
Title: Re: Axis Home question
Post by: Hood on April 24, 2009, 01:31:52 PM
Not tried it myself but I will go and do it.
Hood
Title: Re: Axis Home question
Post by: Hood on April 24, 2009, 01:36:42 PM
Just tried it and seems to work fine.
 Did you copy and paste the code into the button?
 Have you checked to make sure it has saved in the button as sometimes the VB buttons dont save.
 Does it work from the Edit VB Button window if you press the green arrow?

Hood
Title: Re: Axis Home question
Post by: Saumur on April 28, 2009, 10:37:15 AM
Thanks for your help Hood,

Anyway if I try using it with the play arrow in the VB edit the message "Axis not referenced" pops out.

Have you any idea what I'm doing wrong?

Anyway in the input option I didn't put the green arrow on the homes since I'm testing this on a laptop.

That could be the problem? If yes what I have to put to test it?

Thanks for your help
Title: Re: Axis Home question
Post by: Hood on April 28, 2009, 10:53:23 AM
You should be getting that message if your axis  are NOT homed, if they are homed then you should not get the message. If you are wanting to simulate the axis being homed then disable the Home switches in Ports and Pins, Inputs and then press the Ref All button, the LEDs should turn green and when you press the arrow in the VB Editor the code should start.

If I am misunderstanding what you are wanting please let me know.
Hood
Title: Re: Axis Home question
Post by: Saumur on April 28, 2009, 11:46:58 AM
Hood,

you understood perfectly what I'm trying to do.

The problems is that even if the leds are green the message I told you pops up.

Just to let you know I put this code :

 If GetOemLED(807) Or GetOemLED(808) Or GetOemLED(809) Then
 DoOemButton(1003)
  Sleep (100)
   MsgBox("Axis not referenced")
  Else
   DoOemButton(1000)
End If

In the cycle start button.

I donĀ“t get why it works for you. I don't know if it matters but I use Mach3 for lathe and I use axes X and Z
If there's something wrong please tell me.

Thanks a lot for your patience
Title: Re: Axis Home question
Post by: Hood on April 28, 2009, 12:00:38 PM
Ah OK sorry, the reason you get that message is that you dont have a Y axis because its a lathe, my fault sorry :(
Ok put this in the button.

If GetOemLED(807) Or GetOemLED(809) Then
 DoOemButton(1003)
  Sleep (100)
   MsgBox("Axis not referenced")
  Else
   DoOemButton(1000)
End If
Title: Re: Axis Home question
Post by: Saumur on April 28, 2009, 12:12:13 PM
Dear Hood,

the last thing you should be is sorry since now it is working. :P

Thanks again for your patience and help.

See you
Title: Re: Axis Home question
Post by: SteinarN on April 28, 2009, 12:13:18 PM
What is the meaning with the line: "Sleep (100)"?
Title: Re: Axis Home question
Post by: Hood on April 28, 2009, 01:58:51 PM
it just gives a 1/10 of a second pause before the VB code will continue to the next line, it may not be needed in reality but I just prefer to have it in there.
Hood
Title: Re: Axis Home question
Post by: Hood on April 28, 2009, 02:06:22 PM
Saumur
 Glad its working, if only I had read your initial post properly it would have been correct from the start :)
Hood
Title: Re: Axis Home question
Post by: SteinarN on April 28, 2009, 02:08:12 PM
Ok, thanks Hood  :)
Title: Re: Axis Home question
Post by: Saumur on October 19, 2009, 11:41:00 AM
Hey Guys,

I'm bringing up this cause I'm trying to do this work on a computer but when I'm in Screen4 if I right click on a button it doesn't allow me to change it to VB script; I right click and nothing happens.

Anyone knows why?

Thanks
Title: Re: Axis Home question
Post by: Hood on October 19, 2009, 11:52:24 AM
Try a double left click on the button.
Hood
Title: Re: Axis Home question
Post by: Saumur on October 19, 2009, 01:27:50 PM
thanks mate