Ok guys I can give a little more info for this one. First off this is on a legacy 88HS (which I really like BTW)
The I(x) function is supposed to return a 1 or 0 based on the status of various control inputs. Like : is the probe touching ? is the door open ? is there enough lube in the reservoir ? is the spindle oriented ? toolchanger home ? etc....
I(x) is only an input. Can not assign it a value. Related values: O(x) are outputs, and G(x) is status of modal g-codes.
In my specific application, I have a probe that will turn itself off after a couple of minutes. One of those Renishaws with a centrifrugal switch- to turn it on you run it at 400RPM for a second, then stop and lock the spindle.
When the probe turns itself off, it goes into a "TOUCH" state. When it is on and clear of the workpiece, it is "NO TOUCH".
So my goal is to look at the state of the probe, and if it is on then I don't need to reinitialize it. Not a huge deal but it can save perhaps 10 seconds per part - and there are enough parts to make that savings very attractive.
The I(7) will also let me verify that the probe has turned on. Currently I use a really clunky routine for that, and getting it down to one line would be sweet.
English bastardized code, showing what I'd like to accomplish:
Code:
L0100 (Subroutine: is probe on? if not turn it on
M6T18 (load probe into spindle
:IsItOn
#WAIT; ( be sure the evaluation is done realtime, not buffered
IF (probe = touch) then goto :TurnOnProbe
IF (probe = notouch ) then goto :AlreadyOn
:TurnOnProbe
S350 M3
G4 P1000
M19
goto :IsItOn (verify that it turned on)
:AlreadyOn
M17 (end of L100) Would also add something saying after 3 failed attempts wait for the operator, etc.
I have no problem with the gotos, subs, etc. Actually pretty proud about writing smart programs - wrote one last week that probed and identified the workpiece as one of 4 different parts and machined to suit. Just having a devil of a time getting it to acknowledge the I(x) variable!
I have tried the following code with no luck.
#V5=I7 ; letter-number like used with D, P, or FX array variables
#V5=I(7) ; letter-number in parenthesis like the example in the book
I'll give it three more headsmacks before I call Fadal. Mostly cuz I'm embarassed that I am missing like one charachter or something and Neal will laugh at me :-)