This class controls the status LEDs.
The most hardware platforms provide user controllable status LEDs.
For systems with dual color LEDs, the API uses even LED index numbers to control the green LEDs and odd LED index numbers to control the red LEDs (green: 0, 2, 4; red: 1, 3, 5).
The LEDs can be controlled by the following means:
Hardware | Number of user LEDs | LED modes (LED_MODE) | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LED_OFF, LED_ON | LED_GEN0, LED_GEN1 | LED_SATA, LED_HDD | LED_SUN | LED_RESET, LED_CF, LED_PCI, LED_RS232, LED_RS422 | |||||||||||
VisionBox AGE-X5[1] / AGE-X6[1] | 6 | yes | yes | yes | yes | no | |||||||||
VisionBox AGE-X3[1] | 2 | yes | yes | yes | yes | no | |||||||||
VisionBox AGE-X2[1] | 6 | yes | yes | yes | yes | no | |||||||||
VisionBox AGE-X1[1] | 6 | yes | yes | yes | yes | yes | |||||||||
VisionBox DAYTONA | 6 | yes | yes | no | no | no | |||||||||
VisionBox LE MANS | 6 | yes | yes | no | no | no | |||||||||
VisionBox AI | 6 | yes | yes | yes (M.2) | no | no | |||||||||
VisionBox AI Baisc[2] | 2 | yes | no | no | no | no | |||||||||
VisionCam XM | 3 | yes | yes | no | no | no | |||||||||
VisionCam XM2 | 2 | yes | yes | no | no | no | |||||||||
VisionSensor PV3 + I/O Expansion | 6 | yes | yes | no | no | no | |||||||||
Machine Vision Manager | 6 | yes | yes | no | yes | no |
Public Types | |
enum | LED_MODE |
LED mode definitions. More... |
Public Member Functions | |
bool | ConfigureGenerator (unsigned int GeneratorIndex, unsigned int BlinkCount, unsigned int ms_ton, unsigned int ms_toff, unsigned int ms_tpause) |
Configures the LED signal generator. | |
bool | GetNumberOfLeds (unsigned int &NumberOfLeds) |
Returns number of user controllable LEDs. | |
Led () | |
Default constructor for the device object. | |
bool | Reset () |
Resets the device to default settings. | |
bool | Set (unsigned int Val, unsigned int BitMask=0xFFFFFFFF) |
Sets the state of the LEDs. | |
bool | SetLED (unsigned int LEDIndex, bool OnOff) |
Sets the state of one LED. | |
bool | SetMode (unsigned int LEDIndex, LED_MODE Mode) |
Sets the mode of one LED. | |
bool | SetMode (unsigned int LEDIndex, LED_MODE Mode, bool Invert) |
Sets the mode of one LED. | |
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. |
enum VIB::Led::LED_MODE |
LED mode definitions.
The mode is used with SetMode() to specify the source signal for the LED.
VIB::Led::Led | ( | ) |
Default constructor for the device object.
The device must be opened with Open() before it can be used.
bool VIB::Led::ConfigureGenerator | ( | unsigned int | GeneratorIndex, |
unsigned int | BlinkCount, | ||
unsigned int | ms_ton, | ||
unsigned int | ms_toff, | ||
unsigned int | ms_tpause ) |
Configures the LED signal generator.
Two signal generators can be used to create a periodic sequence of pulses. The LED on time, off time and the pause time between each sequence can be adjusted. The resolution is a multiple of 100 ms.
In order to use a generator, SetMode() has to be called with LED_GEN0 / LED_GEN1.
GeneratorIndex | Generator index, 0 or 1 |
BlinkCount | Number of pulses for each sequence, 1 ... 16 |
ms_ton | LED on time in milliseconds, 100 ... 6400 |
ms_toff | LED off time in milliseconds, 100 ... 6400 |
ms_tpause | Pause time in milliseconds, 0 ... 6400 |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Led::GetNumberOfLeds | ( | unsigned int & | NumberOfLeds | ) |
Returns number of user controllable LEDs.
NumberOfLeds | Number of LEDs |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Led::Reset | ( | ) |
Resets the device to default settings.
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Led::Set | ( | unsigned int | Val, |
unsigned int | BitMask = 0xFFFFFFFF ) |
Sets the state of the LEDs.
Val | Binary representation of the LEDs |
BitMask | Mask bits can be used to change only certain outputs, LSB is LED0 |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Led::SetLED | ( | unsigned int | LEDIndex, |
bool | OnOff ) |
Sets the state of one LED.
LEDIndex | Index of the LED, 0 ... (GetNumberOfLeds() - 1) |
OnOff | Enable/disable LED |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Led::SetMode | ( | unsigned int | LEDIndex, |
LED_MODE | Mode ) |
Sets the mode of one LED.
LEDIndex | Index of the LED, 0 ... (GetNumberOfLeds() - 1) |
Mode | LED mode |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Led::SetMode | ( | unsigned int | LEDIndex, |
LED_MODE | Mode, | ||
bool | Invert ) |
Sets the mode of one LED.
LEDIndex | Index of the LED, 0 ... (GetNumberOfLeds() - 1) |
Mode | LED mode |
Invert | Invert signal polarity |
true
for success, use VIBSystem::GetLastErrorString() for an error description