6.2.2 System Variables


System variables can be used to read and write NC internal data such as the current position, tool offsets, etc. However, some system variables can only be read. System variables are important for the preparation of automation and general programs.


Explain:

  • Tool compensation value

Tool offset values ​​can be read and written using system variables. The available variable numbers depend on the number of tool compensation groups, including geometric compensation, wear compensation, tool length compensation, and tool radius compensation. Although the number of tool compensation groups is 1024, only the first 400 groups have a role in system variables.

Compensation Number

Tool Length Compensation (H)

Tool Radius Compensation (D)

Geometric Compensation

Length Wear Compensation

Geometric Compensation

Radius Wear Compensation

1

#11001#2201

#10001#2001

#13001

#12001

:

:

:

:

:

200

#11201#2400

#10201#2200

:

:

:

:

:

:

:

400

#11400

#10400

#13400

#12400


  • Macro Alarm

Variable Number

Function

#3000

When a value between 0~200 is assigned to variable #3000, the controller will stop and an error message will pop up. An error message which is no longer than 26 characters can be quoted after the expression. The screen will show the alarm number which is 3000 plus the value of variable #3000, together with the error message quoted at the same time.


Example:

#3000=1(TOOL NOT FOUND);

The image would show "3001 TOOL NOT FOUND".


  • Stop and display messages

The variable setting allows the controller to abort when executing the program and display a message.

Variable Number

Function

#3006

If command #3006=1 (MESSAGE); is used in a Macro, the program will stop after execution of the block before the #3006 block. A message (no longer than 26 characters) to be shown can be quoted inside the parenthesis ( ). The quoted message will be shown on the screen.


  • Time information

Time information can be read and written.

Variable Number

Function

#3001

This variable works as a timer and the time unit is millisecond. The timer will be reset to 0 every time the controller is turned on. When the counting value reaches 2147483648 milliseconds, the timer will be reset to 0 as well.


  • Continuous effective instruction

The state of the continuously valid instruction from the start to the previous line can be read.

Variable Number

Function

#4002

G17、G18、G19

#4003

G90、G91

#4006

G20、G21

#4007

G40、G41、G42

#4008

G43、G44、G49

#4011

G50、G51

#4014

G54~G59

#4016

G68、G69

#4107

D code

#4111

H code

#4119

S code

#4120

T code


  • Current position

Position information can only be read and cannot be written.

Variable Number

Position Information

Coordinate System

Tool Compensation Value

#5021–#5024

Current position

Machine Position

Not included

#5041–#5044

Current position

Program position

Included

#5061–#5064

End tool position of the G31 block End position of G31 block

Program position

Included

    • The first digit (1~4) indicates the axial number.
    • Conditional termination linear interpolation command (G31) the tool position at signal start is stored in #5061~5064. When the conditional termination linear interpolation instruction signal is not activated, the end position of the line will be stored in #5061~5064.


  • Coordinate offset

The coordinate offset value can be read and written.

Variable Number

Function

#5201

:

#5204

First axis G92 Program origin offset value

              :

Fourth axis G92 Program origin offset value

#5221

:

#5224

First axis G54 coordinate offset

              :

Fourth axis G54 coordinate offset

#5241

:

#5244

First axis G55 coordinate offset

              :

Fourth axis G55 coordinate offset

#5261

:

#5264

First axis G56 coordinate offset

              :

Fourth axis G56 coordinate offset

#5281

:

#5284

First axis G57 coordinate offset

              :

Fourth axis G57 coordinate offset

#5301

:

#5304

First axis G58 coordinate offset

              :

Fourth axis G58 coordinate offset

#5321

:

#5324

First axis G59 coordinate offset

              :

Fourth axis G59 coordinate offset

#7001

:

#7004

First axis extra G54 coordinate offset(G54.1 P1

              :

Fourth axis extra G54 coordinate offset

#7021

:

#7024

First axis extra G54 coordinate offset(G54.1 P2

              :

Fourth axis extra G54 coordinate offset

:

              :

#7941

:

#7944

First axis extra G54 coordinate offset (G54.1 P48)

              :

Fourth axis extra G54 coordinate offset


Although there are 128 groups of extra G54 coordinate shifts, only the first 48 groups have a role in system variables.


The following variables can also be used:

First axis

Variable number

G92 program origin offset

#2500

G54 coordinate offset

#2501

G55 coordinate offset

#2502

G56 coordinate offset

#2503

G57 coordinate offset

#2504

G58 coordinate offset

#2505

G59 coordinate offset

#2506

Second axis

Variable number

G92 program origin offset

#2600

G54 coordinate offset

#2601

G55 coordinate offset

#2602

G56 coordinate offset

#2603

G57 coordinate offset

#2604

G58 coordinate offset

#2605

G59 coordinate offset

#2606

Third axis

Variable number

G92 program origin offset

#2700

G54 coordinate offset

#2701

G55 coordinate offset

#2702

G56 coordinate offset

#2703

G57 coordinate offset

#2704

G58 coordinate offset

#2705

G59 coordinate offset

#2706

Forth axis

Variable number

G92 program origin offset

#2800

G54 coordinate offset

#2801

G55 coordinate offset

#2802

G56 coordinate offset

#2803

G57 coordinate offset

#2804

G58 coordinate offset

#2805

G59 coordinate offset

#2806