Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 07:23:29 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Turn off soft limits in macro.....
Pages: 1   Go Down
Print
Author Topic: Turn off soft limits in macro.....  (Read 470 times)
0 Members and 2 Guests are viewing this topic.
jevs
Active Member

Offline Offline

Posts: 31


View Profile
« on: April 03, 2011, 08:06:03 PM »

I have been fighting VB for hours.
How can I tell it to turn off the softlimits if they are on?
I am working on a tool change macro that has to move the Z axis out of it's soft limits.

DoOEMButton(119) will toggle it, but that does me no good if the macro executes while the softlimits happen to be off. If that happens then it just turns the soft limits back on and gives you a reset during the macro because you are out of soft limit area.

I need it to check if soft limits are on and then toggle them to off, but if they are already off do nothing

I have tried this:
SoftLimit = GetOEMLED(23)
If SoftLimit = 1 Then DoOEMButton(119)   

It doesn't work

I have tried this:
If GetOEMLED(23) = 1 Then DoOEMButton(119)

That doesn't work either.

P.S. why in the heck does the window to type in a message always bounce up so you can't see what your typing on this stupid thing!   
Logged
jevs
Active Member

Offline Offline

Posts: 31


View Profile
« Reply #1 on: April 03, 2011, 08:08:46 PM »

Oh if someone has a simple command to just turn soft limits off, that would be great also, but I cant find anything but toggle, which is lame.
Logged
Overloaded
Global Moderator
*
Online Online

Posts: 3,072



View Profile
« Reply #2 on: April 03, 2011, 08:23:57 PM »

Try:

If GetOEMled (23) Then
DoOEMButton (119)
End If

Works here,
Russ
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
Overloaded
Global Moderator
*
Online Online

Posts: 3,072



View Profile
« Reply #3 on: April 03, 2011, 09:00:01 PM »

............... has to move the Z axis out of it's soft limits.

Why do you not have the Soft Limits set up to include the entire range of the available Z travel ?
On mine, anything out of the Soft Limits will hit a Limit or crash into a hard stop.
Just curious,
Russ
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
jevs
Active Member

Offline Offline

Posts: 31


View Profile
« Reply #4 on: April 03, 2011, 09:17:26 PM »


If GetOEMled (23) Then
DoOEMButton (119)
End If

This seems to work, but how come no variable? It just assumes IF "on" Then? I guess if wanting to tell if it is off then you would do something like this-IF NOT GetOEMLED(23) Ten.......?


As for getting out of the softlimits......I don't want to be able to jog out of the "machinable" area when I am manually jogging the machine. So my softlimit is set at the home switch of Z which happens to be in the middle somewhere. Above this home switch tool change occurs. See the video here for better understanding. This was just a manual jog to show a tool change. I have the macro working now, I just have to get it counting the tools next and keeping track of which one it is on. 
http://www.youtube.com/watch?v=W-0q5uM8jbU
Logged
jevs
Active Member

Offline Offline

Posts: 31


View Profile
« Reply #5 on: April 03, 2011, 09:19:13 PM »

Oh and there is a limit switch at the top of the tool change area and at the bottom of the z that are the hard limits in series tied to the Z limit input. So, it is still safe......
Logged
Overloaded
Global Moderator
*
Online Online

Posts: 3,072



View Profile
« Reply #6 on: April 03, 2011, 09:33:56 PM »

Don't know much about VB, just what I've seen in examples from others.
What you mention would probably work.
Good luck with the rest of it, plenty of examples around the forum for the tool change.
Russ
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
AndrewM
Support Tech
Administrator
*
Offline Offline

Posts: 185




View Profile
« Reply #7 on: April 06, 2011, 12:49:15 PM »

I'm still learning VB but I pulled this out of the script I use to do my homing, dont know if it will help but...

If CBool(GetOEMLED(MachSoftLimitsONLED)) Then
      DoOEMButton(MachSoftlimitsToggle) 'Turns Soft Limits OFF(or Off)
End If
Logged

jevs
Active Member

Offline Offline

Posts: 31


View Profile
« Reply #8 on: April 06, 2011, 01:28:14 PM »

Thanks, I got my tool changer macro done, the previous posters method worked fine. You can see the code here if you want:

http://www.machsupport.com/forum/index.php/topic,18069.0.html

Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!