1 / 35

RFID 系統與應用

RFID 系統與應用. 實作一 COMM Port 連線之建立. 第 7 章 RFID的現有標準規範. ISO 15693-近距型智慧卡. ISO 15693 標準 用以描述非接觸式 近距型智慧卡 ( Contactless Vicinity Smart Cards )的結構和操作參數。 近距型卡( Vicinity Card ) VICC : Vicinity Integrated Circuit Card 讀取範圍: 0~100cm ISO 15693-1 標準 定義了 實際特性 。 ISO 15693-2 標準 定義了 傳輸介面 和 初始化 。

tomas
Download Presentation

RFID 系統與應用

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RFID系統與應用 實作一 COMM Port連線之建立

  2. 第7章 RFID的現有標準規範 ISO 15693-近距型智慧卡 • ISO 15693標準用以描述非接觸式近距型智慧卡(Contactless Vicinity Smart Cards)的結構和操作參數。 • 近距型卡(Vicinity Card) • VICC: Vicinity Integrated Circuit Card • 讀取範圍:0~100cm • ISO 15693-1標準定義了實際特性。 • ISO 15693-2標準定義了傳輸介面和初始化。 • ISO 15693-3標準定義了防碰撞和傳輸協定。 ku and U

  3. Reader和Tag間的標準制訂----ISO 15693標準 • 操作在13.56MKz±7KHz的工作頻率下。 • 內部有一個64位元的唯讀序號(UID,Unique Identifier),用於記錄標籤的唯一碼。 • UID的編碼的格式可分為:6位元組(1~48 bit)的產品編碼,1位元組(49~56 bit)的廠商代碼,最高位元組固定為“0xE0”的代碼。

  4. ISO 15693基本結構 • 8位元(bits)MSB應為’E0’ • IC 廠商碼編碼應為8位元(bits) • 廠品序號碼應為48位元(bits)LSB 舉例:E0 、 04 、021518010109 產商碼、 廠品序號 (6Bytes) UID格式

  5. ISO 15693 Tag基本架構

  6. Supported Command Set

  7. Memory Organization

  8. U Reader(15693)與主機之通信協定 • Get System Information (Read UID) • (1) Without UID: • Request : 0x1B, ‘I’ • Response: 0x1B, data byte-count, RepData (done) • Response: 0x1B, 0x05, “Fail!” (fail) • (2) With UID: • Request : 0x1B, ‘i’, UID • Response : Ref. Without UID command • Ex.: • Request : 0x1B, ‘I’ • Response : 0x1B, 0x0E, 0x0F, 0x79, 0x66, 0x47, 0x01, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0x3F, 0x03, 0x87

  9. A. 送出命令: • Request Command: 0x1B, ‘I’, Chr(13) • B.讀取資料:7 Bytes • 收到Reader的資料解碼步驟:(將收取的資料轉為16進位) • 讀取失敗:“1B054661696C21” • 1. 第一碼為前導字元: 0x1B, “1B054661696C21” • 2. 第二碼為長度: 0x05 ( 即長度5) , “1B054661696C21” • 3. 第三至第七碼 即為“Fail! ”(五個英文字母), “1B054661696C21”F = Asc( 0x46), a = Asc( 0x61), i = Asc( 0x69),l= Asc( 0x6C), != Asc( 0x21)

  10. B.讀取資料: 16 Bytes • 讀取成功:“1B0E0FB0416118000007E000003F038B” • 1. 第一碼為前導字元: 0x1B "1B0E0FB0416118000007E000003F038B" • 2. 第二碼為長度: 0x0E ( 即長度14) , 1B0E0FB0416118000007E000003F038B • 3. 第三碼為Flags: 1B0E0FB0416118000007E000003F038B • 4.第四至十一碼為卡號 (UID): 8 Bytes 1B0E0FB0416118000007E000003F038B • 5.第十二碼為DSFID:1 Byte 1B0E0FB0416118000007E000003F038B • 6.第十三碼為AFI: 1B0E0FB0416118000007E000003F038B • 7.第十四.十五碼為VICC (CRC):2 Bytes 1B0E0FB0416118000007E000003F038B • 8.第十六碼為IC_r: 1B0E0FB0416118000007E000003F038B

  11. Write a block (Write Memories) : • (1) Without UID • Request : 0x1B, ‘W’, block number, data (4 bytes) • Response: 0x1B, 0x05, “Done!” • Response: 0x1B, 0x05, “Fail!” • (2) With UID • Request : 0x1B, ‘w’, UID, block number, data • Response: Ref. Without UID command • EX: • Request : 0x1B, ‘W’, 0x01, 0x01, 0x02, 0x03, 0x04 • Response : 0x1B, 0x05, “Done!” (ASCII Code)

  12. Read a block (Read Memories): • (1) Without UID • Request : 0x1B, ‘R’, block number • Response: 0x1B, data byte-count, RepData (done) • Response: 0x1B, 0x05, “Fail!” (fail) • (2) With UID • Request : 0x1B, ‘r’, UID, block number • Response: Ref. without UID command • EX: • Request : 0x1B, ‘R’, 0x01 • Response : 0x1B, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04 • 0x00:Unlocked, 0x01:Locked

  13. Lock a block: (鎖住後即不可寫入且無法開鎖) • (1) Without UID • Request: 0x1B, ‘L’, block number • Response: 0x1B, 0x05, “Done!” • Response: 0x1B, 0x05, “Fail!” • (2) With UID • Request: 0x1B, ‘l’, UID, block number • Response: Ref. Without UID command • EX: • Request : 0x1B, ‘L’, 0x01 • Response : 0x1B, 0x05, “Done!”

  14. Inventory Mode: 需加長下指令後之等待時間 • 讀取Reader讀取範圍所有卡片的UID資料,讀完傳回 0x1B, 0x03, “End” • Request: 0x1B, ‘M’ • Response : (1) 0x1B, 0x03, “End” • Response : (2) 0x1B, Data byte-count, RepData • EX: • Request : 0x1B, ‘M’ • Response : 0x1B, 0x09, 0x00, 0x97, 0x66, 0x47, 0x01, 0x00, 0x00, 0x07, 0xE0…………..[1] • Response : 0x1B, 0x09, 0x00, 0x79, 0x66, 0x47, 0x01, 0x00, 0x00, 0x07, 0xE0…………..[2] • Response : 0x1B, 0x09, 0x00, 0x1E, 0x94, 0x47, 0x01, 0x00, 0x00, 0x07, 0xE0…………..[3] • Response : 0x1B, 0x03, “End”

  15. Change Baud-Rate: • Request : • 0x1B, ‘B’, 0x00 (4800bps) • 0x1B, ‘B’, 0x01 (9600bps) • 0x1B, ‘B’, 0x02 (14400bps) • 0x1B, ‘B’, 0x03 (19200bps) • 0x1B, ‘B’, 0x04 (28800bps) • 0x1B, ‘B’, 0x05 (38400bps) • 0x1B, ‘B’, 0x06 (57600bps) • 0x1B, ‘B’, 0x07 (115200bps) • Waiting 1 second. • Response : 0x1B, 0x03, “Ok!” • Ex: • Request : 0x1B, ‘B’, 0x06 ( change Baud-Rate 57600 bps ) • Waiting 1 second…. • Response : 0x1B, 0x03, “Ok!”

  16. 專有名詞

  17. AFI: Application Family Identifier • 1 Byte • 表示應用的類型。 • 為可選擇(Optional)資料。 • Not support: 00H

  18. DSFID: Data Storage Format Identifier • 1 Byte • 表示資料儲存於VICC記憶體中的格式 • 為可選擇(Optional)資料。 • Not support: 00H

  19. CRC: Cyclic Redundancy Check • 2 bytes

  20. 第10章 錯誤偵測與改正 CRC: 循環式重複檢查法 • 循環式重複檢查法(Cyclic Redundancy Checking,CRC)是最有效的錯誤偵測法之一,在CRC操作方式之下,高達99.95%的傳輸錯誤可被偵測出。 • 最常用的CRC碼是CRC-16,屬於國際標準CCITT的V.41;在CCITT-16 CRC之下,16位元被使用於BCS上;基本上,CRC字元是除算操作下的餘數。 • TI公司Series 2000 Reader系統也是使用CCITT-16 CRC產生器。 Source:TI-RFid

  21. VICC Memory Organization

  22. Request Command Format

  23. Response Data Format

  24. COMM Port連線之建立:2005 VB.NET

  25. SerialPort 控制元件: 控制項提示工具 Name: comReader

  26. SerialPort 控制元件使用步驟 • 1. 設定COM port相關屬性: name: comReader • With comReader • .PortName = "COM" & comboCOM.Text '通訊阜號 • .BaudRate = 19200 '傳輸速率 • .Parity = IO.Ports.Parity.None '同位檢查位元 • .DataBits = 8 '設定每一位元組之資料位元的標準長度 • .StopBits = IO.Ports.StopBits.One'物件上使用的停止位元數 • .Encoding = System.Text.Encoding.Default '設定編碼方式 • End With • U-Reader Baud-Rate規格:19200, 8, n, 1 (default)

  27. 由屬性視窗設定:

  28. 2. COM port連線測試: • comReader.Open() '開啟阜 • comReader.DiscardInBuffer() '清空接收緩衝區的資料 • comReader.DiscardOutBuffer() '清空傳送緩衝區的資料 • 3. 下命令給Reader:以字串為命令 • comReader.WriteLine(Chr(&H1B) & "I" & Chr(13)) • 4. 等待Reader送回Response資料: • Dim DFDelay As Single = 0.5 • Call Delay(DFDelay) '引用 Delay 時間延遲副程式

  29. 5. 由緩衝區讀出Reader Response資料: • Dim BufData As String = "" • Dim BufByte() As Byte • If comReader.BytesToRead > 0 Then '暫存區字數等於表示讀取失敗==> 16: exist TAG, 7:no TAG • BufData = "" '清空讀取SerialPort暫存區的字串 • ReDim BufByte(comReader.BytesToRead - 1) • comReader.Read(BufByte, 0, comReader.BytesToRead) '接收SerialPort暫存區的位元組 • For i As Integer = LBound(BufByte) To UBound(BufByte) • BufData &= Strings.Right("0" & Hex(BufByte(i)), 2) '將位元組的10進位資料轉為16進位(兩位數) • Next

  30. 6. Response資料顯示至視窗: • txtResponse.Text = BufData • txtMessage.Text = txtMessage.Text & "=====================================" & Chr(13) & Chr(10) • txtMessage.Text = txtMessage.Text & "Start Read Time : " & Now() & Chr(13) & Chr(10) • txtMessage.Text = txtMessage.Text & "Command : 0x1B, 0x49 " & Chr(13) & Chr(10) • txtMessage.Text = txtMessage.Text & "----------------------------------" & Chr(13) & Chr(10) • txtMessage.Text = txtMessage.Text & "回應資料:" & BufData & Chr(13) & Chr(10) • txtMessage.Text = txtMessage.Text & "連線成功!" & Chr(13) & Chr(10)

  31. 7. COM port連線關閉(結束): • comReader.Close()

  32. 附錄:表單與程式碼 (Form1.vp)

  33. 書面報告格式:本次不交 • 封面:班級、組別、組員學號與姓名、實作名稱 • 內容:一、系統功能與方塊圖二、程式架構與流程說明三、表單與程式設計說明四、實作結果討論附錄:表單與程式原始碼 • 報告繳交: • 本校數位學習系統e-Campus/內容/作業之選項中,以電子檔(WORD或PDF格式)繳交。不分組一人繳交一份報告!

  34. ASCII Code

  35. Extended ASCII Code

More Related