VisionBox .NET Library
CamTrig_Example.cs

C# example for using the CameraTrigger device

1 
2 using System;
3 using VIB_NET;
4 
5 namespace CSharp
6 {
7  class CamTrig_Example
8  {
9  public static void CameraTrigger()
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.CameraTrigger cameraTrigger = new VIB_NET.CameraTrigger())
17  {
18  // Open camera trigger device 0
19  cameraTrigger.Open(0);
20 
21  // Show number of outputs of the camera trigger device
22  Console.WriteLine("\nCamera Trigger:\n\tNumber Of Outputs: " + cameraTrigger.NumberOfOutputs.ToString());
23 
24  // Switch on all camera outputs
25  cameraTrigger.SetAll(VIB_NET.CameraTrigger.eTRG_SOURCE.ON, false, true, false, false);
26  System.Threading.Thread.Sleep(1000);
27 
28  // Switch off all camera outputs
29  cameraTrigger.SetAll(VIB_NET.CameraTrigger.eTRG_SOURCE.OFF, false, true, false, false);
30 
31  // Switch on camera channel 0
32  cameraTrigger.Set(0, VIB_NET.CameraTrigger.eTRG_SOURCE.ON, false, true, false, false);
33  System.Threading.Thread.Sleep(1000);
34 
35  // Switch off camera channel 0
36  cameraTrigger.Set(0, VIB_NET.CameraTrigger.eTRG_SOURCE.OFF, false, true, false, false);
37 
38  } // Close all devices
39  }
40  catch (System.Exception e)
41  {
42  Console.WriteLine(e.Message);
43  }
44 
45  Console.WriteLine("\nPress enter to proceed...");
46  System.Console.ReadLine();
47  }
48  }
49 }
VIB_NET
All relevant classes and functions are residing in this namespace.
Definition: CameraLinkIn.cpp:6
VIB_NET::CameraTrigger::eTRG_SOURCE
eTRG_SOURCE
Camera trigger source, used by Set() and SetAll()
Definition: VIB_NET.h:1183
VIB_NET::CameraTrigger
This class controls the digital camera trigger output.
Definition: VIB_NET.h:1177