Description
The set command writes a value to a specified channel. It’s used to configure hardware settings, control digital I/O, and modify channel states.
Syntax
set --channel <channel_name> --value <value>
Required Options
| Option |
Short |
Description |
--channel |
-c |
The name or alias of the channel to set |
--value |
-v |
The value to write to the channel |
Examples
set --channel "GPIO_PIN_5" --value "1"
set --channel "DAC_OUTPUT" --value "2.5"
set --channel "DEVICE_NAME" --value "TestDevice"
set --channel "MODE_SELECT" --value "AUTO"
set -c "ENABLE" -v "true"
Value Types
| Channel Type |
Example Values |
| Boolean |
"true", "false", "1", "0" |
| Integer |
"0", "100", "-5" |
| Float/Double |
"3.14", "2.5", "-1.23" |
| String |
"any text", "DeviceName" |
| Enumeration |
"OPTION1", "MODE_A" |
| Hexadecimal |
"0xFF", "0x1A2B" |
Behavior
- Resolves the channel name
- Converts the value to the appropriate type
- Sends the value to the hardware
- Value is applied immediately
Notes
- Requires an active connection (use
init first)
- Values are applied immediately
- Some channels may have restricted value ranges
- Hardware validation may reject invalid values
Error Handling
- Channel not found: Verify channel name with
list
- Invalid value: Check channel data type and valid range
- Read-only channel: Some channels cannot be written
- Value out of range: Hardware rejected the value
- Not connected: Run
init command first