Presentation is loading. Please wait.

Presentation is loading. Please wait.

PCR300 (13.56MHz) Reader RS232/USB.

Similar presentations


Presentation on theme: "PCR300 (13.56MHz) Reader RS232/USB."— Presentation transcript:

1 PCR300 (13.56MHz) Reader RS232/USB

2 PCR300硬體設備架設 RS232 VB + MSCOMM

3 VB讀取PCR300資料 Step1:加入MSCOMM元件 Microsoft Comm Control 6.0

4 VB讀取PCR300資料 Step2:使用MSCOMM元件 同時加入其他元件 COMBO1 COMMAND1 COMBO2 COMMAND2

5 VB讀取PCR300資料 Step3:設定MSCOMM元件 MSCOMM的Rthreshold屬性設定成1

6 VB讀取PCR300資料 Step4:撰寫抓取資料程式 Form_Load:尋找可以使用的com port連線
Command1_Click:啟動連線 Command2_Click:重新連線 MSComm1_OnComm:擷取資料

7 變數宣告 Dim Tampon As String Dim datarow As Boolean
Dim memberstr As String Dim s(4) As String

8 Private Sub Form_Load()
Dim I As Long Dim j As Long Combo1.Clear Combo2.Clear s(1) = "2400,n,8,1" s(2) = "4800,n,8,1" s(3) = "9600,n,8,1" s(4) = "19200,n,8,1" For I = 1 To 4 Combo2.AddItem s(I) Next I For I = 1 To 100 On Error Resume Next MSComm1.Settings = s(3) MSComm1.CommPort = I MSComm1.PortOpen = True If MSComm1.PortOpen Then Combo1.AddItem CStr(I) End If Form1.Picture = Nothing MSComm1.PortOpen = False Next End Sub

9 Private Sub Command1_Click()
If Combo1.ListIndex = -1 Or Combo2.ListIndex = -1 Then MsgBox "請選擇讀卡機設定項!", 16, "錯誤" Exit Sub Else If MSComm1.PortOpen = True Then MSComm1.PortOpen = False End If On Error GoTo errormsg MSComm1.Settings = Combo2.Text MSComm1.CommPort = Combo1.Text MSComm1.PortOpen = True MsgBox "連線成功,請刷卡作最後確認動作!" & vbCrLf & "如無顯示卡號請選擇其它Port測式" errormsg: MsgBox "讀卡機設定錯誤,請重新設定", 16, "錯誤" End Sub

10 Private Sub Command2_Click()
If MSComm1.PortOpen Then MSComm1.PortOpen = False End If Dim I As Long Dim j As Long s(1) = "2400,n,8,1" s(2) = "4800,n,8,1" s(3) = "9600,n,8,1" s(4) = "19200,n,8,1" Combo1.Clear Combo2.Clear For I = 1 To 4 Combo2.AddItem s(I) Next I For I = 1 To 100 On Error Resume Next MSComm1.Settings = s(3) MSComm1.CommPort = I MSComm1.PortOpen = True Combo1.AddItem CStr(I) Next End Sub

11 Private Sub MSComm1_OnComm()
Dim I As Integer Select Case MSComm1.CommEvent Case comEvReceive: Tampon = Tampon & MSComm1.Input If InStr(Tampon, vbCrLf) Then I = InStr(Tampon, vbCrLf) - 1 Text1.Text = Mid(Trim(Tampon), 1, I) Tampon = "" End If Case comEventFrame: MsgBox "讀卡機設定錯誤!", 16, "錯誤" End Select End Sub

12 PR300測試項目 讀取方向:前後左右上下 卡片完全重疊讀取 卡片重疊但離開一段距離讀取 卡片錯開讀取 卡片與讀卡機垂直讀取
隔著壓克力讀取,看讀取距離的變化 隔著水讀取,看讀取距離的變化 隔著鐵讀取,看讀取距離的變化 貼在人身上讀取,看讀取距離的變化 隔著PVC讀取,看讀取距離的變化 隔著木頭讀取,看讀取距離的變化 先放一張卡,再放第二張卡,同時把第一張卡抽走 旁邊使用大哥大,看是否影響讀取


Download ppt "PCR300 (13.56MHz) Reader RS232/USB."

Similar presentations


Ads by Google