2 Public Class Strobe_Example
3 Public Shared Sub Strobe()
6 Dim pVIBSystem As VIB_NET.VIBSystem = New VIB_NET.VIBSystem()
7 If (pVIBSystem IsNot Nothing) Then
10 Dim pStrobe As VIB_NET.Strobe = DirectCast(pVIBSystem.OpenDevice(VIB_NET.eDEVICE_TYPE.STROBE, 0), VIB_NET.Strobe)
12 If (pStrobe IsNot Nothing) Then
13 ' Initialisation of the strobe unit
15 Console.WriteLine(vbNewLine + "Strobe initialised")
18 Console.WriteLine(vbNewLine + "Min Off Time: " + pStrobe.SetLimits(0, 24, 0, 1000, 0, 1000).ToString())
21 Console.WriteLine(vbNewLine + "Max Current: " + pStrobe.MaxCurrent.ToString())
22 Console.WriteLine(vbNewLine + "Max On Time: " + pStrobe.MaxOnTime.ToString())
23 Console.WriteLine(vbNewLine + "Min Off Time: " + pStrobe.MinOffTime.ToString())
26 Console.WriteLine(vbNewLine + "Current: " + pStrobe.Current.ToString())
29 Console.WriteLine(vbNewLine + "On Time: " + pStrobe.OnTime.ToString())
32 Console.WriteLine(vbNewLine + "Trigger Delay: " + pStrobe.TriggerDelay.ToString())
35 Console.WriteLine(vbNewLine + "Trigger Mode: " + pStrobe.TriggerMode.ToString())
38 Console.WriteLine(vbNewLine + "Trigger Source: " + pStrobe.TriggerSource.ToString())
40 ' Get trigger source invert
41 Console.WriteLine(vbNewLine + "Trigger Source Invert: " + pStrobe.TriggerSourceInvert.ToString())
44 Console.WriteLine(vbNewLine + "Trigger Voltage: " + pStrobe.Voltage.ToString())
46 ' Set current to 1000 mA without validation
47 pStrobe.Validate = False
48 pStrobe.Current = 1000
50 ' Set current to 1000 mA with validation
51 pStrobe.Validate = True
52 pStrobe.Current = 1000
58 pStrobe.TriggerDelay = 10
61 ' Pay attention to set the trigger mode to HARDWARE before you set the trigger source and the trigger source invert
62 pStrobe.TriggerMode = VIB_NET.Strobe.eSTROBE_MODE.HARDWARE_EDGE
64 ' Get new trigger mode
65 Console.WriteLine(vbNewLine + "New Trigger Mode: " + pStrobe.TriggerMode.ToString())
68 ' Decide if it is a AGEX Type 1-6 or 7 - 12
69 Dim pService As VIB_NET.Service = DirectCast(pVIBSystem.OpenDevice(VIB_NET.eDEVICE_TYPE.SERVICE, 0), VIB_NET.Service)
70 If pService IsNot Nothing Then
71 If (pService.SerialNumber.Substring(8, 1) = "1") Then ' for AGE-X Type 7-12
72 Dim pMultiplexer As VIB_NET.Multiplexer = DirectCast(pVIBSystem.OpenDevice(VIB_NET.eDEVICE_TYPE.MULTIPLEXER, 0), VIB_NET.Multiplexer)
73 ' Connect multiplexer output 3 with digital input 0
74 pMultiplexer.ConnectOutput(0, VIB_NET.Multiplexer.eMUX_SOURCE.DIG_IN0) ' DigIn0 > Mux0
75 pStrobe.TriggerSource = VIB_NET.Strobe.eSTROBE_SOURCE.MUX_OUT0 ' For AGEX Type 8, 9, 10 and 12
76 If (pMultiplexer IsNot Nothing) Then
77 pVIBSystem.CloseDevice(pMultiplexer)
78 pMultiplexer = Nothing
81 pStrobe.TriggerSource = VIB_NET.Strobe.eSTROBE_SOURCE.DIG_IN0 ' For AGEX Type 1-6
83 pVIBSystem.CloseDevice(pService)
88 ' Set trigger source invert
89 pStrobe.TriggerSourceInvert = False
92 Console.WriteLine(vbNewLine + vbNewLine + "New Values: ")
93 Console.WriteLine(vbNewLine + "Current: " + pStrobe.Current.ToString())
94 Console.WriteLine(vbNewLine + "On Time: " + pStrobe.OnTime.ToString())
95 Console.WriteLine(vbNewLine + "Trigger Delay: " + pStrobe.TriggerDelay.ToString())
96 Console.WriteLine(vbNewLine + "Trigger Mode: " + pStrobe.TriggerMode.ToString())
97 Console.WriteLine(vbNewLine + "Trigger Source: " + pStrobe.TriggerSource.ToString())
98 Console.WriteLine(vbNewLine + "Trigger Source Invert: " + pStrobe.TriggerSourceInvert.ToString())
99 Console.WriteLine(vbNewLine + "Trigger Voltage: " + pStrobe.Voltage.ToString())
101 ' Trigger the strobe by Software
102 pStrobe.TriggerMode = VIB_NET.Strobe.eSTROBE_MODE.SOFTWARE_EDGE
103 Console.WriteLine(vbNewLine + "New Trigger Mode: " + pStrobe.TriggerMode.ToString())
104 pStrobe.SwTrigger = True
105 Console.WriteLine(vbNewLine + "Software Trigger")
106 pStrobe.SwTrigger = False
107 pStrobe.TriggerMode = VIB_NET.Strobe.eSTROBE_MODE.HARDWARE_EDGE
108 Console.WriteLine(vbNewLine + "New Trigger Mode: " + pStrobe.TriggerMode.ToString())
110 Catch e As System.Exception
111 Console.WriteLine(e.Message)
114 pVIBSystem.CloseDevice(pStrobe)
117 Catch e As System.Exception
118 Console.WriteLine(e.Message)
124 Console.WriteLine(vbNewLine + "Press enter to proceed...")
125 System.Console.ReadLine()