Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 06:09:30 AM

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
| | |-+  VB script to get and set Z inhibit
Pages: 1   Go Down
Print
Author Topic: VB script to get and set Z inhibit  (Read 286 times)
0 Members and 1 Guest are viewing this topic.
camwoodguy
Active Member

Offline Offline

Posts: 3


View Profile
« on: August 07, 2008, 06: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.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« Reply #1 on: August 07, 2008, 04:09:51 PM »

Try:  doOEMbutton(167)
Logged

All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
camwoodguy
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #2 on: August 09, 2008, 06: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)
Logged
Ron Ginger
Active Member

Online Online

Posts: 266



View Profile WWW
« Reply #3 on: August 09, 2008, 08: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.

Logged
camwoodguy
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #4 on: October 08, 2008, 07:39:48 AM »

Ron,

U-DA-MAN

Worked

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

Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!