VisionBox .NET Library
Service_Example.cs

C# example for using the Service device

1 
2 using System;
3 using VIB_NET;
4 
5 namespace CSharp
6 {
7  class Service_Example
8  {
9  public static void Service()
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.Service service = new VIB_NET.Service())
17  {
18  // Open the first Service device available
19  service.Open(0);
20 
21  // Get serial number
22  Console.WriteLine("\n\nSerial Number: " + service.SerialNumber);
23 
24  // Get system temperature
25  Console.WriteLine("\n System Temperature: " + service.SystemTemperature.ToString() + " °C");
26 
27  // Set target temperature for fan
28  try
29  {
30  service.FanTargetTemperature = 40;
31  Console.WriteLine("\nSet target temperature for the fan control to 40°C. Done");
32  }
33  catch (System.Exception exception)
34  {
35  Console.WriteLine("\n" + exception.Message);
36  }
37 
38  // WatchdogService
39  // Configure WatchDog to 2000 ms and start it
40  service.WatchdogSetup(true, 2000);
41 
42  System.Threading.Thread.Sleep(1000);
43 
44  // Send alive signal to watchdog
45  service.WatchdogService();
46 
47  System.Threading.Thread.Sleep(1000);
48 
49  // Stop watchdog
50  service.WatchdogSetup(false, 2000);
51 
52  // Run firmware update
53  bool RunFirmwareUpdate = false;
54  if (RunFirmwareUpdate)
55  {
56  // Only use it, when you have the right firmware file.
57  Console.WriteLine("\nFirmwareUpdate: ");
58  service.FirmwareUpdate("AGE_X2.rbf");
59  Console.WriteLine("Firmware update finished, power off required");
60  }
61  } // Close all devices
62  }
63  catch (System.Exception e)
64  {
65  Console.WriteLine(e.Message);
66  }
67 
68  Console.WriteLine("\nPress enter to proceed...");
69  System.Console.ReadLine();
70  }
71  }
72 }
VIB_NET::Service
This class contains functions associated with the hardware component or the whole system
Definition: VIB_NET.h:852
VIB_NET
All relevant classes and functions are residing in this namespace.
Definition: CameraLinkIn.cpp:6