What's new
What's new

Fanuc 31i custom probe macro - is it possible?

Uhrenholt

Aluminum
Joined
Jan 28, 2016
Hi,

Im new here and from Denmark.

Last Friday I got a Renishaw OMP40-2 probe up and running on a Matsuura VX-1000 with Fanuc 31i- model B control. Making small programs for finding corners on steel plates for stamping tools, is rather time consuming, as I have to load the individual programs for the corner i want my zero, and I have to manually change the P in G10, and the S in the macro for the probe, to get the offset G54-59.

So Im to write a macro to handle this, but with almost none experience with Fanuc controls, and absolutely no experience making macros. I would like some inputs on this small program that I have made. I dont have a colleague that can help me with this stuff, as the two other men who uses the machine, totally rely on code from Edgecam, and cant do any programming manually. Asked one of the guys a while back if he knew what G0 was, and the reply was "no, I program in Edgecam"

Ordered this book yesterday: Cnc Programming Using Fanuc Custom Macro B,Kumares C. Sinha

But it will take at least a week to arrive, so I would like some inputs on this, as I don't know anybody working with Fanuc controllers. Toolmakers around here use DMG machines with Heidenhein or Siemens controls...

Done a lot of reading this weekend, and i think it might work.?

M58 turns probe on
M85 turns probe off

Code:

