📄 form1.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1
Caption = "超前科技 USB FOR JB8 "
ClientHeight = 7290
ClientLeft = 60
ClientTop = 345
ClientWidth = 8475
LinkTopic = "Form1"
ScaleHeight = 7290
ScaleWidth = 8475
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command6
Caption = "读标识符2"
Height = 495
Left = 6600
TabIndex = 28
Top = 4200
Width = 1575
End
Begin VB.CommandButton Command4
Caption = "读标识符1"
Height = 495
Left = 6600
TabIndex = 27
Top = 3480
Width = 1575
End
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 495
Left = 0
TabIndex = 26
Top = 6795
Width = 8475
_ExtentX = 14949
_ExtentY = 873
SimpleText = "asdfasdf"
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 2
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 2822
MinWidth = 2822
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 8819
MinWidth = 8819
EndProperty
EndProperty
End
Begin VB.TextBox DescriptorField
CausesValidation= 0 'False
Height = 1815
Left = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 25
Top = 4920
Width = 6015
End
Begin VB.CommandButton Command2
Caption = "设备标识符"
Height = 495
Left = 6600
TabIndex = 24
Top = 2760
Width = 1575
End
Begin VB.TextBox t3
Height = 285
Left = 6360
TabIndex = 18
Text = "Text4"
Top = 2040
Width = 615
End
Begin VB.TextBox t2
Height = 285
Left = 6360
TabIndex = 17
Text = "Text3"
Top = 1680
Width = 615
End
Begin VB.TextBox t1
Height = 285
Left = 6360
TabIndex = 16
Text = "Text2"
Top = 1320
Width = 615
End
Begin VB.PictureBox Picture3
Height = 255
Left = 4080
ScaleHeight = 195
ScaleWidth = 195
TabIndex = 12
Top = 2640
Width = 255
End
Begin VB.PictureBox Picture2
Height = 255
Left = 3240
ScaleHeight = 195
ScaleWidth = 195
TabIndex = 11
Top = 2640
Width = 255
End
Begin VB.PictureBox Picture1
BackColor = &H0000FF00&
Height = 255
Left = 2400
ScaleHeight = 195
ScaleWidth = 195
TabIndex = 10
Top = 2640
Width = 255
End
Begin VB.TextBox Text1
Height = 1695
Left = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 9
Top = 3000
Width = 6015
End
Begin MSComctlLib.ProgressBar ProgressBar3
Height = 255
Left = 720
TabIndex = 8
Top = 2040
Width = 5535
_ExtentX = 9763
_ExtentY = 450
_Version = 393216
Appearance = 1
Max = 255
End
Begin VB.Timer Timer1
Interval = 1
Left = 6120
Top = 2520
End
Begin VB.CommandButton Stop
Caption = "断开连接"
Height = 375
Left = 4680
TabIndex = 7
Top = 120
Width = 975
End
Begin VB.CheckBox Check3
Caption = "Led 3"
Height = 255
Left = 2760
TabIndex = 6
Top = 720
Width = 975
End
Begin VB.CheckBox Check2
Caption = "Led 2"
Height = 255
Left = 1560
TabIndex = 5
Top = 720
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "Led 1"
Height = 255
Left = 240
TabIndex = 4
Top = 720
Width = 1095
End
Begin MSComctlLib.ProgressBar ProgressBar2
Height = 255
Left = 720
TabIndex = 3
Top = 1680
Width = 5535
_ExtentX = 9763
_ExtentY = 450
_Version = 393216
Appearance = 1
Max = 255
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 255
Left = 720
TabIndex = 2
Top = 1320
Width = 5535
_ExtentX = 9763
_ExtentY = 450
_Version = 393216
Appearance = 1
Max = 255
End
Begin VB.CommandButton Start
Caption = "开始连接"
Height = 375
Left = 240
TabIndex = 1
Top = 120
Width = 975
End
Begin VB.TextBox Status
Height = 285
Left = 1440
TabIndex = 0
Top = 120
Width = 3015
End
Begin VB.Label Label8
Caption = "按键显示:"
Height = 255
Left = 1080
TabIndex = 23
Top = 2520
Width = 855
End
Begin VB.Label Label7
Caption = "传感器"
Height = 255
Left = 2760
TabIndex = 22
Top = 1080
Width = 735
End
Begin VB.Label Label6
Caption = "第三路"
Height = 255
Left = 120
TabIndex = 21
Top = 2040
Width = 735
End
Begin VB.Label Label5
Caption = "第二路"
Height = 255
Left = 120
TabIndex = 20
Top = 1680
Width = 615
End
Begin VB.Label Label4
Caption = "第一路"
Height = 255
Left = 120
TabIndex = 19
Top = 1320
Width = 615
End
Begin VB.Label Label3
Caption = "Key 3"
Height = 255
Left = 3960
TabIndex = 15
Top = 2400
Width = 495
End
Begin VB.Label Label2
Caption = "Key 2"
Height = 255
Left = 3120
TabIndex = 14
Top = 2400
Width = 495
End
Begin VB.Label Label1
Caption = "Key 1"
Height = 255
Left = 2280
TabIndex = 13
Top = 2400
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' 2 instances required: 1 for read and 1 for write
Dim WithEvents Endpoint1 As USBIOCOMLib.USBIOInterface
Attribute Endpoint1.VB_VarHelpID = -1
Dim WithEvents Endpoint2 As USBIOCOMLib.USBIOInterface
Attribute Endpoint2.VB_VarHelpID = -1
' buffer for reading
Dim readbuffer(7) As Byte
Dim readcounter As Long
Dim writebuffer(7) As Byte
' help function to display errors
Sub ShowError(ErrorCode As Long)
If ErrorCode <> USBIO_ERR_SUCCESS Then
Status.Text = Endpoint1.ErrorText(ErrorCode)
End If
End Sub
Sub Getdeviceinfo()
'Picture1.BackColor = &H8000000F
Dim Status1(5) As Long
Dim buf(8) As Byte
Dim i As Byte
Endpoint1.GetDriverInfo Status1(0), Status1(1), Status1(2), Status1(3), Status1(4)
'Endpoint1.GetDeviceDescriptor buf, status1(0), status1(1)]
'Endpoint1.GetDescriptor buf, status1(0), status1(1), status1(2), status1(3), status1(4), status1(5)
'Endpoint1.GetStringDescriptor buf, status1(0), buf(8), status1(1), status1(2)
For i = 0 To 5
Text1.Text = Text1.Text & Str(Status1(i))
'Text1.Text = Text1.Text & Str(buf(i))
Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -