System Variables For 0i
System Variables For 0i
and 16 output signals are available. The current status of these signals
is available inside a program through certain system variables, as
already explained by some examples.
Two types of system variables are available: for 16 single-bit sig-
nals and for one 16-bit signal (for both input and output signals). The
given examples pertain to system variables for single-bit signals
which can only be 0 or 1. The variables for 16-bit signals are used to
read/write all the 16 signals simultaneously by a single program
statement. For example, if the first and the second signals (i.e., F54.0
and F54.1) are 1 and the rest are 0 then the corresponding 16-bit sig-
nal would be 0000000000000011 (the decimal interpretation of which
is 3). So, #1100 = 1; and #1101 = 1; is same as #1132 = 3; except that the
two outputs are triggered simultaneously in the second case. It is a
matter of individual choice/requirement whether the signals are
read/written by the program one-by-one or simultaneously. The
complete variable list is given below. (32-bit signals are also available.
These are not described here, because these are rarely used.)
The decimal values of #1032 and #1132 (all other variables are
either 0 or 1) would be given by the following equations:
15
# 1032 = ∑ #[1000 + i] × 2i
i=0
15
# 1132 = ∑ #[1100 + i] × 2i
i=0
TABLE 3.2 System Variables for Lathe Offsets (with 64 Offset Numbers)
TABLE 3.3 System Variables for Lathe Offsets (with 99 Offset Numbers)
Note:
1. This table corresponds to parameter 6000#3 = 0. When this parameter is set to 1, the
wear and geometry variable numbers get interchanged.
2. When the available offset numbers are not greater than 200, #2001 through #2200 can
also be used in place of #10001 through #10200. Similarly, #2201 through #2400 can be
alternatively used for #11001 through #11200.
TABLE 3.4 System Variables for Milling Machine Offsets (with 200/400 Offset
Numbers)
position display to 101 and −49, respectively. The specified shift uni-
formly applies to all the workpiece coordinate systems, defined by
G54, G55, etc.
The associated system variables are given in Table 3.5. These are
read/write variables. For example, to specify a shift of +1 for the X-axis,
set #2501 = 1. Similarly, to read the shift amount for the X-axis, set #1 =
#2501, and read the value of variable #1 on the macro variable screen.
Macro Alarms
Alarm refers to an error condition which terminates the execution of
the current operation. Pressing the MESSAGE key on the MDI panel
shows the error message. The alarm condition may arise due to a
number of reasons, including hardware problems with the machine.
Further operation on the machine is possible only after rectifying the
problem, and thereafter, pressing the RESET key. A syntax error in the
program, out of range values, illegal data entry, etc., are software-related
error conditions. CNC automatically issues alarm in such cases.
There are, however, situations when the control will not sense the
error, even though the program execution must be terminated. For
example, a probing system installed on the machine may detect tool
breakage, necessitating immediate termination of program execution,
though the control will not recognize this problem. To tackle such
cases, provision has been made to issue user-generated alarms also,
which are called macro alarms.
When a value from 0 to 200 is assigned to system variable #3000,
the machine stops with the alarm message, “MACRO ALARM.” The
displayed alarm number is 3000 plus the number assigned to it. Thus
#3000 = 1; would terminate the current operation, and display “3001
MACRO ALARM,” when the MESSAGE key is pressed.
It is also possible to display a user-specified message up to 26
characters, as alarm message, by typing it within parentheses, after
the assigned value for variable #3000.
Example:
#3000 = 1 (TOOL BROKEN);
Time Information
The system variables for time-related information are given in Table 3.6.
Variable #3001 and #3002 are read/write variables, whereas #3011 and
#3012 are read-only variables. So, it is not possible to change the current
date or time through these variables.
Current date/time can only be set/altered on the time setting
screen, which is called timer/part count screen (Select MDI mode →
Press OFS/SET key → Press SETING soft key → Press page down key
twice → Using up/down/left/right arrow keys, bring the cursor to
time or date display, type the new value and press INPUT key). This
screen also displays some time-related information such as power
ON time and cutting time, in hour-minute-second format. Part count
information (the number of parts required and the number of parts
produced) is also displayed on this screen, which is discussed in
section “Number of Machined Parts”.
Table 3.7 gives the effect of assigning the four permissible values to
this variable. When the machine is switched on, the value of this vari-
able is 0, irrespective of its value in the previous machining session.
Another system variable #3004 controls feed hold and feed over-
ride switches on the MOP as well as the exact stop check performed
internally by the control at the end of a cutting motion. Pressing the
feed hold button stops tool movement without terminating the pro-
gram execution. The tool movement again starts as soon as the feed
hold button is released. Feed override switch allows feedrate from
0 to 254 percent of the programmed value (or less, depending on par-
ticular machine tools), except in threading where it is automatically
disabled by the control (i.e., it remains fixed at 100 percent). The exact
stop check is performed by the control to ensure that the tool reaches
the commanded point within specified tolerance. This slows down a
little bit the performance of the machine. So, if too much accuracy is
not desired for a particular cutting operation (e.g., a rough cutting,
which is to be followed by a finish cutting), this check may be tempo-
rarily disabled. Table 3.8 shows the effect of variable #3004 on feed
hold, feed override, and exact stop check. When the machine is
switched on, the value of this variable is automatically made 0 by the
control, irrespective of its value in the previous machining session.
Execution Pause
System variable #3000 generates an alarm condition and terminates
the program execution, whereas variable #3006 causes temporary
pause of execution which can be restarted by pressing the CYCLE
START button again. In the paused state, pressing the MESSAGE key
displays the user-specified message (up to 26 characters). Assigning a
number to variable #3006 halts the program execution. There is no
significance of this number, as message number is not displayed. So,
normally, 1 is assigned. Example:
#3006 = 1 (CHECK THE DIAMETER);
#3902 and #3901, respectively. Part count information can also be seen/
modified on the timer/part count screen, or through parameters 6713
and 6711 which store the number of parts required to be produced and
the number of parts produced, respectively.
The timer/part count screen also displays the total number of
parts produced during the entire service time of the machine, as a
read-only information. Whenever a part is completed, both the num-
ber of parts produced and the total number of parts produced are
incremented by 1. While the required and the completed number of
parts can be altered (through the associated system variables, param-
eter settings, or the setting screen), as and when desired, the total
number of completed parts can only be altered through parameter
6712. This information has been made available to keep a record of
the total number of parts produced during the entire service time of
the machine.
The default setting (parameter 6700#0 = 0) of the machine incre-
ments the part count by 1 whenever M02, M30, or the M-code num-
ber specified in parameter 6710 (which normally contains 30 only,
signifying M30) is executed. If it is desired to increment the part count
only after the M-code specified in parameter 6710 is executed (which
may be same as or different from 02 or 30, but not 0, 98, or 99), set
parameter 6700#0 = 1.
Finally, note that M02 or M30 must be typed with the end-of-block
(EOB) symbol (i.e., as M02; or M30;), otherwise the part count will
not be incremented, even though the part would be produced with-
out any error message (the control allows missing EOB symbol at the
end of the program).
Modal Information
The G-codes have been categorized into different groups based on
similarity in functionality. At any time, one G-code from each group
(except Group 0) remains active. Those belonging to Group 0 are
called nonmodal codes, which remain effective only in the block where
they are programmed. Other codes are modal codes, which remain
effective until replaced by some other code from the same group. For
example, G01 is a modal code, grouped with G00, G02, G03, etc. So, if
G01 is used once in the program, it need not be typed again, if the
subsequent motions are to be executed with linear interpolation.
However, as soon as G02 (or some other code from the same group)
is commanded, G01 gets cancelled and G02 becomes active.
During programming, specially while using general-purpose
macros which are to be used with several programs, it may be needed
to know the active G-code of a particular group. For example, refer-
ring to a milling machine, if the main program calls a macro in incre-
mental mode, the macro should interpret the values in the macro call
argument list as being incremental values. The macro should work
The system variable #5041 stores the current position of the tool
along the X-axis, as described in Table 3.11.
The system variables for various modal information on Fanuc 0i
series are given in Table 3.10 (a) and (b). The vacant columns are for
Variable
Number Function G-Code Group
#4001 G00, G01, G02, G03, G33, G34, G71–G74 1
#4002 G96, G97 2
#4003 3
#4004 G68, G69 4
#4005 G98, G99 5
#4006 G20, G21 6
#4007 G40, G41, G42 7
#4008 G25, G26 8
#4009 G22, G23 9
#4010 G80–G89 10
#4011 11
#4012 G66, G67 12
#4014 G54–G59 14
#4015 15
#4016 G17, G18, G19 16
#4017 17
#4018 18
Variable
Number Function G-Code Group
#4019 19
#4020 20
#4021 21
#4022 22
#4109 F-code (feedrate)
#4113 M-code number
#4114 Sequence number
#4115 Program number
#4119 S-code (rpm/constant surface speed)
#4120 T-code (tool number with offset number)
53
3/17/10 6:12:18 PM
54 Chapter Three