📄 main.frm
字号:
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 2400
TabIndex = 10
Top = 285
Width = 1095
End
End
Begin VB.Frame Frame3
Caption = "Command_Type"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 600
TabIndex = 6
Top = 240
Width = 3375
Begin VB.OptionButton Sel_Bit
Caption = "SELECT"
Height = 195
Left = 2160
TabIndex = 34
Top = 360
Value = -1 'True
Width = 1095
End
Begin VB.OptionButton Write_Bit
Caption = "WRITE"
Height = 195
Left = 120
TabIndex = 9
Top = 360
Width = 855
End
Begin VB.OptionButton Read_Bit
Caption = "READ"
Height = 195
Left = 1200
TabIndex = 8
Top = 360
Width = 855
End
End
End
Begin VB.Frame Frame1
Caption = "FLAGS"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 480
TabIndex = 4
Top = 120
Width = 11055
Begin VB.TextBox FLAGS_box
Alignment = 2 'Center
BeginProperty Font
Name = "Courier New"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 10080
TabIndex = 37
Text = "00"
Top = 360
Width = 495
End
Begin VB.CheckBox LOOP_F
Caption = "LOOP_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000012&
Height = 255
Left = 8520
TabIndex = 32
Top = 360
Width = 1335
End
Begin VB.CheckBox INV_F
Caption = "INV_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7320
TabIndex = 31
Top = 360
Width = 975
End
Begin VB.CheckBox LOCK_F
Caption = "LOCK_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6000
TabIndex = 30
Top = 360
Width = 1215
End
Begin VB.CheckBox RF_F
Caption = "RF_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4800
TabIndex = 29
Top = 360
Width = 1095
End
Begin VB.CheckBox AFI_F
Caption = "AFI_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3600
TabIndex = 28
Top = 360
Width = 1095
End
Begin VB.CheckBox CRC_F
Caption = "CRC_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2400
TabIndex = 27
Top = 360
Width = 975
End
Begin VB.CheckBox TID_F
Caption = "TID_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 26
Top = 360
Width = 975
End
Begin VB.CheckBox RID_F
Caption = "RID_F"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 25
Top = 360
Width = 975
End
End
Begin VB.TextBox HostCommand_box
BeginProperty Font
Name = "Courier New"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 2
Top = 6360
Width = 11055
End
Begin VB.CommandButton btnExit
Caption = "E&xit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 1
Top = 9240
Width = 2235
End
Begin VB.CommandButton btnSendHostCommand
Caption = "&Send Host Command"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 8280
TabIndex = 0
Top = 7080
Width = 3195
End
Begin MSCommLib.MSComm MSComm1
Left = 5520
Top = 9120
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = 0 'False
InBufferSize = 256
InputLen = 255
RThreshold = 1
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Target Response:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 39
Top = 7560
Width = 2055
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "Host Request:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 3
Top = 6120
Width = 1695
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
Begin VB.Menu mnuBaudRate
Caption = "&System"
Begin VB.Menu mnuBaudRate_show
Caption = "Detect Reader"
End
Begin VB.Menu mnuSystem_batt
Caption = "Read Battery Voltage"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'-------------------------------------------------------
'Declarations to Disable the 'X' button on the form menu
'-------------------------------------------------------
Private Const SC_CLOSE As Long = &HF060&
Private Const MF_BYCOMMAND = &H0&
Private Declare Function DeleteMenu Lib "user32.dll" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32.dll" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
'-----------------------------------------------------------------------------------------------------------------------------------
Rem SkyeTek Protocol REQUEST fields
Dim response$
Dim flags% ' FLAGS field
Dim command% ' COMMAND field
Dim temp As String
Dim invalidF As Boolean
Dim tag_type As String
Dim secondLF As Boolean
Dim freezeF As Boolean
Dim protocolF As Boolean
Dim stxF As Boolean
Dim fwverH$
Dim fwverL$
Dim fwver$
Dim serNum$
Dim protocolv2 As Boolean
Public Function GetResponse() 'gets called from form 7 also
Dim Start As Single
' wait .1 second to give the reader time to process the command before it responds
Start = Timer
Do
Loop Until (Timer - Start) > 0.2
response$ = ""
Do While frmMain.MSComm1.InBufferCount > 0
DoEvents
response$ = response$ & frmMain.MSComm1.Input
If Right$(response$, 2) = vbCrLf Then
frmMain.MSComm1.InBufferCount = 0 ' clears the receive buffer
Exit Do
End If
Loop
If Not Right$(response$, 2) = vbCrLf Then
' unknown
response$ = ""
GetResponse = False
ElseIf Not Left$(response$, 1) = vbLf Then
' unknown
response$ = ""
GetResponse = False
Else
GetResponse = True
End If
End Function
Private Function IsNotHex(KeyAscii As Integer)
If KeyAscii > &H46 Then
IsNotHex = True
End If
If KeyAscii < &H30 Then
IsNotHex = True
If KeyAscii = 8 Then
IsNotHex = False
End If
End If
If KeyAscii > &H39 Then
If KeyAscii < &H41 Then
IsNotHex = True
End If
End If
End Function
Private Sub ASCII_btn_Click()
protocolF = True
Call refresh_HostCommand_box
Response_box = ""
End Sub
Private Sub Binary_btn_Click()
protocolF = False
Call refresh_HostCommand_box
Response_box = ""
End Sub
Private Sub Clear_Click()
Response_box.Text = ""
secondLF = False
End Sub
Private Function setcom() As Boolean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -