dwfpy.digital_io.DigitalIoChannel

class DigitalIoChannel(module, channel)[source]

Bases: object

Represents an Digital IO channel.

Methods

setup

Sets up the channel.

Attributes

can_read

Returns True of the pin can be read.

can_write

Returns True of the pin can be written.

device

Gets the device.

enabled

Enables or disables the pin as an output.

index

Gets the channel index.

input_state

Gets the input state of the pin.

label

Gets or sets the channel label.

module

Gets the Digital IO module.

output_state

Gets or sets the ouput state of the pin.

property can_read: bool

Returns True of the pin can be read.

Return type

bool

property can_write: bool

Returns True of the pin can be written.

Return type

bool

property device: Device

Gets the device.

Return type

Device

property enabled: bool

Enables or disables the pin as an output.

Return type

bool

property index: int

Gets the channel index.

Return type

int

property input_state: bool

Gets the input state of the pin. Before calling this function, call the ‘read_status()’ function to read the Digital I/O states from the device.

Return type

bool

property label: str

Gets or sets the channel label.

Return type

str

property module: DigitalIo

Gets the Digital IO module.

Return type

DigitalIo

property output_state: bool

Gets or sets the ouput state of the pin.

Return type

bool

setup(enabled=None, state=None, configure=None)[source]

Sets up the channel.

enabledbool, optional

If True, then the channel is configured as an output.

statebool, optional

The output state.

configurebool, optional

If True, then the instrument is configured.

Return type

None