VisionBox .NET Library
Led_Example.cs

C# example for using the Led device

1 
2 using System;
3 using VIB_NET;
4 
5 namespace CSharp
6 {
7  class Led_Example
8  {
9  public static void Led()
10  {
11  Console.Clear();
12 
13  try
14  {
15  // Create device objects with the 'using' statement so they get closed automatically:
16  using (VIB_NET.Led led = new VIB_NET.Led())
17  {
18  // open the Led device
19  led.Open();
20 
21  Console.WriteLine("I'm a " + led.Type.ToString() + ".");
22 
23  //Set Led 1 ON and all other OFF
24  led.Set(2, 255);
25  //Set all Leds OFF
26  led.Set(0, 255);
27 
28  //Set all available Leds Step by Step ON and OFF again
29  for (UInt32 i = 0; i < led.NumberOfLEDs; i++)
30  {
31  led.SetLED(i, true);
32  System.Threading.Thread.Sleep(500);
33  led.SetLED(i, false);
34  }
35 
36  //Set Led mode for Led 0 to ON
37  led.SetMode(0, VIB_NET.Led.eLED_MODE.GEN0);
38 
39  //Set Led mode for Led 2 to OFF
40  led.SetMode(2, VIB_NET.Led.eLED_MODE.GEN1);
41 
42  //signal with 300 ms on and 1500 ms off
43  led.ConfigureGenerator(0, 1, 300, 0, 1500);
44 
45  //two pulses(200 ms on, 100 ms off) 500 ms break time(LED off), two pulses ...
46  led.ConfigureGenerator(1, 2, 200, 100, 500);
47 
48  } // Close all devices
49  }
50  catch (System.Exception e)
51  {
52  Console.WriteLine(e.Message);
53  }
54 
55  Console.WriteLine("\nPress enter to proceed...");
56  System.Console.ReadLine();
57  }
58  }
59 }
VIB_NET
All relevant classes and functions are residing in this namespace.
Definition: CameraLinkIn.cpp:6
VIB_NET::Led::eLED_MODE
eLED_MODE
LED mode definitions
Definition: VIB_NET.h:587
VIB_NET::Led
This class controls the status LEDs.
Definition: VIB_NET.h:582