rfid 系統與應用

35
Department of Aeronautical Engineering RFID 系系系系系 系系COMM Port 系系系系系

Upload: tomas

Post on 01-Feb-2016

87 views

Category:

Documents


0 download

DESCRIPTION

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 標準 定義了 傳輸介面 和 初始化 。 - PowerPoint PPT Presentation

TRANSCRIPT

  • RFIDCOMM Port

  • ISO 15693ISO 15693Contactless Vicinity Smart CardsVicinity CardVICC Vicinity Integrated Circuit Card 0~100cmISO 15693-1ISO 15693-2ISO 15693-3ku and U7 RFID

  • 13.56MKz7KHz64(UIDUnique Identifier)UID 6(1~48 bit) 1(49~56 bit) 0xE0ReaderTag----ISO 15693

  • ISO 15693 8bitsMSBE0IC 8bits48bitsLSBUIDE0 04 021518010109 6Bytes

  • ISO 15693 Tag

  • Supported Command Set

  • Memory Organization

  • U Reader15693Get 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 commandEx.:Request : 0x1B, I Response : 0x1B, 0x0E, 0x0F, 0x79, 0x66, 0x47, 0x01, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0x3F, 0x03, 0x87

  • A. Request Command: 0x1B, I, Chr(13) B.7 Bytes Reader161B054661696C21 1. : 0x1B, 1B054661696C212. : 0x05 ( 5) , 1B054661696C21 3. Fail! , 1B054661696C21 F = Asc( 0x46), a = Asc( 0x61), i = Asc( 0x69), l= Asc( 0x6C), != Asc( 0x21)

  • B. 16 Bytes1B0E0FB0416118000007E000003F038B1. 0x1B "1B0E0FB0416118000007E000003F038B" 2. 0x0E ( 14) , 1B0E0FB0416118000007E000003F038B 3. Flags 1B0E0FB0416118000007E000003F038B 4. (UID) 8 Bytes 1B0E0FB0416118000007E000003F038B 5.DSFID1 Byte 1B0E0FB0416118000007E000003F038B 6.AFI 1B0E0FB0416118000007E000003F038B 7..VICC (CRC)2 Bytes 1B0E0FB0416118000007E000003F038B 8.IC_r 1B0E0FB0416118000007E000003F038B

  • 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)

  • 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 0x00Unlocked, 0x01Locked

  • 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 commandEX: Request : 0x1B, L, 0x01 Response : 0x1B, 0x05, Done!

  • Inventory Mode: ReaderUID 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

  • 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!

  • AFI: Application Family Identifier 1 ByteOptionalNot support: 00H

  • DSFID: Data Storage Format Identifier1 ByteVICCOptionalNot support: 00H

  • CRC: Cyclic Redundancy Check2 bytes

  • CRC: Cyclic Redundancy CheckingCRCCRC99.95%CRCCRC-16CCITTV.41CCITT-16 CRC16BCSCRCTISeries 2000 ReaderCCITT-16 CRC10 SourceTI-RFid

  • VICC Memory Organization

  • Request Command Format

  • Response Data Format

  • COMM Port2005 VB.NET

  • SerialPort Name: comReader

  • 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 WithU-Reader Baud-Rate19200, 8, n, 1 (default)

  • 2. COM port comReader.Open() ' comReader.DiscardInBuffer() ' comReader.DiscardOutBuffer() '

    3. Reader comReader.WriteLine( Chr(&H1B) & "I" & Chr(13) )

    4. ReaderResponseDim DFDelay As Single = 0.5 Call Delay(DFDelay) ' Delay

  • 5. Reader ResponseDim BufData As String = ""Dim BufByte() As ByteIf 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) '1016() Next

  • 6. ResponsetxtResponse.Text = BufDatatxtMessage.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)

  • 7. COM port comReader.Close()

  • (Form1.vp)

  • e-CampusWORDPDF

  • ASCII Code

  • Extended ASCII Code