Quote Originally Posted by dec11ad View Post
yes, figured thats just for a guide, used it on g119 cause g111 was already used. could it make a difference?



no i have not, what does x1.25 h1 do?
I was just using a sample value of 1.25" as I noticed that your screen shot showed imperial units...
The H1 value is setting Coordinate System 1

It seems that the code snippet you showed is part of a Library file.
A .LIB file is loaded into memory on Power ON.
Library files are LINKED to G codes via a Parameter screen on the Controller.
The filename is NOT IMPORTANT but it does need the ".LIB" extension not the standard ".MIN" that is generally used for machining programs.
Look through your parameter pages for the G/M Codes page and check what subprogram names are associated with each G code.
Using Library programs is not for beginners by any means as there are lots of things to bring together to get it to work successfully, but don't give up!
I cannot stress to much that you NEED to get your code working in a simple machining program format before you venture into subprograms and then into custom G code (Library files...) as you need to make sure that your code is working first as there are too many things to track down otherwise.
Time to apply the KISS principle! (Keep It Simple Silly)

The subprogram you displayed tells me several things.
The name that needs to be associated with the G code is OPBX
It also take TWO parameters:
X and H
On the line CALL OO10 you can see the code PEI=PX
what this means is that the subprogram is expecting a parameter called X
on the next line the code PHN=PH means that the subprogram is expecting a H parameter to be passed in.
i.e. if the G code is associated with G Code 111 then you can use the program like this:
G111 X(target value) H(target Coordinate System)
so if you were trying to setup the side of a job to X10.525" and set this value into coordinate system 10 then you use this:
G111 X10.525 H10

If you position your probe to the right of the edge, within approx 3/8" and manually zeroset your position to a value appropriate to your approx position, i.e. X10.750 the above code will make the probe move towards the target surface and touch off and then set the edge to X10.525 on coordinate system 10.

If you position to the Left of the target edge, manually zero set to a value smaller than the target value and the probe will move in the X+ direction towards the target surface.

Hope this information helps a little more.
Keep trying.
Brian.