Pro codes · Fanuc
#5001–#5066 — Position variables (Fanuc)
Position variables. Macros can read the position of the machine at any time: #5001–#5003 are the end point of the last block (work coordinates), #5021–#5023 the current machine position…
| Property | Value |
|---|---|
| Code | #5001–#5066 |
| Control | Fanuc |
| Topic | Macro and system variables |
| Syntax | #5001 X, #5002 Y, #5003 Z (block end) / #5021–#5023 machine / #5041–#5043 work / #5061–#5063 skip |
What it does
Macros can read the position of the machine at any time: #5001–#5003 are the end point of the last block (work coordinates), #5021–#5023 the current machine position, #5041–#5043 the current work position, #5061–#5063 the skip (probe) position. On many controls positions that change during the motion (#5021, #5041) are read with look-ahead stopped.
Example
#101 = #5021 (MACHINE X NOW)
#102 = #5041 (WORK X NOW)
#103 = #101 - #102 (= ACTIVE OFFSET IN X)Tips
- Try them in the Macro B simulator; it fills these variables as the program runs.
Options, numbers and parameters depend on the control model, the software version and the options the machine builder installed. Check the operator and parameter manual of your machine before you use a code for the first time, and run it in single block with low overrides.
Try it without a machine
The Macro B simulator runs variables, G65 calls, #3000 alarms, G10 and system variables block by block.
Open the Macro B simulatorMore: macro and system variables
- #5201–#5326 — Work offset variables (Fanuc)
- #2001–#2400 / #10001… — Tool offset variables (Fanuc)
- #4001–#4130 — Modal information (Fanuc)
- #3000 / #3006 — User alarm and stop with message (Fanuc)
- #3003 / #3004 — Suppress single block and feed hold (Fanuc)
- #3901 / #3902 — Parts counter (Fanuc)
- #3011 / #3012 — Date and time (Fanuc)
- POPEN / DPRNT / PCLOS — Write data out of a macro (Fanuc)
- #1000–#1035 / #1100–#1135 — Interface signals (PMC I/O) (Fanuc)
- G66 / G67 — Modal macro call (Fanuc)
- FN 14 / FN 16 — Error messages and output in Q-parameter programs (Heidenhain)