Hello Guest it is May 30, 2023, 03:08:35 AM

### Author Topic: Soft Limits On/Off  (Read 2693 times)

0 Members and 1 Guest are viewing this topic.

#### Flipz01

• 108
##### Soft Limits On/Off
« on: June 19, 2009, 11:06:55 AM »
This is interesting.  Anybody know why this happens?

On our router, the tool rack is at the back.  It is a good thing to limit the machine movements so that you can't jog the current tool into the tools in the rack, so I set the soft limits at Y=30.00".  The tools are at Y=34".

Here's the fun part.  The Y-limit is at Y=36.00".  So, if I home the machine with the soft limits set to Y=30.00", I get a reset because I'm out of the soft limit range at the home switches.  So in the VB Script for the "Find Limits" button, I turn off the soft limits, home the machine, move to Y=29.50", and then turn the soft limits back on.  To do that, I poll the LED that tells me if soft limits are active.  If they are active, I turn them off.  Simple - right?

Ah, NO!

To make an output toggle on / off, I set up a USERLED.  I read that it is on or off, and turn the output on / off accordingly, like this:

If GetUSERLED(1017) = 1 Then
SETUSERLED (1017,0)
DeActivateSignal(Output7)
Else
SETUSERLED (1017,1)
ActivateSignal (Output7)
End If

What's that got to do with soft limits?  Well, the Soft Limits toggle is OEMButton(119) and the Soft Limits indicator is OEMLED(23), so I should be able to do this:

If GetOEMLED(23) = 1 Then       'If the Soft Limits LED is lighted
DoOEMButton(119)                   'Toggle the Soft Limits to Off

However, this does not work.  I can use this exact line to read if the light is off and turn the Soft Limits on, but not the other way.  So, here's what I do:

If GetOEMLED(23) = 1 Then
DoOEMButton(119)              'Should turn off the Soft Limits - but it doesn't
Else
DoOEMButton(119)              This time they go off
End If

The above actually works every time, I just don't understand why I have to do it.  Any ideas?
« Last Edit: June 19, 2009, 11:36:50 AM by Flipz01 »