⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 15693 多功能射频卡 例程 里面提多语言的完整例子
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "ISO 15693 Reader Demo"
   ClientHeight    =   8310
   ClientLeft      =   3990
   ClientTop       =   2265
   ClientWidth     =   11235
   LinkTopic       =   "Form1"
   ScaleHeight     =   8310
   ScaleWidth      =   11235
   Begin VB.CommandButton Command8 
      Caption         =   "ISO15693_Inventory"
      Height          =   375
      Left            =   960
      TabIndex        =   28
      Top             =   2880
      Width           =   2655
   End
   Begin VB.TextBox Text8 
      Height          =   375
      Left            =   9120
      TabIndex        =   24
      Text            =   "Text8"
      Top             =   5880
      Width           =   1095
   End
   Begin VB.CommandButton Command7 
      Caption         =   "Command7"
      Height          =   375
      Left            =   960
      TabIndex        =   23
      Top             =   6720
      Width           =   2655
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      ItemData        =   "Form1.frx":0000
      Left            =   4920
      List            =   "Form1.frx":0013
      TabIndex        =   22
      Text            =   "Combo1"
      Top             =   5880
      Width           =   975
   End
   Begin VB.TextBox Text7 
      Height          =   375
      Left            =   6120
      TabIndex        =   21
      Text            =   "Text7"
      Top             =   5880
      Width           =   2535
   End
   Begin VB.CommandButton Command6 
      Caption         =   "Write"
      Height          =   375
      Left            =   960
      TabIndex        =   20
      Top             =   6000
      Width           =   2655
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   5160
      MaxLength       =   14
      TabIndex        =   19
      Text            =   "Text6"
      Top             =   4800
      Width           =   1815
   End
   Begin VB.CommandButton Command5 
      Caption         =   "READ"
      Height          =   375
      Left            =   960
      TabIndex        =   18
      Top             =   5400
      Width           =   2655
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   5160
      TabIndex        =   17
      Text            =   "Text5"
      Top             =   4320
      Width           =   1815
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Get Information"
      Height          =   375
      Left            =   960
      TabIndex        =   16
      Top             =   4320
      Width           =   2655
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   4440
      TabIndex        =   15
      Text            =   "Text4"
      Top             =   3600
      Width           =   2535
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   4440
      TabIndex        =   13
      Text            =   "Text3"
      Top             =   3120
      Width           =   2535
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   4440
      TabIndex        =   11
      Text            =   "Text2"
      Top             =   2640
      Width           =   2535
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   4440
      TabIndex        =   9
      Text            =   "Text1"
      Top             =   2160
      Width           =   2535
   End
   Begin VB.CommandButton Command3 
      Caption         =   "ISO15693_Inventorys"
      Height          =   375
      Left            =   960
      TabIndex        =   7
      Top             =   2160
      Width           =   2655
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Close Port"
      Height          =   375
      Left            =   4440
      TabIndex        =   6
      Top             =   1320
      Width           =   2535
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Open Port"
      Height          =   375
      Left            =   960
      TabIndex        =   4
      Top             =   1320
      Width           =   2655
   End
   Begin VB.ComboBox cb_btl 
      Height          =   300
      ItemData        =   "Form1.frx":0026
      Left            =   5760
      List            =   "Form1.frx":0036
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   840
      Width           =   1215
   End
   Begin VB.ComboBox cb_ckh 
      Height          =   300
      ItemData        =   "Form1.frx":0056
      Left            =   2280
      List            =   "Form1.frx":0075
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   840
      Width           =   1275
   End
   Begin VB.Label Label9 
      Caption         =   "Block:"
      Height          =   375
      Left            =   3840
      TabIndex        =   27
      Top             =   5880
      Width           =   615
   End
   Begin VB.Label Label8 
      Caption         =   "AFI:"
      Height          =   255
      Left            =   4080
      TabIndex        =   26
      Top             =   4920
      Width           =   735
   End
   Begin VB.Label Label7 
      Caption         =   "DSFID:"
      Height          =   255
      Left            =   4080
      TabIndex        =   25
      Top             =   4320
      Width           =   735
   End
   Begin VB.Label Label6 
      Caption         =   "UID4:"
      Height          =   375
      Left            =   3840
      TabIndex        =   14
      Top             =   3720
      Width           =   735
   End
   Begin VB.Label Label5 
      Caption         =   "UID3:"
      Height          =   255
      Left            =   3840
      TabIndex        =   12
      Top             =   3240
      Width           =   495
   End
   Begin VB.Label Label4 
      Caption         =   "UID2:"
      Height          =   255
      Left            =   3840
      TabIndex        =   10
      Top             =   2760
      Width           =   495
   End
   Begin VB.Label Label3 
      Caption         =   "UID1:"
      Height          =   255
      Left            =   3840
      TabIndex        =   8
      Top             =   2280
      Width           =   495
   End
   Begin VB.Label lb_info 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   840
      TabIndex        =   5
      Top             =   7440
      Width           =   6255
   End
   Begin VB.Label Label2 
      Caption         =   "BAUD:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4320
      TabIndex        =   2
      Top             =   840
      Width           =   1155
   End
   Begin VB.Label Label1 
      Caption         =   "PORT:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   960
      TabIndex        =   0
      Top             =   840
      Width           =   1245
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim portopen

