CVB.Net 14.0
DigitalIO Class Reference

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

Inherits DeviceInterfaceBase, and IDigitalIO.

Public Member Functions

bool ReadInputBit (int port)
 Reads a single input port from the device. More...
 
BitVector32 ReadInputGroup (int group)
 Reads a single output group from the device. More...
 
bool ReadOutputBit (int port)
 Reads a single output port from the device. More...
 
BitVector32 ReadOutputGroup (int group)
 Reads the output group from the device. More...
 
void WriteOutputBit (int port, bool value)
 Write a single output port to the device. More...
 
void WriteOutputGroup (int group, BitVector32 value)
 Writes the output group to the device. More...
 
void WriteOutputGroup (int group, BitVector32 value, BitVector32 mask)
 Writes the mask ed output group to the device. More...
 
- Public Member Functions inherited from DeviceInterfaceBase
 DeviceInterfaceBase (Device device)
 Ctor. More...
 
bool ReadInputBit (int port)
 Reads a single input port from the device. More...
 
BitVector32 ReadInputGroup (int group)
 Reads the input group from the device. More...
 
bool ReadOutputBit (int port)
 Reads a single output port from the device. More...
 
BitVector32 ReadOutputGroup (int group)
 Reads the output group from the device. More...
 
void WriteOutputBit (int port, bool value)
 Write a single output port to the device. More...
 
void WriteOutputGroup (int group, BitVector32 value)
 Writes the output group to the device. More...
 
void WriteOutputGroup (int group, BitVector32 value, BitVector32 mask)
 Writes the mask ed output group to the device. More...
 

Package Functions

 DigitalIO (Device device)
 Creates a DigitalIO object from the given device . More...
 

Properties

int InputCount [get]
 Gets the number of digital input ports of the Device.
 
int OutputCount [get]
 Gets the number of digital output ports of the Device.
 
- Properties inherited from DeviceInterfaceBase
Device Parent [get]
 The Device this interface works on.
 
- Properties inherited from IDeviceInterface
Device Parent [get]
 The Device this interface works on.
 
- Properties inherited from IDigitalIO
int InputCount [get]
 Gets the number of digital input ports of the Device.
 
int OutputCount [get]
 Gets the number of digital output ports of the Device.
 

Detailed Description

Digital I/O operations on a Device.

Constructor & Destructor Documentation

◆ DigitalIO()

DigitalIO ( Device  device)
package

Creates a DigitalIO object from the given device .

Parameters
deviceParent device.

Member Function Documentation

◆ ReadInputBit()

bool ReadInputBit ( int  port)

Reads a single input port from the device.

Parameters
portPort index to read.
Returns
true for input high state; false for low.

Implements IDigitalIO.

◆ ReadInputGroup()

BitVector32 ReadInputGroup ( int  group)

Reads a single output group from the device.

Parameters
groupPort index to read.
Returns
true for output high state; false for low.

Implements IDigitalIO.

◆ ReadOutputBit()

bool ReadOutputBit ( int  port)

Reads a single output port from the device.

Parameters
portPort index to read.
Returns
true for output high state; false for low.

Implements IDigitalIO.

◆ ReadOutputGroup()

BitVector32 ReadOutputGroup ( int  group)

Reads the output group from the device.

An output group consists of 32 single ports. Non existent ports are always 0. Thus there are only more than one output group if OutputCount is larger than 32.

Parameters
groupGroup index to read.
Returns

Implements IDigitalIO.

◆ WriteOutputBit()

void WriteOutputBit ( int  port,
bool  value 
)

Write a single output port to the device.

Parameters
portPort index to write.
valuetrue for hight state; false for low.

Implements IDigitalIO.

◆ WriteOutputGroup() [1/2]

void WriteOutputGroup ( int  group,
BitVector32  value 
)

Writes the output group to the device.

An output group consists of 32 single ports. Non existent ports are ignored. Thus there are only more than one output group if OutputCount is larger than 32.

Parameters
groupGroup index to write.
valueVector of port states.

Implements IDigitalIO.

◆ WriteOutputGroup() [2/2]

void WriteOutputGroup ( int  group,
BitVector32  value,
BitVector32  mask 
)

Writes the mask ed output group to the device.

An output group consists of 32 single ports. Non existent ports are ignored. Thus there are only more than one output group if OutputCount is larger than 32.

Parameters
groupGroup index to write.
valueVector of port states.
maskBit mask for the bits being actually set to the ports.

Implements IDigitalIO.