-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInpOutNet.vb
More file actions
84 lines (72 loc) · 2.51 KB
/
InpOutNet.vb
File metadata and controls
84 lines (72 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Public Class InpOutNet
Public Sub Out32(ByVal PortAddress As Short, ByVal Data As Short)
If IntPtr.Size = 4 Then
InpOut32.Out32(PortAddress, Data)
Else
InpOut64.Out32(PortAddress, Data)
End If
End Sub
Public Function Inp32(ByVal PortAddress As Short) As Short
If IntPtr.Size = 4 Then
Return InpOut32.Inp32(PortAddress)
Else
Return InpOut64.Inp32(PortAddress)
End If
End Function
Public Function IsInpOutDriverOpen() As Boolean
If IntPtr.Size = 4 Then
Return InpOut32.IsInpOutDriverOpen()
Else
Return InpOut64.IsInpOutDriverOpen()
End If
End Function
Public Function IsXP64Bit() As Boolean
If IntPtr.Size = 4 Then
Return InpOut32.IsXP64Bit
Else
Return InpOut64.IsXP64Bit
End If
End Function
Public Function DlPortReadPortUchar(ByVal Port As UShort) As Byte
If IntPtr.Size = 4 Then
Return InpOut32.DlPortReadPortUchar(Port)
Else
Return InpOut64.DlPortReadPortUchar(Port)
End If
End Function
Public Sub DlPortWritePortUchar(ByVal Port As UShort, ByVal Data As Byte)
If IntPtr.Size = 4 Then
InpOut32.DlPortWritePortUchar(Port, Data)
Else
InpOut64.DlPortWritePortUchar(Port, Data)
End If
End Sub
Public Function DlPortReadPortUshort(ByVal Port As UShort) As UShort
If IntPtr.Size = 4 Then
Return InpOut32.DlPortReadPortUshort(Port)
Else
Return InpOut64.DlPortReadPortUshort(Port)
End If
End Function
Public Sub DlPortWritePortUshort(ByVal Port As UShort, ByVal Data As UShort)
If IntPtr.Size = 4 Then
InpOut32.DlPortWritePortUshort(Port, Data)
Else
InpOut64.DlPortWritePortUshort(Port, Data)
End If
End Sub
Public Function DlPortReadPortUlong(ByVal Port As UShort) As ULong
If IntPtr.Size = 4 Then
Return InpOut32.DlPortReadPortUlong(Port)
Else
Return InpOut64.DlPortReadPortUlong(Port)
End If
End Function
Public Sub DlPortWritePortUlong(ByVal Port As UShort, ByVal Data As ULong)
If IntPtr.Size = 4 Then
InpOut32.DlPortWritePortUlong(Port, Data)
Else
InpOut64.DlPortWritePortUlong(Port, Data)
End If
End Sub
End Class