CVBpy 14.0
DigitalIO Class Reference

Digital I/O operations on a device. More...

Inherits object.

Public Member Functions

bool read_input_bit (self, int port)
 Reads a single input port from the device. More...
 
int read_input_group (self, int group)
 Reads a group of input ports from the device. More...
 
bool read_output_bit (self, int port)
 Reads a single output port from the device. More...
 
int read_output_group (self, int group)
 Reads a group of output ports from the device. More...
 
None write_output_bit (self, int port, bool value)
 Writes a single output port to the device. More...
 
None write_output_group (self, int port, int value, int mask=0xFFFFFFFF)
 Writes the output group to the device. More...
 

Properties

 input_count = property
 int: Gets the number of digital input ports of the device.
 
 output_count = property
 int: Gets the number of digital output ports of the device.
 

Detailed Description

Digital I/O operations on a device.

Member Function Documentation

◆ read_input_bit()

bool read_input_bit (   self,
int  port 
)

Reads a single input port from the device.

Parameters

port : int Port index to read.

Returns

bool True for input high state, false for low.

◆ read_input_group()

int read_input_group (   self,
int  group 
)

Reads a group of input ports from the device.

Parameters

group : int Group index to read.

Returns

int State of the requested ports mapped to a 32 bit integer.

◆ read_output_bit()

bool read_output_bit (   self,
int  port 
)

Reads a single output port from the device.

Parameters

port : int Port index to read.

Returns

bool True for output high state, false for low.

◆ read_output_group()

int read_output_group (   self,
int  group 
)

Reads a group of output ports from the device.

Parameters

group : int Group index to read.

Returns

int State of the requested ports mapped to a 32 bit integer.

◆ write_output_bit()

None write_output_bit (   self,
int  port,
bool  value 
)

Writes a single output port to the device.

An output group consists of 32 single ports. Non existent ports are ignored. Therefore there is more than one output group, if the output_count is larger than 32.

Parameters

port : int Port index to write.

value : bool Value of port state.

◆ write_output_group()

None write_output_group (   self,
int  port,
int  value,
int   mask = 0xFFFFFFFF 
)

Writes the output group to the device.

An output group consists of 32 single ports. Non existent ports are ignored. Therefore there is more than one output group, if output_count is larger than 32.

Parameters

port : int Port index to write.

value : int Bits of port states.

mask : int Bit mask for the bits being actually set to the ports (by default all bits are set).