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. | |
| bool | GetNumberOfOutputs (unsigned int &NumberOfOutputs) |
| Returns number of output channels. | |
| bool | Reset () |
| Resets the device to default settings. | |
| bool | Set (unsigned int Val) |
| Sets the state of the digital output signals. | |
| bool | SetBit (unsigned int BitIndex, bool OnOff) |
| Sets the state of the specified digital output. | |
| bool | SetSource (unsigned int BitIndex, OUT_SOURCE Source, bool InvertOutput) |
| Sets the source for the specified output signal. | |
| Public Member Functions inherited from VIB::iDevice | |
| bool | Close () |
| Closes a device. | |
| iDevice (const iDevice &device) | |
| The copy constructor makes a copy of the existing device object. | |
| bool | isOpen (bool &state) |
| Returns the open state of a device object. | |
| bool | Open (unsigned int Index=0) |
| Opens a device. | |
| iDevice & | operator= (const iDevice &device) |
| The assignment operator makes a copy of the existing device object. | |
| virtual | ~iDevice () |
| Deletes the device object. | |
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 description| bool VIB::DigitalOutput::Reset | ( | ) |
Resets the device to default settings.
All outputs are turned off.
true for success, use VIBSystem::GetLastErrorString() for an error description| bool 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 description| bool 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 description| bool 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