E-Sharp Helpcenter
Breadcrumbs

Set command

Set Channel Value

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

Bash
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 Digital Output

Bash
set --channel "GPIO_PIN_5" --value "1"

Set Analog Value

Bash
set --channel "DAC_OUTPUT" --value "2.5"

Set String Value

Bash
set --channel "DEVICE_NAME" --value "TestDevice"

Set Enumeration

Bash
set --channel "MODE_SELECT" --value "AUTO"

Using Short Options

Bash
set -c "ENABLE" -v "true"

Value Types

The command accepts various value types depending on the channel:

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

  1. Resolves the channel name

  2. Converts the value to the appropriate type

  3. Sends the value to the hardware

  4. Value is applied immediately

Channel Name Resolution

The channel parameter is trimmed of whitespace and passed directly to the hardware layer for resolution.

Common Use Cases

Control GPIO

Bash
# Turn LED on
set -c "LED_GREEN" -v "1"

# Turn LED off
set -c "LED_GREEN" -v "0"

Set Voltage

Bash
# Set DAC output to 1.8V
set -c "VOUT_DAC" -v "1.8"

Configure Mode

Bash
# Set device to test mode
set -c "OPERATING_MODE" -v "TEST"

Enable/Disable Features

Bash
# Enable watchdog
set -c "WATCHDOG_ENABLE" -v "true"

# Disable interrupts
set -c "INT_ENABLE" -v "false"

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

  • Changes persist until reset or new value is set

Type Conversion

The hardware layer automatically handles type conversion:

  • Boolean channels accept "true"/"false", "1"/"0"

  • Numeric channels parse decimal and hexadecimal

  • String channels accept any text

  • Enumeration channels validate against allowed values

Validation

Hardware-level validation occurs for:

  • Value range (min/max limits)

  • Allowed enumeration values

  • Data type compatibility

  • Channel write permissions

Error Handling

Common errors:

  • 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

Performance

  • Set operations typically complete in 2-10 ms

  • Network latency affects timing

  • Bulk operations should use scripts