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:
After reset, the VisionBox AGE-X, AGE-X2, AGE-X3 and AGE-X5 use the SATA / CF mode for the last green user LED to indicate disk activity. SetMode() can be used to change the mode for this LED.
Hardware | Number of user LEDs | LED modes (LED_MODE) | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LED_OFF, LED_ON, LED_GEN0, LED_GEN1 | LED_SATA, LED_SATA_CF | LED_SUN | LED_RESET, LED_CF, LED_PCI, LED_RS232, LED_RS422 | ||||||||||||
VisionBox AGE-X5 | 6 | yes | yes | yes | no | ||||||||||
VisionBox AGE-X3 | 2 | yes | yes | yes | no | ||||||||||
VisionBox AGE-X2 | 6 | yes | yes | yes | no | ||||||||||
VisionBox AGE-X1 | 6 | yes | yes | yes | yes | ||||||||||
VisionBox DAYTONA | 6 | yes | no | no | no | ||||||||||
VisionBox LE MANS | 6 | yes | no | no | no | ||||||||||
VisionCam XM | 3 | yes | no | yes | no | ||||||||||
VisionSensor PV3 + I/O Expansion | 6 | yes | no | no | no | ||||||||||
Machine Vision Manager | 6 | 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. More... | |
bool | GetNumberOfLeds (unsigned int &NumberOfLeds) |
Returns number of user controllable LEDs. More... | |
Led () | |
Default constructor for the device object More... | |
bool | Reset () |
Resets the device to default settings. More... | |
bool | Set (unsigned int Val, unsigned int BitMask=0xFFFFFFFF) |
Sets the state of the LEDs. More... | |
bool | SetLED (unsigned int LEDIndex, bool OnOff) |
Sets the state of one LED. More... | |
bool | SetMode (unsigned int LEDIndex, LED_MODE Mode) |
Sets the mode of one LED. 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... | |
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 description