Hello Guest it is April 27, 2024, 09:45:51 PM

Author Topic: VB script to get and set Z inhibit  (Read 5306 times)

0 Members and 1 Guest are viewing this topic.

VB script to get and set Z inhibit
« on: August 07, 2008, 07:08:43 AM »
I'm hoping I can get a little help with this one. I've written and ATC macro, things were going along well, so I loaded up some tool and clicked on the Z inhibit to keep from crashing and.........problem. The Z inhibit prevents the machine from going to the proper location.

So I added this to my script:

Cur_Z_Inhibit = GetOemLed(52)           'get the state of the z inhibit for later use
  If Cur_Z_Inhibit  = 1 Then                ' if the Z inhibit is active
   dobutton(167)                              ' push the Z inhibit button to turn it off
   While ISMoving()                           ' wait for it
   Sleep 100                                    'wait for it
   Wend                                        ' done waiting
   End If                                        'end condition statement


BUT NOTHING HAPPENS. The led flashes thru the entire atc macro.   Any Ideas???

Thanks all.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: VB script to get and set Z inhibit
« Reply #1 on: August 07, 2008, 05:09:51 PM »
Try:  doOEMbutton(167)
fun times
Re: VB script to get and set Z inhibit
« Reply #2 on: August 09, 2008, 07:06:51 AM »
poppabear,

Here's what i did. Made the change to    doOEMbutton(167)     
no luck
So, I made a new button and programmed it to   doOEMbutton(167)
when I press the button it turned of the z inhibit, so I'm sure that that line of code is correct.

Next I commented the surrounding  lines of code except the doOEMButton(167) in my script.
That turned it off.  Ok making progress.

Then I changed the If statement to: If getoemled(52) = 1   and tried that.

Still no luck. It has to be in the If /Then statement but I'm ........

 
Inhibited  (so to speak)
Re: VB script to get and set Z inhibit
« Reply #3 on: August 09, 2008, 09:02:43 PM »
The while IsMoving loop is not needed here, thats only when Gcode is being executed and you need to wait for it to complete. That probably doesnt hurt anything, since there is nothing moving it falls right thru.

Try the if test like this:

IF Cur_Z_Inhibit then
  DoOEMbutton(167)
END IF

TRUE should be 1, but any positive number is OK, so maybe the LED function is returning some other positive number.

Re: VB script to get and set Z inhibit
« Reply #4 on: October 08, 2008, 08:39:48 AM »
Ron,

U-DA-MAN

Worked

Sorry for the slang, but suddenly I'm felling un-inhibited!!!!