What's new
What's new

Wrote a macro for zeroing work offset I have no Input softkey Fanuc OM

lowCountryCamo

Stainless
Joined
Jan 1, 2012
Location
Savannah, Georgia, USA
I recently installed a probe thanks to VancBikers help. And that works great. I learned much about macros since. Although sometimes when setting work offsets for first ops I just want to move a drill point to the corner of a plate and zero G54.

My Fanuc O does not have an Input softkey to transfer the machine coordinate to G54 register.

This macro will do just that. Scroll down to the register you want and cycle start through x, y, and z if needed. I been using this for a month and thought others might could use it also.

%
O7054(SET ALL)
(G54 SET)
N1054
#2501=#5021(X);
M00
N2054
#2601=#5022(Y);
M00
N3054
#2701=#5023(Z);
M30
(G55 SET)
N1055
#2502=#5021(X);
M00
N2055
#2602=#5022(Y);
M00
N3055
#2702=#5023(Z);
M30
(G56 SET)
N1056
#2503=#5021(X);
M00
N2056
#2603=#5022(Y);
M00
N3056
#2703=#5023(Z);
M30
(G57 SET)
N1057
#2504=#5021(X);
M00
N2057
#2604=#5022(Y);
M00
N3057
#2704=#5023(Z);
M30
(G58 SET)
N1058
#2505=#5021(X);
M00
N2058
#2605=#5022(Y);
M00
N3058
#2705=#5023(Z);
M30
(G59 SET)
N1059
#2506=#5021(X);
M00
N2059
#2606=#5022(Y);
M00
N3059
#2706=#5023(Z);
M30
%
 
That is pretty cool and thanks for putting it up for others to use.

By "input softkey" you're referring to the measure function?

Brent
 
Ought to re-post into the sticky for macro programming too. It is super simple and might help someone get an idea about how a macro could simplify or speed up something they do regularly on their machine.

You might consider making a more "complex" version that is used by calling G65 P7054 and use variables to set which offset to set, and which axes to set....
 
You might consider making a more "complex" version that is used by calling G65 P7054 and use variables to set which offset to set, and which axes to set....

Good job OP!
Yeah, maybe do some digging so it works similar to a centre finding or centre of block macro... Where you can choose which work offset to use. Could also maybe have all 3 axes in the main macro and just get it to skip any with using the G65 if you don't want to do all 3. You might find that your macro will be pretty simplified then and you won't have to scroll through a program, instead just put your option in on your macro call and jog to the positions when it tells you to with a few notes... So this is using "S" to designate which work offset to use. I can't remember why I specifically used S, might have stolen it either from a macro in the sticky or from Sinhas book. To expand on what I meant by skipping an axis you could use any call in G65 that you want A-Z I think excluding G,L,N,O and P. So maybe if you use G65 P7054 S1 (For G54) A2 (To designate which axis to do)

IF [#1EQ2] GOT TO 2 (Skips Y and goes straight to X)
N1 #3006=1 (Touch Y)
#3006=1 (Hit cycle start)
#[5202+[20*[#19]]] = #2601 (Because S is #19 it calculates that it should be Y for G54)
N2 #3006=1 (Touch X)
#3006=1 (Hit cycle start)
#[5201+[20*[#19]]] = #2501 (As above just for X)

If you look at my pics the only reason why I have =#5 and =#6 is because I did calculation in between to work out the middle of two points. I might have the example I typed out for you a bit muddled up... Just typed it quickly during my tea break. I'm sure someone on here will slap me around if I have made mistakes.

Great job again on making your life easier at the machine :)
 

Attachments

  • DSC_1015.jpg
    DSC_1015.jpg
    86.3 KB · Views: 220
  • DSC_1016.jpg
    DSC_1016.jpg
    83.5 KB · Views: 231








 
Back
Top