Global Variables
A global variable is a named value shared across the app. Each variable has a name, a type, a current value, and an optional description. After you define a variable, you can use it in these places:
- Send area: A
{variableName}placeholder in the input box is replaced with the variable's current value when the data is sent. - Insert Variable: The Insert Variable button in the send area inserts the variable name at the cursor in the input box.
- Process Execution:
{variableName}placeholders in a step's send content and comparison formula. - Visualization plugins: When Variable rendering is on, a plugin reads the variable's current value directly. See Plugin Overview.
- Data Analysis: A parsed result can be written to a variable. See Data Analysis.
Open variable management
Choose Variable Management from the Configuration menu in the main window to open the variable management window.
Manage groups
Variables are saved by group, and each group is one configuration file. At any time, only the variables in the selected group are in effect. When you switch groups, the app loads the variables of the new group.
- Select group: Choose the group to edit from the drop-down list.
- Refresh: Reload the group list.
- New group: Create a group named "Variable Group 1", "Variable Group 2", and so on. Each new group contains two sample variables: "Sample Integer" (Int32, value 0) and "Sample String" (String, value
Hello). - Delete group: Delete the current group's configuration file. A confirmation dialog appears first.
- Rename: Edit the group name in the drop-down list, then press Enter or move the focus away. The file is renamed to match. If the new name duplicates an existing group, the original name is restored.
If no group exists, the program creates a group named Default with the same two sample variables.
Add variables
In the "Add New Variable" area, fill in the fields below, then click Add.
| Field | Description |
|---|---|
| Name | Required. Must be unique within the group |
| Type | The data type of the variable. See the table below |
| Default value | Must fit the range of the selected type, or the variable cannot be added |
| Description | Optional. For reference only |
Name restrictions
The {variableName} placeholder matches only letters, digits, and underscores. If a name contains a space or another symbol, its placeholder cannot be replaced. Names such as temperature or temp_1 work well.
Variable types
| Type | Range | Bytes |
|---|---|---|
| Boolean | true, false, 0, or 1 | 1 |
| Int8 | -128 to 127 | 1 |
| Uint8 | 0 to 255 | 1 |
| Int16 | -32768 to 32767 | 2 |
| Uint16 | 0 to 65535 | 2 |
| Int32 | -2147483648 to 2147483647 | 4 |
| Uint32 | 0 to 4294967295 | 4 |
| Int64 | 64-bit signed integer | 8 |
| Uint64 | 0 to 2^64 − 1 | 8 |
| Float | Single-precision floating-point number | 4 |
| Double | Double-precision floating-point number | 8 |
| String | Any text, no range limit | UTF-8 byte count of the text |
Edit and delete variables
In the variable table, you can edit the Name, Type, Current value, and Description directly. After you change a row, its Save button becomes enabled. Click it to apply the change. Clicking Delete shows a confirmation dialog first.
Keep these rules in mind when you edit:
- Change the type: If the current value is outside the range of the new type, the current value is changed to
0. - Change only the current value: Only the value in memory is updated. It is not written to the file. When you select the group again or restart the program, the variable returns to the value saved in the file.
- Change any other field: The whole group is saved to the file. The current values in memory are saved along with it.
Use variables in send content
The send area input box supports {variableName} placeholders. For example, if the variable temp has the current value 25.5, typing SET {temp} and sending in ASCII mode sends SET 25.5.
- ASCII send: The placeholder is replaced with the variable's value as text.
- HEX send: The placeholder is replaced with the bytes of the variable, converted by its type. Multi-byte types use big-endian byte order (high byte first). String values use UTF-8 bytes. Spaces are added automatically between the placeholder and neighboring bytes.
A placeholder with no matching variable, such as {unknown}, is left unchanged.
Notes
- A variable's current value is kept in memory only, unless you change another field and save the whole group. After the program restarts, the variable returns to the value saved in the file.
- Boolean and String variables do not appear in the variable list of the plugins' Variable rendering setting. Only numeric variables can be used for plugins.
