overviewPreface
1. Overview
Variables that can be directly accessed by the user when using Panel, Scripting, Calibration, Diagnostics or other extended functions are defined as System Variables. According to the principle of system variable generation, there are two main types: Internal Variable and User Variable. Their main differences are:
➢ Endogenous system variables are automatically generated and released by the system, and users cannot directly add or delete them;
➢ User-defined variables are created and managed by the users themselves
2. Internal Variables
Endogenous system variables are automatically generated and released following the system. Common endogenous system variables are shown below:
- System Information
- Equipment Statistics
- Small program variables.
3. User Variables (system of user-defined variables)
This type of variable is user-defined and the user can perform operations such as adding and deleting.
Name: The name of the variable.
Category: The group to which the variable belongs to, so that the user can manage the variable, the same name may be used in different applications.
Comment: Add some comments and descriptions to the variables.
Data Type: Variable types, including Plastic and Float. Expand for details.
ReadOnly: whether the variable is read-only or not, if it is read-only, the user cannot modify it.
Minimun Value: The minimum value allowed for this variable.
Maximum Value: The maximum value allowed for this variable.
Current Value: The current value of the variable.
4. System variable data types
The significance of their respective representations is as follows:
Int32: Signed 32-bit type, can cover Int8, Int16, etc.
UInt32: Unsigned 32-bit type that covers UInt8, UInt16 and other data types.
Int64: Signed 64-bit data type.
UInt64: Unsigned 64-bit data type.
UInt8 Array: Unsigned 8-bit array, also known as the most commonly used Byte array. For data types, when assigning values, theArray elements are separated by ';'., as shown below, is equivalent to an array defined as:
UInt8 Var6[5] = {12,34,56,78,90};
➢ Int32 Array: integer 32-bit array type with array elements separated by ';'.
➢ Int64 Array: integer 64-bit array type with array elements separated by ';'.
➢ Double: Double precision data type.
➢ double Array: double precision array type, array elements are separated by ';'.
➢ string: string data type.
5. Access to system variables
Both endogenous and user-defined variables are accessed in exactly the same way. Two main application scenarios are described:
- Panel Associated System Variables
- Reads and writes system variables through scripts.
The Panel Associated System Variables process is shown in the figure above:
- The control association variable type is selected as SystemVar.
- Double-click to expand the Variable Selection panel.
- Just select Built-in System Variables and User Defined System Variables on the panel.
As shown in the above figure, in simple terms, the access to system variables mainly uses two types of functions, which are located under the APP directory of the applet Function.