Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

FANUC Custom MACRO B Cheats


Recommended Posts

11 hours ago, cncappsjames said:

Was doing some documentation and parameter stuff today and figured I'd share. FANUC gets a bad rap for a number of reasons, many reasons are self inflicted, however that doesn't take away from the power that is available on machines with Custom MACRO B.

Nearly everyone knows G10 (FANUC's key to write to tool offsets, work offsets, parameters, etc...). It's not the only way though;
Another way to write/access work offsets;
Common(EXT)
[#_WZCMN[1]]=-10.1234 (WRITES -10.1234 TO THE COMMON WORK OFFSET FOR X)
[#_WZCMN[2]]=-8.7654 (WRITES -8.7654 TO THE COMMON WORK OFFSET FOR Y)
[#_WZCMN[3]]=-16.5432 (WRITES -16.5432 TO THE COMMON WORK OFFSET FOR Z)
[#_WZCMN[4]]=-1.234 (WRITES -1.234 TO THE COMMON WORK OFFSET FOR THE 4TH AXIS)
[#_WZCMN[5]]=54.321 (WRITES 54.321 TO THE COMMON WORK OFFSET FOR THE 5TH AXIS)

G54
[#_WZG54[1]]=-10.1234 (WRITES -10.1234 TO G54 FOR X)
[#_WZG54[2]]=-8.7654 (WRITES -8.7654 TO G54 FOR Y)
[#_WZG54[3]]=-16.5432 (WRITES -16.5432 TO G54 FOR Z)
[#_WZG54[4]]=-1.234 (WRITES -1.234 TO G54 FOR THE 4TH AXIS)
[#_WZG54[5]]=54.321 (WRITES 54.321 TO G54 FOR THE 5TH AXIS)

G55
[#_WZG55[1]]=-10.1234 (WRITES -10.1234 TO G55 FOR X)
[#_WZG55[2]]=-8.7654 (WRITES -8.7654 TO G55 FOR Y)
[#_WZG55[3]]=-16.5432 (WRITES -16.5432 TO G55 FOR Z)
[#_WZG55[4]]=-1.234 (WRITES -1.234 TO G55 FOR THE 4TH AXIS)
[#_WZG55[5]]=54.321 (WRITES 54.321 TO G55 FOR THE 5TH AXIS)

G54.1P1
[#_WZP1[1]]=-10.1234 (WRITES -10.1234 TO G54.1 P1 FOR X)
[#_WZP1[2]]=-8.7654 (WRITES -8.7654 TO G54.1 P1 FOR Y)
[#_WZP1[3]]=-16.5432 (WRITES -16.5432 TO G54.1 P1 FOR Z)
[#_WZP1[4]]=-1.234 (WRITES -1.234 TO G54.1 P1 FOR THE 4TH AXIS)
[#_WZP1[5]]=54.321 (WRITES 54.321 TO G54.1 P1 FOR THE 5TH AXIS)

Tool offset registers (Memory C by var. name – D-Comp – Param. #5004.2=1):
These registers may be read from and or written to.
          H-GEO                  H-WEAR               D-GEO                  D-WEAR
T1      [#_OFSHG[1]]     [#_OFSHW[1]]     [#_OFSDG[1]]      [#_OFSDW[1]]
T2      [#_OFSHG[2]]     [#_OFSHW[2]]     [#_OFSDG[2]]      [#_OFSDW[2]]
T998 [#_OFSHG[998]] [#_OFSHW[998]] [#_OFSDG[998]] [#_OFSDW[998]]

Tool offset registers (Memory C by var. name – R-Comp – Param. #5004.2=0):
These registers may be read from and or written to.
          H-GEO                  H-WEAR               R-GEO                  R-WEAR
T1      [#_OFSHG[1]]     [#_OFSHW[1]]     [#_OFSRG[1]]      [#_OFSRW[1]]
T2      [#_OFSHG[2]]     [#_OFSHW[2]]     [#_OFSRG[2]]      [#_OFSRW[2]]
T998 [#_OFSHG[998]] [#_OFSHW[998]] [#_OFSRG[998]] [#_OFSRW[998]]

Pretty much everything has a name. In the FANUC Series 30i-MODEL B Common to Lathe System/Machining Center System OPERATOR'S MANUAL B-64484EN_03 they can be found in the Custom Macro section.

HTH

:coffee:

Thanks for this James.

I recently found another eastear egg in a Blum Probing Routine. Looks like with the Fanuc 31i, you can read parameter values without using the "numeric variable" that is associated with that value.

( AKTUELLE KINEMATIK WERTE )
#31=[PRM[19700]]/#20(=#19700)
#32=[PRM[19701]]/#20(=#19701)
#33=[PRM[19702]]/#20(=#19702)
#28=[PRM[19703]]/#20(=#19703)
#29=[PRM[19704]]/#20(=#19704)
#30=[PRM[19705]]/#20(=#19705)

 

I have not seen any documentation yet explaining what the limits of this [PRM[ ]] syntax are. It would be awesome if we could read individual "bit" settings, but I've only ever seen it applied to these specific #19700 series parameters.

Fanuc Macro Parameter Read - Blum.PNG

  • Like 3
Link to comment
Share on other sites
30 minutes ago, Colin Gilchrist said:

I have not seen any documentation yet explaining what the limits of this [PRM[ ]] syntax are. It would be awesome if we could read individual "bit" settings, but I've only ever seen it applied to these specific #19700 series parameters.

IIRC, you can....

PRM [1,2]  where the number after the comma is the bit number you want to query.

Read Mike Lynch's article on it.  It gives a good basic overview.

https://www.mmsonline.com/columns/accessing-parameter-values-from-within-programs

I have seen the Fanuc documentation for this function somewhere at some point in my life, possibly in one of the robodrill books.  I can picture it, just can't place where I had access to it at one point in time.  It's not in the standard 31i pdf manuals that I have on my computer at the moment...

 

43 minutes ago, Colin Gilchrist said:

you can read parameter values without using the "numeric variable" that is associated with that value.

Just a note for everyone who isn't fully up on this subject but are curious, and will start poking around.  Not every parameter has a numeric variable associated with it.  Notably, I don't think the kinematic offset parameters above that Colin as referring do.  Maybe the do and I just haven't ran across them.  But using the PRM[] function to query them is a much less confusing method as you are querying the parameter itself and not a # numerical variable with a different number that  references the parameter you want to adjust.....

  • Like 3
Link to comment
Share on other sites

Here ya go Colin. Yes,, you can query individual bits.. To change them, you still need to go the G10 route.

Parameter Reading (Sys commmon, path or machine group)

#i = PRM [#j]

Parameter Reading (Sys commmon, path or machine group parameter bit number spec.)

#i = PRM [#j,#k]


Parameter Reading (Axis or spindle parameter)

#i = PRM [#j]/[#l]


Parameter Reading (Axis or spindle bit parameter)

#i = PRM [#j,#k]/[#l]

  • Like 4
Link to comment
Share on other sites

I've used the prm to set work offsets.

Depending on the control it looks different. Some there is a space between each letter

<80>(WORK OFFSET MACRO)

 

(P=OFFSET NUMBER)

 

#1=PRM[19700]

#2=PRM[19701]

#3=PRM[19702]

#4=PRM[19705]

G90G10L2P1X[#1/25.4]Y[#2/25.4]Z[[#3+#4]/25.4]

M30

 

 

 

 

 

 

Link to comment
Share on other sites

In the case of a machine with corner radius offsets;

T#    CR-G                      CR-W
T1    [#CORR_G[1]]       [#CORR_W[1]]
T2    [#CORR_G[2]]       [#CORR_W[2]]
T3    [#CORR_G[3]]       [#CORR_W[3]]

 

and if you want to mess with your co-workers :rofl:...

Instead of using X, Y, and Z... use the following

G0G54G90AX[1]=1.2345AX[2]=6.7890
G43H[#_BUFT] AX[3]=1.2345

........

Axis definitions;

AX[1]= Generally X
AX[2]= Generally Y
AX[3]= Generally Z
AX[4]= Generally Primary Rotary Axis
AX[5]= Generally Secondary Rotary Axis

Enjoy. :cheers:

:coffee:

 

Link to comment
Share on other sites
2 hours ago, cncappsjames said:

In the case of a machine with corner radius offsets;

T#    CR-G                      CR-W
T1    [#CORR_G[1]]       [#CORR_W[1]]
T2    [#CORR_G[2]]       [#CORR_W[2]]
T3    [#CORR_G[3]]       [#CORR_W[3]]

 

and if you want to mess with your co-workers :rofl:...

Instead of using X, Y, and Z... use the following

G0G54G90AX[1]=1.2345AX[2]=6.7890
G43H[#_BUFT] AX[3]=1.2345

........

Axis definitions;

AX[1]= Generally X
AX[2]= Generally Y
AX[3]= Generally Z
AX[4]= Generally Primary Rotary Axis
AX[5]= Generally Secondary Rotary Axis

Enjoy. :cheers:

:coffee:

 

Dude, I'm going to build a Post that outputs some crazy code, just to mess with people!

  • Haha 3
Link to comment
Share on other sites
18 minutes ago, Colin Gilchrist said:

Dude, I'm going to build a Post that outputs some crazy code, just to mess with people!

Lol, I feel like your skills could be put to better use..

The bonus would be I suppose, the operatpr could redefine his x as y and y as x!

I wonder if my pocketnc supports macro b..

Link to comment
Share on other sites
15 minutes ago, YoDoug® said:

Fanuc trying to copy OSP again by adding named variables. OKUMA OSP has had named variables for decades. 

This isn't new for Fanuc. they have had named variables for a long time, since Macro B came out. When I took Macro classes in 2007, they spoke of them.

  • Like 2
Link to comment
Share on other sites
40 minutes ago, YoDoug® said:

Fanuc trying to copy OSP again by adding named variables. OKUMA OSP has had named variables for decades. 

:rofl:

I know I've been using named stuff for at least 20 years best I can recall. Whatever you OSP guys gotta tell yourselves.  :P

:D

I thought everyone knew it... until Monday and a long time customer was getting hammered by... you guessed it, a local Okuma rep :rolleyes: so I had to put that rook in his place. :rofl:Best to remain silent than to speak and remove all doubt as my man Ben Franklin once said.

:D

 

1 hour ago, Colin Gilchrist said:

Dude, I'm going to build a Post that outputs some crazy code, just to mess with people!

:rofl:

That would be awesome.

  • Like 2
Link to comment
Share on other sites
1 hour ago, byte me said:

The bonus would be I suppose, the operator could redefine his x as y and y as x!

One could do a lot of different things. Takes up more memory though.

On the Multi-Axis front, I'll sometimes use vector formatting (I, J, K) instead of A, B, C to allow the machine to decide orientation/rotation. It trips people out a bit.

Link to comment
Share on other sites
Just now, cncappsjames said:

One could do a lot of different things. Takes up more memory though.

On the Multi-Axis front, I'll sometimes use vector formatting (I, J, K) instead of A, B, C to allow the machine to decide orientation/rotation. It trips people out a bit.

Does that affect your ability to use vericut?

Link to comment
Share on other sites
20 minutes ago, cncappsjames said:

I know I've been using named stuff for at least 20 years best I can recall. Whatever you OSP guys gotta tell yourselves

OSP5000 = 1981 That's almost 40 years. 

For me the power, user friendliness, and flexibility of OSP are far greater. Two things I do routinely are check status of machine I/O from NC code, and parse a text file to read in specific data. I have asked many a Fanuc "guru" if those things could be done and gotten no as the answer. The other big one for me is the open API in the OSP control. Every single one of our machines has custom apps that communicate data bi-directionally from the Okuma control to external PLCs and Robots. 

Link to comment
Share on other sites
2 minutes ago, cncappsjames said:

Only if Vericut isn't set up to "understand" the machine's kinematics based on the parameters.

Interesting, thanks for the info, I've been looking into collision testing and kinematic awareness in Mastercam.

2 minutes ago, YoDoug® said:

Two things I do routinely are check status of machine I/O from NC code, and parse a text file to read in specific data.

Could you explain that bit a bit more? 

I'm interested.

Link to comment
Share on other sites
6 minutes ago, byte me said:

Interesting, thanks for the info, I've been looking into collision testing and kinematic awareness in Mastercam.

Could you explain that bit a bit more? 

I'm interested.

We check the I/O for chuck clamp signals in our lathe programs to see if sub/main spindle is clamped for each toolpath. If the chuck is not clamped it has a GOTO to skip that toolpath. It allows us have one program that can run main spindle only, sub spindle only, or both simultaneously regardless of which turret is doing the machining. In our twin turret machines It simplifies robot programming because the robot does not have to switch programs for first piece, middle pieces, and last piece. We also have safety checks in our machine to make sure coolant buttons are not turned off/etc. It also comes in real handy with OSP TOOL RESTART function. This function gives you a graphical list of restart points to select form for safe restart. When activated, if a chuck is not clamped on a part it doesn't give you the toolpaths for that spindle as restart points. 

I actually don't do the parsing of a text file anymore because I made apps in C# using the API to write the data from the PLC into the controls common variables. They also write data out to the PLC as well, like machine status, door open/closed, unlocked, etc. However the READ/WRITE/GET/PUT Okuma function allows you to parse a text file as a string and read specific characters and write them to common variables for calculation. It is one of the common ways people read in gauging data from a CMM/gauge output file to update tool/work offsets in an automated cell. 

Link to comment
Share on other sites
22 minutes ago, YoDoug® said:

 Two things I do routinely are check status of machine I/O from NC code, and parse a text file to read in specific data. I have asked many a Fanuc "guru" if those things could be done and gotten no as the answer.

I'm nobody special and I know  how to do those things so... :coffee:

:)

@byte me,

Mastercam has no kinematic awareness. If it did, we would not need Misc. Int./Misc. Reals to dictate tilt/rotary preferences/behavior.

  • Like 1
Link to comment
Share on other sites
7 minutes ago, cncappsjames said:

I'm nobody special and I know  how to do those things so...

Care to share. We have looked at both Nakamura and Matsuura as an alternative to Okuma but when I ask their engineers for details on I can do the things I do now in our OSP I get no answers. Example; The code below will check to see if the feedrate and spindle speed knobs are at 100% and alarm if they are not.

( FEEDRATE OVERRIDE CHECK )
IF[VORD[0019]NE 1]NALM1
GOTO NALM2
NALM1 VUACM[1]='FEED NOT 100 %'
      VDOUT[992]=1234
NALM2
( SPINDLE OVERRIDE CHECK )
IF[VORD[038C]NE 1]NALM3
GOTO NALM4
NALM3 VUACM[1]='SPEED NOT 100 %'
      VDOUT[992]=1234

 

Link to comment
Share on other sites

I can think of a couple guys off the top of my head at Methods in Boston that would know. They may know your ties to Okuma and may not want to give up that info without a PO... that's pure conjecture though. We've withheld information in sales situations because we're not somebody's free engineering service and because sometimes it's people fishing for info.

As for Matsuura... there's at least one guy I can think of that would know perhaps as many as 3 if I count a Japanese Engineer.

I'm a little reticent to share that kind of thing. It can be a little like sharing the Anarchist's Cookbook. :rofl:

Link to comment
Share on other sites
32 minutes ago, cncappsjames said:

I can think of a couple guys off the top of my head at Methods in Boston that would know. They may know your ties to Okuma and may not want to give up that info without a PO... that's pure conjecture though. We've withheld information in sales situations because we're not somebody's free engineering service and because sometimes it's people fishing for info.

As for Matsuura... there's at least one guy I can think of that would know perhaps as many as 3 if I count a Japanese Engineer.

I'm a little reticent to share that kind of thing. It can be a little like sharing the Anarchist's Cookbook. :rofl:

LOL, Are you Pelosi? You have to buy it before we tell you if it can do it or not. 

How is sharing standard functions that a control can do comparable to sharing the Anarchists CookBook. 

I'm calling BS. Put up or admit Okuma builds a better control. 

Link to comment
Share on other sites
25 minutes ago, YoDoug® said:

LOL, Are you Pelosi? You have to buy it before we tell you if it can do it or not.

No, not saying that at all. That came out wrong sort of. I'm just saying when an ex Okuma guy comes nosing around a FANUC machine, it's HIGHLY suspicious. Sometimes even with with Mazak guy it's suspicious too. Let's be honest, Mazak shop/Okuma shop looking at FANUC machines is like racial integration in the 50's only without the blood.

If you're serious about buying a machine and not just looking to just talk $#!+, hit up Colin (he works for Methods) and PM me and I'll put you in touch with the right Matsuura guy in your neighborhood. Only PM me if you're serious. Otherwise we can just continue the banter. :P :rofl:

I enjoy it anyway because I nearly always learn something when somebody throws up the "you can't..." flag. :D  

:rofl:

51 minutes ago, YoDoug® said:

I'm calling BS. Put up or admit Okuma builds a better control. 

:rofl:

Yeah, that'll happen... when a 1 armed, 30 year old China born woman becomes President.

 

:rofl:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...