1 Public Class Service_Example
2 Public Shared Sub Service()
5 Dim pVIBSystem As VIB_NET.VIBSystem = New VIB_NET.VIBSystem()
7 If (pVIBSystem IsNot Nothing) Then
9 ' Open the service device
10 Dim pService As VIB_NET.Service = DirectCast(pVIBSystem.OpenDevice(VIB_NET.eDEVICE_TYPE.SERVICE, 0), VIB_NET.Service)
13 Console.WriteLine(vbNewLine + vbNewLine + "Serial Number: " + pService.SerialNumber)
15 ' Get system temperature
16 Console.WriteLine(vbNewLine + " System Temperature: " + pService.SystemTemperature.ToString() + " °C")
18 ' Set target temperature for fan
20 pService.FanTargetTemperature = 40
21 Console.WriteLine(vbNewLine + "Set target temperature for the fan control to 40°C. Done")
22 Catch e As System.Exception
23 Console.WriteLine(vbNewLine + "" + e.Message)
27 ' Configure WatchDog to 2000 ms and start it
28 pService.WatchdogSetup(True, 2000)
30 System.Threading.Thread.Sleep(1000)
32 ' Send alive signal to watchdog
33 pService.WatchdogService()
35 System.Threading.Thread.Sleep(1000)
38 pService.WatchdogSetup(False, 2000)
41 ' Remember to use \\ instead of \ in the string with the path and filename
42 ' Only use it, when you have the right firmware from us.
43 Console.WriteLine(vbNewLine + "FirmwareUpdate: ")
44 Dim RunFirmwareUpdate As Boolean = False
45 If (RunFirmwareUpdate) Then
46 pService.FirmwareUpdate("C:\\AGEX.bit")
48 Catch e As System.Exception
49 Console.WriteLine(e.Message)
52 pVIBSystem.CloseDevice(pService)
55 Catch e As System.Exception
56 Console.WriteLine(e.Message)
62 Console.WriteLine(vbNewLine + "Press enter to proceed...")
63 System.Console.ReadLine()