Download presentation
Presentation is loading. Please wait.
1
RWM600 (13.56MHz) Reader Antenna
2
PCR300硬體設備架設 RS232 VB + MSCOMM USB
3
VB讀取RWM600資料 Step1:安裝RWM600X.OCX元件
4
VB讀取RWM600資料 Step2:設計介面 Command1 & command2 RWM600x label1 listbox
5
VB讀取RWM600資料 Step3:撰寫抓取資料程式 Form_Load:清空listbox Command1_Click:啟動連線
RWM600x_OnTagEvent:擷取資料 MODULE1:模組程式
6
變數與API函數宣告 Private Sub Form_Load() List1.Clear End Sub
Const LB_FINDSTRING = &H18F Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As Long Private Sub Form_Load() List1.Clear End Sub
7
Private Sub Command1_Click()
Dim port As String, I As Integer Dim ver As String For I = 0 To 255 port = RWM600x.EnumCommPort(I) If port <> "" Then RWM600x.CommPort = Val(Mid(port, 4)) RWM600x.PortOpen = True If RWM600x.PortOpen Then ver = RWM600x.gnetVersion If InStr(ver, "PGM-T0562") > 0 Then Me.Caption = "ISO15693 Demo " & demoVer & " (" & port & ":" & ver & ")" RWM600x.EnableAutoMode = True Exit Sub End If RWM600x.PortOpen = False Else Exit For Next I Command2.Enabled = 1 Command1.Enabled = 0 End Sub
8
Private Sub Command2_Click()
MsgBox "連線關閉" RWM600x.PortOpen = False Command1.Enabled = 1 Command2.Enabled = 0 Me.Caption = "RWM600SK系統" End Sub
9
Private Sub RWM600x_OnTagEvent(ByVal nEvent As Integer, ByVal nDSFID As Integer)
Dim bUID(7) As Byte ' Byte Array for UID, Size 8 Bytes (0~7) Dim szUID As String Dim I As Long Select Case nEvent Case TAG_PRESENT With RWM600x .GetCurrentUID VarPtr(bUID(0)) szUID = BytesToHexRev(bUID) 'szUID卡號 List1.AddItem szUID Label1.Caption = "卡片數:" + Str(List1.ListCount) End With Case TAG_REMOVED szUID = BytesToHexRev(bUID) List1.RemoveItem (SendMessage(List1.hwnd, LB_FINDSTRING, -1, ByVal CStr(szUID))) End Select End Sub 抓到的是16進制資料,需要轉換成10進制
10
Public total_card As Integer
Public Function BytesToHexRev(ByRef bData() As Byte) As String Dim I As Long, szData As String On Error GoTo Err_Proc For I = LBound(bData) To UBound(bData) szData = Right$(Hex$(&H100 + bData(I)), 2) & szData Next I Err_Exit: BytesToHexRev = szData Exit Function Err_Proc: Debug.Print "ByteToHex - " & Err.Description & "(" & Err.Number & ")" szData = vbNullString Resume Err_Exit End Function
11
RWM600測試項目 讀取方向:天線(Antenna)前後左右上下(ㄧ次一片) 卡片完全重疊讀取(兩張) 卡片重疊但離開一段距離讀取(兩張)
卡片錯開讀取(兩張) 卡片與讀卡機垂直讀取(ㄧ張) 直接丟卡片上去(三張) 一張張放上去(三張) 將卡片放在書裡面一本本放上去(三張) 讀到三張卡片後,一張張拿走 隔著壓克力讀取,看讀取距離的變化 隔著水讀取,看讀取距離的變化 隔著鐵讀取,看讀取距離的變化 貼在人身上讀取,看讀取距離的變化 隔著PVC讀取,看讀取距離的變化 隔著木頭讀取,看讀取距離的變化 旁邊使用大哥大,看是否影響讀取
Similar presentations