ZLC Robot

Constants, variables and displays in KUKA robot programming

The basic concepts, operation methods and management methods of constants and variables in KUKA robot programming, including the immutability and declaration steps of constants, the variability of variables and their naming conventions, data types, lifetime and validity, and how to display and modify variable values ​​in the KUKA robot control system, provide basic guidance for understanding and using robot programming languages. 1 Constants    A constant is a value whose value cannot be changed during the operation of a robot program. Constants can be divided into numeric constants, character constants and symbolic constants, among which numeric constants include integer constants and real constants. The declaration of constants can only be established in the data list, and the keyword CONST must be used.
The steps to create constants are as follows:
Step 1: Open the DAT file in the editor
Step 2: Declare and initialize
Step 3: Close and save the data list

In KUKA robot programming, constants are fixed values that don’t change during program execution, like the acceleration limit. Variables, on the other hand, can hold different values and are adjustable. For display, commands can be used to show information such as variable values or status messages, facilitating monitoring and debugging.

2 Variables
A variable is a quantity whose value can change during the operation of a robot program. There is a specially designated address in the memory of the robot control system to store the value of the variable.
(1) Naming conventions When selecting variable names in the KRL language, be sure to follow the following naming conventions:
① The maximum length of a variable name is 24 characters;
② The variable name can only contain letters (A – Z), numbers (0 – 9) and special characters “_” and “$”;
③ The variable name cannot start with a number;
④ The variable name cannot be a keyword in the KRL language;
⑤ The KRL language is not case-sensitive.
(2) Data types
Variables can be divided into global variables and local variables according to the storage address allocation method. Global variables are variables that are valid in all programs of the entire robot control system. Local variables are variables that are valid only in the program in which they are declared and will disappear after the program to which they belong ends.
Variables can be divided into standard data types, array types, enumeration types, and composite data types according to the type of values ​​stored. Standard data (simple types): integer, real number, character, Boolean Array: one-dimensional array, two-dimensional array, three-dimensional array Enumeration: composed of a certain number of constants Composite structure: a data structure composed of multiple data types
(3) Lifetime and validity
① Lifetime: the period of time that a variable is in the storage space    The lifetime is the time that the storage location is reserved for the variable. Runtime variables will vacate their storage location when exiting the program or function (local) Variables in the data list will permanently save the current (previous) value in their storage location (global)
② Validity: global variables and local variables    Locally declared variables are only available and visible in the declared program. Global variables are established in a central (global) data list. Global variables can also be established in a local data list. The keyword GLOBAL (global) is used when declaring them
(4) Variable application    The use of variables requires the following steps: variable declaration variable initialization variable operation
3 Variable display
The KUKA robot control system can monitor all variables (including system variables and user-defined variables), and the variable values ​​can be displayed and changed in the robot teach pendant. (1) Single variable display window
(2) Steps for displaying and changing single variable valuesStep 1: Click the “Menu” key and select “Display (①) > Variable (②) > Single (③)”
Step 2: Enter the variable name in the Name column of the Single Variable Display Window (①)
Step 3: Select the “Update” key (②) to display the variable value in the Current Value column
Step 4: Enter the new value to be set in the New Value column (①), hold down the “Enable” key, and select the “Set Value” key (②) to change the currently displayed variable value (③).

Leave a Reply

Your email address will not be published. Required fields are marked *