Skip to content

Names of channels in otii-tcp-client-python? #10

@HelgeCPH

Description

@HelgeCPH

I would like to use the OTII Automation toolbox with Python (otii-tcp-client-python).
Furthermore, I would like to configure the device to record the channels "Main current", "Main voltage", and "Main power".
In the GUI, these are called as above, see the following screenshot:

Screenshot from 2024-02-19 15-47-18

Unfortunately, I do not know how these channels have to be called when calling the method enable_channel of the Arc device class.

"Main current" and "Main voltage" seem to be referred to by the strings "mc" and "mv" respectively.
These strings are used in some of the examples, e.g., basic measurement example or the documentation page example.

What are the string names for the other channels? I can neither find them in the examples nor in the documentation.

In particular, what is the string referring to "Main power"? Is it "mp"?

Thank you for your help in advance.


I would suggest to modify the method enable_channel method of the Arc class so that it does not receive a string as channel parameter.
Instead, it could receive instances of a Channel Enum, see below.
Then the code would be more self-documenting.

from enum import Enum


class Channel(Enum):
    MAIN_CURRENT = "mc"
    MAIN_VOLTAGE = "mv"
    MAIN_POWER = "mp"
    ADC_CURRENT = "adcc"
    ADC_VOLTAGE = "adcv"
    ADC_POWER = "adcp"
    SENSE_MINUS_VOLTAGE = "smv"
    SENSE_PLUS_VOLTAGE = "spv"
    GPI_1 = "gpi1"
    GPI_2 = "gpi2"

A call to the method would then look like the following

device.enable_channel(Channel.MAIN_CURRENT, True)

I believe such a change could help others than me :)
In case you like it, I will implement it and send a respective pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions