E-Sharp Helpcenter
Breadcrumbs

Get command

Get Channel Value

Description

The get command retrieves the current value of a specific channel with performance metrics. It can capture multiple samples and provides detailed timing statistics.

Syntax

Bash
get --channel <channel_name> [options]

Required Options

Option

Short

Description

--channel

-c

The name or alias of the channel to measure

Optional Options

Option

Short

Description

Default

--samples

-s

Number of samples to capture

1

--detailed

-d

Enable detailed network timing analysis

false

--log-file

-l

Path to a CSV file for logging latency over time (appends if file exists)


--interval

-i

Delay in milliseconds between samples

0

Examples

Single Sample

Bash
get --channel "VOLTAGE_SENSOR_1"

Multiple Samples with Statistics

Bash
get --channel "TEMPERATURE_1" --samples 100

Using Short Options

Bash
get -c "ADC_CH0" -s 1000

With Interval Between Samples

Bash
get -c "TEMPERATURE" -s 100 -i 100

With Detailed Timing Analysis

Bash
get -c "VOLTAGE" -s 50 -d

Logging to CSV File

Bash
get -c "CURRENT_SENSE" -s 1000 -l "latency_log.csv"

Combined Options

Bash
get -c "ADC_CH0" -s 500 -i 10 -l "adc_timing.csv" -d

Output Format

Single Sample

Reading channel: VOLTAGE_SENSOR_1

3.3000 (2.15 ms)

Multiple Samples

Reading channel: VOLTAGE_SENSOR_1

3.3001 (2.10 ms)
3.3002 (2.15 ms)
3.2999 (2.18 ms)
...

Average: 2.14 ms over 100 samples

With Detailed Analysis

Reading channel: VOLTAGE_SENSOR_1
Detailed network timing analysis enabled

3.3001 (2.10 ms)
...

CSV Log Output

When using --log-file, the CSV file contains:

Timestamp,Channel,LatencyMs
2024-01-15 10:30:45.123,ADC_CH0,2.150
2024-01-15 10:30:45.235,ADC_CH0,2.120
...

Output Colors

Channel names and values are colored by channel type (matching the GUI):

  • Values are displayed with type-specific colors via ColorHelper

  • Each sample shows timing in dim text: (2.15 ms)

  • Yellow text indicates detailed analysis mode enabled

  • Magenta text shows average statistics for multiple samples

Performance Metrics

The command provides timing information:

Metric

Description

Per-sample latency

Time for each individual sample acquisition (shown in parentheses)

Average latency

Mean time across all samples (shown when samples > 1)

Additional features:

  • Detailed analysis: Enabled with -d flag, shows network timing breakdown

  • CSV logging: Records timestamp, channel name, and latency for each sample

  • Interval delays: Optional delay between samples using -i option

Behavior

  1. Resolves channel name using regex matching

  2. Displays channel being read with type-specific color

  3. Shows detailed analysis notice if -d flag is used

  4. Opens CSV log file if -l specified (creates with header if new)

  5. For each sample:

    • Records start time

    • Calls GetValue on the channel

    • Records end time and calculates duration

    • Displays value with timing

    • Logs to CSV if enabled

    • Waits for interval if specified and not last sample

  6. After all samples, shows average if samples > 1

  7. Closes CSV log file if used

Channel Name Resolution

The command uses regex matching to find channels:

  • If VOLTAGE is provided, it matches the first channel containing "VOLTAGE"

  • For exact matching, use the full channel name

  • Uses GetFirstChannelNameFromRegex() internally

Use Cases

Performance Testing

Bash
# Test acquisition speed with logging
get -c "FAST_ADC" -s 10000 -l "performance_test.csv"

Value Monitoring with Interval

Bash
# Monitor voltage every 100ms
get -c "VDD_CORE" -s 1000 -i 100

Network Timing Analysis

Bash
# Analyze network latency
get -c "SENSOR" -s 100 -d

Long-term Logging

Bash
# Log data over time (appends to existing file)
get -c "TEMPERATURE" -s 5000 -i 1000 -l "temp_log.csv"

Notes

  • Requires an active connection (use init first)

  • Samples are captured sequentially (not parallel)

  • Timing includes network/communication overhead

  • Large sample counts may take significant time

Performance Considerations

  • Sample acquisition time varies by channel type:

    • Fast: Digital I/O (< 1 ms)

    • Medium: ADC channels (2-5 ms)

    • Slow: Complex calculations (> 10 ms)

  • Network latency affects timing:

    • Local network: 1-5 ms overhead

    • Remote network: 10-100 ms overhead

Error Handling

Common errors:

  • Channel not found: Check channel name or use list to see available channels

  • Not connected: Run init command first

  • Timeout: Channel may not be responding