Private Sub Command1_Click()
Dim i&, j%, port&, baud&, buf1(200) As Byte, b1 As Byte, s1$
port = cb_ckh.ListIndex + 1
If (port = 0) Then
    lb_info.Caption = "Select COM Port Please!"
End If
baud = CLng(cb_btl.Text)
If (baud = 0) Then
    lb_info.Caption = "Select Baud Rate Please!"
End If
'打开串口
i = rf_init_com(port, baud)
If (i <> 0) Then
    lb_info.Caption = "Open Port Fail!"
    Exit Sub
   Else: lb_info.Caption = "Open Port Success!"
    
End If
End Sub

Private Sub Command2_Click()
Dim i&

i = rf_ClosePort()

If (i <> 0) Then
    lb_info.Caption = "Close Port Fail!"
    Exit Sub
   Else: lb_info.Caption = "Close Port Success!"
    
End If



End Sub

Private Sub Command3_Click()
Dim i&, m&, buf1(200) As Byte, buf2(200) As Byte, pData$, b1 As Byte, b2 As Byte, b3 As Byte
   i = ISO15693_Inventorys(0, buf2(0), b2)
If (i <> 0) Then
    lb_info.Caption = "Find Card Fail!"
    Exit Sub
   
End If

For i = 0 To b2 - 1
    pData = pData & Right("00" & Hex(buf2(i)), 2)
Next i

If (b2 = 9) Then
        Text1 = Mid(pData, 3, 16)
        Text2 = ""
        Text3 = ""
        Text4 = ""
        lb_info.Caption = "Find A Card!"
 End If
   If (b2 = 18) Then
        Text1 = Mid(pData, 3, 16)
        Text2 = Mid(pData, 21, 16)
        Text3 = ""
        Text4 = ""
        lb_info.Caption = "Find Two Piece Card!"
   End If
   If (b2 = 27) Then
        Text1 = Mid(pData, 3, 16)
        Text2 = Mid(pData, 21, 16)
        Text3 = Mid(pData, 39, 16)
        Text4 = ""
        lb_info.Caption = "Find Three Piece Card!"
  End If
  If (b2 = 36) Then
        Text1 = Mid(pData, 3, 16)
        Text2 = Mid(pData, 21, 16)
        Text3 = Mid(pData, 39, 16)
        Text4 = Mid(pData, 57, 16)
        lb_info.Caption = "Find Four Piece Card!"
  End If
    
End Sub

Private Sub Command4_Click()
Dim i&, m&, buf1(200) As Byte, buf2(200) As Byte, pData$, b1 As Byte, b2 As Byte, b3 As Byte
  '请注意,针对你现在用的卡,model =0,即cobo1.listindex=0 才行。
'  b3 = Val(Text8.Text)
  i = ISO15693_Get_System_Information(256, 0, buf1(0), buf2(0), b2)

If (i <> 0) Then
    lb_info.Caption = "Get System Information Fail!"
    Exit Sub
   
End If

For i = 0 To b2 - 1
    pData = pData & Right("00" & Hex(buf2(i)), 2)
Next i

 
        Text7 = Mid(pData, 3, 16)
        lb_info.Caption = "Get Information Success!"
End Sub

Private Sub Command5_Click()
Dim i&, m&, buf1(200) As Byte, buf2(200) As Byte, s1$, b1 As Byte, b2 As Byte, b3 As Byte

s1 = Trim(Text6.Text)
If (Len(s1) <> 14) Then
    lb_info.Caption = "Error Data Length "
'    tx_sj.SetFocus
    Exit Sub
End If
For i = 0 To 6
    buf2(i) = Val("&H" & Mid(s1, i * 2 + 1, 2))
Next i

i = WriteTime(0, buf2(0))
If (i <> 0) Then
    lb_info.Caption = "Set Time Fail!"
    Exit Sub
End If

lb_info.Caption = "Set Time Success!"
    
End Sub

Private Sub Command6_Click()
Dim i&, m&, buf1(200) As Byte, buf2(200) As Byte, pData$, b1 As Byte, b2 As Byte, b3 As Byte
  '请注意,针对你现在用的卡,model =0,即cobo1.listindex=0 才行。
'  b3 = Val(Text8.Text)
  i = ISO15693_Get_System_Information(256, 0, buf1(0), buf2(0), b2)

If (i <> 0) Then
    lb_info.Caption = "Get System Information Fail!"
    Exit Sub
   
End If

For i = 0 To b2 - 1
    pData = pData & Right("00" & Hex(buf2(i)), 2)
Next i

 
        Text7 = Mid(pData, 3, 16)
        lb_info.Caption = "Get Information Success!"

 
End Sub

Private Sub Form_Load()
   Combo1.ListIndex = 0
   cb_ckh.ListIndex = 0: cb_btl.ListIndex = 1: Text6.Text = "00000000000000"
   Text1.Text = ""
   Text2.Text = ""
   Text3.Text = ""
   Text4.Text = ""
   Text5.Text = ""
   Text7.Text = ""
   Text8.Text = ""
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
Dim i As Integer
  Select Case KeyAscii
    Case 48 To 57
    Case 8
    Case 13
    Case 105
   ' Case 97 To 102
   ' Case 65 To 70
    Case Else:
    aa = MsgBox("Between “0-9”Please", vbOKOnly, "Warning!")
    KeyAscii = 0
  End Select
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -