4.1 Add Global Variable
4.1.1 Global variable
Global Variable: Variables defined outside all functions, its scope defaults to the entire program, that is, all source files
4.1.1.1 Add subdirectory under the global variable set
- In order to more conveniently manage the global variable table, you can add a directory under the global variable set to facilitate the management of the variable table
Operation steps: Project-->Global variable set-->Right mouse button-->Add directory
- Then you can add a global variable table in the subdirectory
4.1.1.2 Manually add
Manually add the global variable table directly to the project. The steps are as follows:
(a). Open global variable set
Operation steps: Project-->Global variable set-->right mouse button-->Add global variable table
(b). Add global variable table (note to check "Open this global variable", if it is checked, ignore this item)
Operation steps: Fill in the name of the variable table and fill in "Namespace" (usually just follow the default) Note: The name format must be in the form of xxx_xxx, just check "OK" to add it
(c). Set global variable table
The upper half is global variables, the lower half is global constants
- Enter the added variable name, data type, and initial value in the corresponding position (user can check whether to "Keep")
- If there are missing variable rows after adding, click "+" to add the number of rows (select the corresponding row and click "+" to add the corresponding variable row)
4.1.1.3 External import added
Operation steps: Add a variable table directly from the outside, click the "Import arrow" in the global variable table menu bar, select the import method --> select the file (click the blank box) --> click the "Import" button (user can Select "Automatically close the pop-up window after successful import")
- There are two ways to import:
- Incremental import: Skip the import of variables with the same name
- Overwrite import: Overwrite variable import with the same name
- In the variable table, select the entire row and click "Up Arrow or Down Arrow" to move the variable position up or down
- Note: After the import is successful, the newly added and skipped variables with the same name will be displayed on the import interface (If user choose to automatically close the pop-up window, it cannot be displayed)
4.1.1.4 Export variable table
Operation steps: If user want to export the existing global variable table, click the "Export arrow" in the global variable table menu bar, select the export format, and click "Export"
- Export formats are divided into two categories
- CSV table: exported to an excel table
- Source code: exported in code form (.gvs)
4.1.2 Global constant
- Global constants are global variables defined using keywords. Their values are initialized when they are defined, and the initial value must be defined. and cannot be modified while the program is running
Global constants add classification
- The addition of global constants is also divided into two types: manual direct addition and external import addition
- For specific steps to add a global constant table, please refer to global variables
- For the import and export of constant table, please refer to the steps of variable table mentioned above
Jump link--> Constant table import & Constant table export
4.1.3 GVS List
- User can see all the organized variable tables and constant tables in the GVS list. See the picture below for the specific interface and operation steps
- Click the "jump arrow" next to the variable table in the list to return to the adding interface of the variable table
4.1.4 Add global variable and global constant table operation video