O9... (G666E..R...)
#100 = [#8 -53.] ( E54-59 = G54-59)
IF [#100 GT 59.] GOTO 1000 (Safety for Offset, 59 max)
IF [#100 LE 54.] GOTO 1000 (Safety for Offset, 54 min)
IF [#18 EQ 0.] GOTO 100 (R0 = Bottom Left)
IF [#18 EQ 90.] GOTO 200 (R90 = Bottom Right)
IF [#18 EQ 180.] GOTO 300 (R180 = top Right)
IF [#18 EQ 270.] GOTO 400 (R270 = Top Left)
GOTO 1000
N100 (External - Bottom Left + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X10. Y10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X-7. Y-7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
M05
GOTO 1000
N200 (External - Bottom Right + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X-10. Y10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X7. Y-7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
GOTO 1000
M30
N300 (External - Top Right + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X-10. Y-10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X7. Y7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
M05
GOTO 1000
N400 (External - Top Left + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X+10. Y-10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X-7. Y7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
M05
GOTO 1000
N1000
M30

Any input is greatly appreciated.

cheers,

Daniel Uhrenholt
 
Last edited:
well, it didn't work...

I tried without the offset input, but it still just reads the first line of the program and jumps to N1000 and ends the program.

I call the program with G65P9010R0, but nothing happens...

What am I doing wrong?

First lines of program:
O9010 (Probe Macro)
IF [#18 EQ 0] GOTO 100 (R0 = Bottom Left)
IF [#18 EQ 90] GOTO 200 (R90 = Bottom Right)
IF [#18 EQ 180] GOTO 300 (R180 = top Right)
IF [#18 EQ 270] GOTO 400 (R270 = Top Left)
GOTO 1000
N100 (External - Bottom Left + Z)
G00 G17 G40 G80 G90
G54
M58 (PROBE ON)
G43
G10 L2 P1. X#5021 Y#5022 Z-710.
G65 P9810 X10. Y10. F3000.
G65 P9811 Z0. S1.
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X-7. Y-7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S1.
G65 P9810 Z10. F3000.
M85 (PROBE OFF)
G0 M9
M05
GOTO 1000

Cheers, Daniel
 
well, it didn't work...

I tried without the offset input, but it still just reads the first line of the program and jumps to N1000 and ends the program.

I call the program with G65P9010R0, but nothing happens...

What am I doing wrong?

First lines of program:
O9010 (Probe Macro)
IF [#18 EQ 0] GOTO 100 (R0 = Bottom Left)
IF [#18 EQ 90] GOTO 200 (R90 = Bottom Right)
IF [#18 EQ 180] GOTO 300 (R180 = top Right)
IF [#18 EQ 270] GOTO 400 (R270 = Top Left)
GOTO 1000
N100 (External - Bottom Left + Z)
G00 G17 G40 G80 G90
G54
M58 (PROBE ON)
G43
G10 L2 P1. X#5021 Y#5022 Z-710.
G65 P9810 X10. Y10. F3000.
G65 P9811 Z0. S1.
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X-7. Y-7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S1.
G65 P9810 Z10. F3000.
M85 (PROBE OFF)
G0 M9
M05
GOTO 1000

Cheers, Daniel

Hello Daniel,
Assuming that the code listed above are the first Block from your Post #1 program, the first mistake, irrespective of whether the program set the Offsets correctly, or not, is that you terminate Program O9010 with M30 and not M99. Clearly you must be Calling O9010 from another program, as you seem to be passing a value to Local Variable #18 in O9010. The result is that control will not return to your Calling Program when O9010 completes. If O9010 is being called via MDI, then this will not be an issue, but typically its poor form.

Are Macro Programs P9810 and P9811 created by you, or are they proprietor programs from another source? To be able to advise as to why your program is not working, the content of these programs would have to be listed for the Forum to see.

Although G10 can be used to set Work-shift Offsets, I prefer to access the System Variable directly. I find that its easier to write an algorithm to specify the focus Work-shift and Axis and a more flexible Macro when the System Variable is accessed directly. The following is an example of determining the System Variable for the focus Work-shift and Axis from arguments passed by the Calling Program.


IF [#24 GT #0] THEN #1=1
IF [#25 GT #0] THEN #1=2
IF [#26 GT #0] THEN #1=3

#[5200 + [20 * #19] + #1] = #[5020 + #1]

In the above example, if an argument were to be passed by address "X" in the Calling Block and a Work-shift number (1 to 6 for G54 to G56) specified by address "S" (address S(#19) has become a convention for passing Work-shift number in Macro Programming), lets say S1, then the System Variable accessed would be #5221. Accordingly, the current Machine Coordinate for the X axis (#5021) would be allocated to the G54 Work-shift for X.

Regards,

Bill
 
Hi, thanks for the reply:-)

My thought was to combine the 4 small programs that I made in one program and make it so i can call it by a custom G code. The thing about work offsets, was an idea I got yesterday, but for now I just need to get the macro working without offsets. We mainly use G54, so that is fine for now, I will make another Macro when I have a better understanding of programming it.

The P9810 and P9811 is the macros from renishaw

The O9010 is called with G666 and an R value to determine the corner of the workpiece. I can run the macro from MDI, but the R value doesn't work, as it just goes directly from N100 whatever I write. But it works in the bottom left corner:-)

I use argument #18 as this is R, and the value from the G666 R90 is used in IF [#18 EQ 90] GOTO 200 (R90 = Bottom Right)? Why doesn't it jump to N200?

My understanding of IF and GOTO, is that you can jump around in a program using N numbers? My english isn't that great, but I understand the meanings GT,EQ etc. I like working with this stuff, but I Really need to read that book and make some exercises to really understand this...

Cheers,

Daniel Uhrenholt
 
Hi, thanks for the reply:-)

My thought was to combine the 4 small programs that I made in one program and make it so i can call it by a custom G code. The thing about work offsets, was an idea I got yesterday, but for now I just need to get the macro working without offsets. We mainly use G54, so that is fine for now, I will make another Macro when I have a better understanding of programming it.

The P9810 and P9811 is the macros from renishaw

The O9010 is called with G666 and an R value to determine the corner of the workpiece. I can run the macro from MDI, but the R value doesn't work, as it just goes directly from N100 whatever I write. But it works in the bottom left corner:-)

I use argument #18 as this is R, and the value from the G666 R90 is used in IF [#18 EQ 90] GOTO 200 (R90 = Bottom Right)? Why doesn't it jump to N200?

My understanding of IF and GOTO, is that you can jump around in a program using N numbers? My english isn't that great, but I understand the meanings GT,EQ etc. I like working with this stuff, but I Really need to read that book and make some exercises to really understand this...

Cheers,

Daniel Uhrenholt

Hello Daniel,
You need to ensure that the data being passed equates to the same units its being compared with in your Conditional Statements. Depending of the System Configuration of the machine, data being passed without a period may vary in its value. Units used for argument data passed without a period correspond to the least input increment of each address. Accordingly, if the unit used for comparison in the Conditional Statement has a period, and the Argument being passed has not (or visa versa), then the Conditional Statement may not test True. Therefore, it's good practice to use periods in Macro Call Arguments and Comparison units to maintain program compatibility. If the units vary, then all of the Conditional Statements should Test False, resulting in the program trickling down to the GOTO 1000 Block, thus bypassing all code. Therefore, it would seem that Local Variable #18 may be vacant, notwithstanding that you believe a value is being passed.

Try putting "M00" in the O9010 program just before the first Conditional Statement. Execute the program ensuring a value is being passed with Argument Address R in the Call Block. When the program halts at M00, check the value of #18 in the Macro Variable Registry Page; it should display the value passed by the Macro Call Block.

Although a Minor point and it would have no effect on whether your program worked, or not, to be more aligned with convention, I would use the Arguments 1,2,3 and 4 to relate to the Quadrants of the Cartesian Coordinate System. 1 being the first quadrant (Top Right), advancing in a Counter Clockwise direction for the other three Quadrants.

Regards,

Bill
 
Last edited:
Hello again Bill,

I'm not familiar with periods, what about a loop?

Had some problems with a bore cycle with the probe today, so had to read in the manual to find a fault code. In the back of the instruction book, there was a list of used variables by renishaw.

Variable arguments used #1-#33

Variables not used #100-#115

Maybe more non used variables, but have to look tomorrow, as I'm home from work now.
I have to do so I can use #1-#26 for commands in O9010 without having the other macros doing odd stuff:-)

I will read some more later this evening, I need that book:-)

Any good online training with Fanuc controls and macros?

Cheers, Daniel
 
Thanks:-)

I know about it if no decimal point, the control reads the value in microns.

I did a lot of stuff thru the day, I think I need to think a little about tomorrow morning and try again. My head is exploding at the moment, I want to learn the control! As I can see that the jobs in the area where I live are as machinists, and they use Fanuc or something similar. No good courses in the area and none with Fanuc, Fanuc Scandinavia has educations and training, but it costs big $ a day, and are in the other end of the country or Sweden!

Did a lot arduino programming some years ago, and a bit of real C++. Working at the local university as an Mechanical Assistant Engineer, designing and manufacturing parts for robots and satellites, and building Tesla coils and other electronics in my spare time. So I hope this comes rather easy:-)

Cheers, Daniel
 
Thanks:-)

I know about it if no decimal point, the control reads the value in microns.

I did a lot of stuff thru the day, I think I need to think a little about tomorrow morning and try again. My head is exploding at the moment, I want to learn the control! As I can see that the jobs in the area where I live are as machinists, and they use Fanuc or something similar. No good courses in the area and none with Fanuc, Fanuc Scandinavia has educations and training, but it costs big $ a day, and are in the other end of the country or Sweden!

Did a lot arduino programming some years ago, and a bit of real C++. Working at the local university as an Mechanical Assistant Engineer, designing and manufacturing parts for robots and satellites, and building Tesla coils and other electronics in my spare time. So I hope this comes rather easy:-)

Cheers, Daniel

Hello Daniel,
As you have done some C++ programming, you should be aware that when debugging, you have to make sure that certain Variables are taking on the correct values; nothing is changed with the User Macro language. If your program is always falling through to N100 then #18, Local Variable in program O9010, must be equating to Zero. Confirm what the value of #18 is in the scope of program O9010 by doing as I suggested in Post #5, then you can start looking for reasons for the result if the Variable doesn't have the value you expect.

Regards,

Bill
 
Hi,

Im new here and from Denmark.

Last Friday I got a Renishaw OMP40-2 probe up and running on a Matsuura VX-1000 with Fanuc 31i- model B control. Making small programs for finding corners on steel plates for stamping tools, is rather time consuming, as I have to load the individual programs for the corner i want my zero, and I have to manually change the P in G10, and the S in the macro for the probe, to get the offset G54-59.

So Im to write a macro to handle this, but with almost none experience with Fanuc controls, and absolutely no experience making macros. I would like some inputs on this small program that I have made. I dont have a colleague that can help me with this stuff, as the two other men who uses the machine, totally rely on code from Edgecam, and cant do any programming manually. Asked one of the guys a while back if he knew what G0 was, and the reply was "no, I program in Edgecam"

Ordered this book yesterday: Cnc Programming Using Fanuc Custom Macro B,Kumares C. Sinha

But it will take at least a week to arrive, so I would like some inputs on this, as I don't know anybody working with Fanuc controllers. Toolmakers around here use DMG machines with Heidenhein or Siemens controls...

Done a lot of reading this weekend, and i think it might work.?

M58 turns probe on
M85 turns probe off

Code:

O9... (G666E..R...)
#100 = [#8 -53.] ( E54-59 = G54-59)
IF [#100 GT 59.] GOTO 1000 (Safety for Offset, 59 max)
IF [#100 LE 54.] GOTO 1000 (Safety for Offset, 54 min)
IF [#18 EQ 0.] GOTO 100 (R0 = Bottom Left)
IF [#18 EQ 90.] GOTO 200 (R90 = Bottom Right)
IF [#18 EQ 180.] GOTO 300 (R180 = top Right)
IF [#18 EQ 270.] GOTO 400 (R270 = Top Left)
GOTO 1000
N100 (External - Bottom Left + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X10. Y10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X-7. Y-7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
M05
GOTO 1000
N200 (External - Bottom Right + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X-10. Y10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X7. Y-7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
GOTO 1000
M30
N300 (External - Top Right + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X-10. Y-10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X7. Y7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
M05
GOTO 1000
N400 (External - Top Left + Z)
G00 G17 G40 G80 G90
G#100
M58
G43
G10 L2 P#100 X#5021 Y#5022 Z-710.
G65 P9810 X+10. Y-10. F3000.
G65 P9811 Z0. S#100
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X-7. Y7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S#100
G65 P9810 Z10. F3000.
M85
G0 M9
M05
GOTO 1000
N1000
M30

Any input is greatly appreciated.

cheers,

Daniel Uhrenholt

Whenever I write measuring routines I am trying to minimize the involvement of the operator. Therefore few questions on the beginning:
1. Do your parts, as you place them on the machine, different much one from each other in length, width and height?
2. What are this differences ?
3. Do you have some positioning stoppers to position the part as it is placed on the table ?

Having the answers to these question will allow me to give you better solution.
 
Thats what I'm trying to do:-)

The parts comes in all sizes, and are mounted in vise or directly on the table. It does not run production of parts, max series of 3 but mostly 1. I know what I want, but have a little problem explaining it because of my English skills...

I got it working, as I now know where to look for the macro variables and their values:-)

I do however have a little problem with a single surface measurement, that I'm also working on.

I'm writing this from my phone, so don't slaughter me for not remembering the Probe macros:-)

I want to find X zero, and have to be roughly X-5. from the side of the plate an approx -5mm down from where I want my Z zero, so the probe has something to measure on.

My question is how do I do this? Here is the code as I remember it:

G10 L2 P1 X-5.
G65P9810 X-5. F3000
G65P98XX X0 F3000
G65P9810 X-5. F3000

#5521=-15. Before G10 and X#5521 in G10?

I have to take a look at the more dynamic method of determining offsets using variables posted earlier by Bill:-)

The G10 gives the value out from machine zero to the workpiece I think, a number rather larger than Z-5. :-)
I tried it just before I went home today.

Can I [ ] something in G10 X? Rather than in the first lines of the program?

Cheers, Daniel
 
Last edited:
Whenever I write measuring routines I am trying to minimize the involvement of the operator. Therefore few questions on the beginning:
1. Do your parts, as you place them on the machine, different much one from each other in length, width and height?
2. What are this differences ?
3. Do you have some positioning stoppers to position the part as it is placed on the table ?

Having the answers to these question will allow me to give you better solution.

The macro I just got working can be uses everywhere on the table at any hight. The Z value is from the spindle nose in G53 reference point to the table. So move the probe roughly 10mm over the corner you want and push start.
The first thing it does is zero X and Y and running the Surface Z macro from there, it goes X 10 Y 10 and goes down until it hits the surface, Z0 in G54 is known now. Then it uses the corner finding macro and finds the real zero in G54. This is possible as the probe macro has about 5mm it goes below the given Z value in the program call.

I had to do something simple, as two other people don't understand English etc. The small programs that I made had a comment from a colleague, that was rather unhappy with the English names I gave them. He said "why couldn't you name them in Danish?", I gave up explaining him that the names I gave them was the same as the probing cycles in Edgecam...

Cheers, Daniel
 
Last edited:
Hi Bill,

Whoops, can see that I wrote something wrong in your quote, it should have been 'used' written on that line:-)

Well, after it came clear where to look after the macro values, and using the M00 I could see that when running G666R270 the value of #18 was 0.270, so changed the values to 0.270, 0.180 etc. in the code. As I don't want to remember to put dots in the G call, it has to be straight forward!

I have changed a lot in the code, but I will post the Macro here when all is working, and a brief description of how to use it:-) I doubt that I'm the only one needing a smart and simple macro to do this. When no GUI (guided user interface) installed on the control, it gets a pain in the A... to use such probe to measure single parts by making small programs.

Cheers,

Daniel
 
Hi Bill,

Well, after it came clear where to look after the macro values, and using the M00 I could see that when running G666R270 the value of #18 was 0.270, so changed the values to 0.270, 0.180 etc. in the code. As I don't want to remember to put dots in the G call, it has to be straight forward!

Cheers,

Daniel

Hello Daniel,
That doesn't really make sense. As stated in my earlier Posts, the Arguments being passed must be the same unit as that being used in a Conditional statement. Accordingly, if the units are different in the Calling Block and the Macro, then its highly likely that all Comparisons will test False.

The only way your program could branch to N100 is if #18=Zero so that IF [#18 EQ 0.] GOTO 100 tests True and control branches to N100. #18 having the value of 0.270 won't equal any of the comparison values used in the Conditional Statements and therefore, all will Test False. In this case, the program would trickle down to the GOTO 1000 Block, branch to N1000 and therefore, end the program without any action.

Regards,

Bill

O9010 (Probe Macro)
IF [#18 EQ 0.] GOTO 100 (R0 = Bottom Left)
IF [#18 EQ 90.] GOTO 200 (R90 = Bottom Right)
IF [#18 EQ 180.] GOTO 300 (R180 = top Right)
IF [#18 EQ 270.] GOTO 400 (R270 = Top Left)
GOTO 1000
N100 (External - Bottom Left + Z)
G00 G17 G40 G80 G90
G54
M58 (PROBE ON)
G43
G10 L2 P1. X#5021 Y#5022 Z-710.
G65 P9810 X10. Y10. F3000.
G65 P9811 Z0. S1.
G65 P9810 Z10. F3000.
G65 P9810 F3000.
G65 P9810 X-7. Y-7. F3000.
G65 P9810 Z-5. F3000.
G65 P9816 X0. Y0. I10. J10. S1.
G65 P9810 Z10. F3000.
M85 (PROBE OFF)
G0 M9
M05
GOTO 1000
---------
---------
---------
N1000
M30
 
I have re written a lot in the code as I mentioned earlier:-) I removed the dot... And I have tried removing N1000, and therefore the program started in N100. The N1000 after the last IF is a safety, so if no input or wrong the program will end, and not start anything and damaging the probe.

Zeroing variables before the next macro call, so the desk is clean when it is loaded:-) and trying new things:-)

I will take a look at your way to determine work offsets later today.
 
I have re written a lot in the code as I mentioned earlier:-) I removed the dot... And I have tried removing N1000, and therefore the program started in N100. The N1000 after the last IF is a safety, so if no input or wrong the program will end, and not start anything and damaging the probe.

Zeroing variables before the next macro call, so the desk is clean when it is loaded:-) and trying new things:-)

I will take a look at your way to determine work offsets later today.
I'm afraid I still don't get it. If you were to remove the N1000, the GOTO 1000 would raise an error and your whole program would fail.

If a value for #18 is not optional and needs to be within a particular range, an Error Trap something like the following can be used:

IF [[#18 EQ #0] OR [#18 LT 1.] OR [#18 GT 4.]] GOTO1000 (ERROR TRAP FOR MISSING DATA OR DATA OUT OF RANGE)
----------
----------
----------
----------
----------
----------
GOTO900 (BYPASS ERROR BLOCK IF NO ERRORS)
N1000
#3000 = 1 (DATA ERROR - FIX)
N900
M99


In the above example, #3006 could be used instead of #3001, so that an Error Condition isn't raised and therefore, operation can continue with the press of Cycle Start. However, when expecting a Work-shift to be set, its probably better to raise an Error rather than just an Operator Message.

Rather than angles, I've used 1 to 4 to specify the quadrants of the Cartesian Coordinate System, 1 being Top Right (1st quadrant), then counting Counter Clockwise.

Parameter dependent (bit 6 and 7 of parameter 6001), but by default Local (#1 to #33) and Common Volatile (#100 – #149 (#199)) Variables are set to Vacant on Reset.

Regards,

Bill
 
Well, as I couldn't figure out why it just jumped and ended the program, I removed the GOTO, and ran the program single block:-)

Having tried a lot and learned even more, I will try to add the newly edited macro every day until working, so you and others can see what I'm doing. It is a bit confusing now I can see...

Well I will try to do something before Friday, being up since 2 am because of my 9 month old son, will take a day or two to get over. And still have to go to work in a couple of hours:-)

Cheers, Daniel
 
Due to random part sizes and short batches full automatic approach is not feasible. This is what I propose for this task:

%
O1234
G65P9876E...R...T...W..
(E-WCS NUMBER)
(R-CORNER 0,90,180,270 CCW FROM LOWER LEFT)
(T-PROBE TOOL NUMBER)
(W-APPROACH DISTANCE, NORMALLY PROBE SPHERE DIAMETER *3)
M99

O9876
IF[#8GT59]GOTO1000
IF[#LT54]GOTO1000
IF[#18EQ0]GOTO0
IF[#18EQ90]GOTO90
IF[#18EQ180]GOTO180
IF[#18EQ270]GOTO270
N0
#100=1
#101=1
GOTO999
N90
#100=-1
#101=1
GOTO999
N90
#100=-1
#101=1
GOTO999
N180
#100=-1
#101=-1
GOTO999
N270
#100=1
#101=-1
N999
GOTO2000
N1000
#3000=98 (FORMAT ERROR)

N2000
G00 G17 G40 G80 G90
M6T#20
#3006=99(SWITCH TO MANUAL/JOG,PLACE PROBE SPHERE CENTER ABOVE DESIRED CORNER, ABOUT 5 MM ABOVE THE SURFACE, SWITCH TO MANUAL, CYCLE START)
G10L2P[#8-53]X#5021Y#5022Z[#5023-#[11000+#20]-#[10000+#20]
G0G1G28Z0
G90G#8X[#100*#23]Y[#101*#23]
G43H#20Z100.
M58
G65P9810Z10.
G65P9811Z0S[#8-53]
G65P9810X-[#100*#23]Y-[#100*#23]F3000
G65P9810Z-10.F1000
G65P9816X0Y0I[ABS[#23*#100]]J[ABS[#23*#101]]S[#8-53]
G91G28G0Z0
M85
M99
 
That looks great!

I have to get my head around it, after I hopefully get some sleep in a couple of hours:-)

I will try the code when I understand what is going on. There is no need for the toolchange and tool number, probe is called in the machine at the end of the programs from Edgecam.

It has to be operator friendly, so calling it with custom G code is the way to go:-) If I decide to use the code, as I think I might do until I can program some myself:-)

I Will try to mod it to a single side measurement Macro for X Y Z when I have time for it, so maybe Friday:-)

Thanks a lot!

Cheers, Daniel



Waiting for the book, and I am going to call Fanuc in Denmark about courses today.
 








 
Back
Top