Instructions - Variable
1. Assignment (SET)
Description
Assigns values to defined integer, floating-point, boolean, and string variables. String append instruction.
Parameter List
| Parameter | Type | Description |
|---|---|---|
| logout | bool | Whether commented out; true: this instruction will not be executed in the job file; false: not commented, executable |
| type | int | Instruction type, value is 41 |
| userParamInt | int | Customer custom in secondary development, currently no meaning |
| userParamString | string | Customer custom in secondary development, currently no meaning |
| variable | object | Variable; int type or bool type or double type or string type variable, global or local |
| variableValue | object | Variable value; manual value or bool type or int type or double type variable |
variable Structure
| Field | Type | Description |
|---|---|---|
| varname | string | Variable name |
| value | int | Variable value |
| data | double | Floating-point data |
| secondvalue | int | Backup value |
variableValue Structure
| Field | Type | Description |
|---|---|---|
| varname | string | Variable name |
| value | int | Variable value |
| data | double | Floating-point data |
| secondvalue | int | Backup value |
Example
json
{
"logout": false,
"type": 41,
"userParamInt": 0,
"userParamString": "",
"variable": {
"data": 0.0,
"secondvalue": 0,
"value": 8,
"varname": "I001"
},
"variableValue": {
"data": 0.0,
"secondvalue": 0,
"value": 8,
"varname": "GD009"
}
}2. Write to File (FORCESET)
Description
Stores cached data to the hard disk. During program execution, all calculations and assignment operations modify values in the cache and are not stored to system files. To force writing global numeric variables from memory to a file, the FORCESET instruction can be used.
Parameter List
| Parameter | Type | Description |
|---|---|---|
| logout | bool | Whether commented out; true: this instruction will not be executed in the job file; false: not commented, executable |
| type | int | Instruction type, value is 42 |
| userParamInt | int | Customer custom in secondary development, currently no meaning |
| userParamString | string | Customer custom in secondary development, currently no meaning |
| variable | object | Variable name; int type or bool type or double type, global |
variable Structure
| Field | Type | Description |
|---|---|---|
| varname | string | Variable name |
| value | int | Variable value |
| data | double | Floating-point data |
| secondvalue | int | Backup value |
Example
json
{
"logout": false,
"type": 42,
"userParamInt": 0,
"userParamString": "",
"variable": {
"data": 0.0,
"secondvalue": 0,
"value": 8,
"varname": "GI001"
}
}