This class controls a group of digital output signals.
For a detailed electrical specification, please take a look at the Hardware Manual for the specific device.
Public Types | |
enum | OUT_SOURCE |
Sources for the digital outputs, used with SetSource() More... | |
Public Member Functions | |
DigitalOutput () | |
Default constructor for the device object More... | |
bool | GetNumberOfOutputs (unsigned int &NumberOfOutputs) |
Returns number of output channels. More... | |
bool | Reset () |
Resets the device to default settings. More... | |
bool | Set (unsigned int Val) |
Sets the state of the digital output signals. More... | |
bool | SetBit (unsigned int BitIndex, bool OnOff) |
Sets the state of the specified digital output. More... | |
bool | SetSource (unsigned int BitIndex, OUT_SOURCE Source, bool InvertOutput) |
Sets the source for the specified output signal. More... | |
Public Member Functions inherited from VIB::iDevice | |
bool | Close () |
Closes a device More... | |
iDevice (const iDevice &device) | |
The copy constructor makes a copy of the existing device object More... | |
bool | isOpen (bool &state) |
Returns the open state of a device object More... | |
bool | Open (unsigned int Index=0) |
Opens a device More... | |
iDevice & | operator= (const iDevice &device) |
The assignment operator makes a copy of the existing device object More... | |
virtual | ~iDevice () |
Deletes the device object More... | |
Sources for the digital outputs, used with SetSource()
VIB::DigitalOutput::DigitalOutput | ( | ) |
Default constructor for the device object
The device must be opened with Open() before it can be used.
bool VIB::DigitalOutput::GetNumberOfOutputs | ( | unsigned int & | NumberOfOutputs | ) |
Returns number of output channels.
NumberOfOutputs | Number of output channels |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::DigitalOutput::Reset | ( | ) |
Resets the device to default settings.
All outputs are turned off.
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::DigitalOutput::Set | ( | unsigned int | Val | ) |
Sets the state of the digital output signals.
The actual number of available outputs is hardware dependent, see GetNumberOfOutputs().
Val |
|
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::DigitalOutput::SetBit | ( | unsigned int | BitIndex, |
bool | OnOff | ||
) |
Sets the state of the specified digital output.
BitIndex | Output index, 0 ... (GetNumberOfOutputs() - 1) |
OnOff | Output value |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::DigitalOutput::SetSource | ( | unsigned int | BitIndex, |
DigitalOutput::OUT_SOURCE | Source, | ||
bool | InvertOutput | ||
) |
Sets the source for the specified output signal.
The power-up value DIG_OUT_SRC_REGISTER is used for manual control by using Set() and SetBit().
BitIndex | Output index, 0 ... (GetNumberOfOutputs() - 1) |
Source | Source for the output |
InvertOutput | Polarity inversion |
true
for success, use VIBSystem::GetLastErrorString() for an error description