Discussion:
Fanuc Macro Variables
(too old to reply)
Rob
2009-02-06 11:16:12 UTC
Permalink
Hi folks

Fanuc 21i. Is it possible to select a screen display which shows the variable
addresses along with their contents. ie a display which shows say #2001 and
its value? If so, how?

I know for this example I can look at the offset/setting screen but this
doesn't reference the variable number.

Thanks
Rob
John Scheldroup
2009-02-06 22:42:07 UTC
Permalink
Post by Rob
Hi folks
Fanuc 21i. Is it possible to select a screen display which shows the variable
addresses along with their contents. ie a display which shows say #2001 and
its value? If so, how?
The client of my previous employer an automation cnc/plc supplier hired me to build it.
The robot and completed workcell must provide a means to read/write tool wear offsets from the control
via an external HMI display tied to the control with ethernet.

The Fanuc control enclosed in a gated workcell as the overhead gantry robot loaded
unloaded parts onto a conveyor system. If the inserts required change-over or for whatever maintenance,
the robot had to be placed in standby.

http://groups.google.com/group/alt.machines.cnc/msg/4ba5a0b6079d7df3?hl=en
Post by Rob
I know for this example I can look at the offset/setting screen but this
doesn't reference the variable number.
Thanks
Rob
Regards,
John
b***@aol.com
2009-02-06 18:19:22 UTC
Permalink
Rob,

I am sure someone will correct me if I am wrong.
Post by Rob
Fanuc 21i. Is it possible to select a screen display which shows the variable
addresses along with their contents. ie a display which shows say #2001 and
its value? If so, how?
I know for this example I can look at the offset/setting screen but this
doesn't reference the variable number.
The offset/setting screen shows "Common Variables" your example #2001
is a "System Variable".

If you are looking for a screen that shows all variables (Local,
System & Common) all in a row from #0-#9999 with their corresponding
value, I don't believe you can.

If you are looking to see just the value of #2001 (IIRC is an offset)
you could look at the corresponding offset menu where it's value is
displayed.

If you are debugging or checking out a macro/program and want to see
(snap shot) list of all the variables with values, try using "Dprint".
Unless you are only using "common variables" then you can look at the
offset/setting screen.

I had a Bridgeport with 21i & their "Fast op" keys which we could
create custom menu's. So it should be possible (if your
machine/controller has the same available options) to create your own
menu and tie it to a macro that retrieves and displays the information
any way you want.

Tom
plh
2009-02-07 14:16:50 UTC
Permalink
Post by Rob
Hi folks
Fanuc 21i. Is it possible to select a screen display which shows the variable
addresses along with their contents. ie a display which shows say #2001 and
its value? If so, how?
I know for this example I can look at the offset/setting screen but this
doesn't reference the variable number.
Thanks
Rob
Another way is to create a program that sets the values of user values to those
of system values. Then you can look at them. For Example:
%
O6969
#501=#2001
#502=#2002
#503=#2003
#504=#2004
#505=#2005
#506=#2006
#507=#2007
...
...
M30
%
Off the top of my head I don't know if those 2000 series #s listed are real
registers in the machine or not, but you get the idea.
You can also use the 100 series:
%
O6969
#101=#2001
#102=#2002
#103=#2003
#104=#2004
#105=#2005
#106=#2006
#107=#2007
...
...
M30
%
This series may or may not clear when you hit reset, depending on how you have
your parameters set.
You can even use the more volatile series
%
O6969
#1=#2001
#2=#2002
#3=#2003
#4=#2004
#5=#2005
#6=#2006
#7=#2007
...
...
(up to 33 most controls)
M30
%
This series clears on reset on most controls.
Anyway, after you run such a program, (which causes no machine movement, so no
worries) you look at the user variable listing, which is a sub-menu of the
offset menu. Sometimes you have to hut for it, some combination of the page &
"Oper" soft keys.

There is no real risk as long as:
1) You don't end up overwriting a user variable which is being used for
something. For example, if you have a probe, pallet system, etc., the software
used to control these things often makes use of the user variables. In my
example I started with #501 to make it easy to remember that that refers to
#2001, but #501 might be "taken" by your probe or pallet software. That is one
of the advantages of using the 100 or 1-2-3 series.
2) Always put the USER variable on the LEFT, and the SYSTEM variable on the
right!
Have fun.
If you want to discuss this more email me robustus at newsguy dot com.
-plh
--
Where are we going and why am I in this HAND BASKET??
Rob
2009-02-07 21:27:54 UTC
Permalink
plh - thanks for that. I tried something similar and got the info I needed.



-----------------------------------------------------------------------
Another way is to create a program that sets the values of user values to
those
of system values. Then you can look at them. For Example:
%
O6969
#501=#2001
#502=#2002
#503=#2003
#504=#2004
#505=#2005
#506=#2006
#507=#2007
...
...
M30
%
folksD> >Fanuc 21i. Is it possible to select a screen display which shows the
variable>addresses along with their contents. ie a display which shows say
#2001 andÿ>its value? If so, how?ÿ>ÿ>I know for this example I can look at the
offset/setting screen but thisÿ>doesn't reference the variable
number./>1>Thanks9>Rob>>@>BAnother way is to create a program that sets the
values of user values to those
Kirk Gordon
2009-02-08 19:23:17 UTC
Permalink
Post by plh
Post by Rob
Hi folks
Fanuc 21i. Is it possible to select a screen display which shows the variable
addresses along with their contents. ie a display which shows say #2001 and
its value? If so, how?
I know for this example I can look at the offset/setting screen but this
doesn't reference the variable number.
Thanks
Rob
Another way is to create a program that sets the values of user values to those
%
O6969
#501=#2001
#502=#2002
#503=#2003
#504=#2004
#505=#2005
#506=#2006
#507=#2007
...
...
M30
Exactly.

Or to get more of a real-time access to the values, you could put
your routine into a sub. Call that sub from the main, then follow the
call with an MO. The machine grabs the variables, puts them where you
can read them, and then waits for you to have a look. If the M98 and
the M0 are both preceded by a block delete slash, then you don't have to
stop and read unless you want to.

As you caution, though, this only works if the variables used for
reading system stuff aren't also used for other things in the program.
That could get messy.

KG

Loading...