How can I efficiently write to an RFID tag without using a For
loop. Right now I am looping and filling up all the blocks in the series. I want to make a program were I could fill in specific blocks with specific values. I want to know if there are other ways writing on RFID. The code below shows writing on RFID using the for loop which skips the integers.
Here's my code:
Private Sub RFIDAuth()
Dim SkipBlock As String
SkipBlock = ",3,7,11,15,19,23,27,31,35,39,43,47,51,55,59,"
For i = 1 To 62
If SkipBlock.Contains("," & CStr(i) & ",") = False Then
Call ClearBuffers()
SendBuff(0) = &HFF 'CLA
SendBuff(2) = &H0 'P1: same for all source types
SendBuff(1) = &H86 'INS: for stored key input
SendBuff(3) = &H0 'P2: for stored key input
SendBuff(4) = &H5 'P3: for stored key input
SendBuff(5) = &H1 'Byte 1: version number
SendBuff(6) = &H0 'Byte 2
SendBuff(7) = CInt(i) 'Byte 3: sectore no. for stored key input
SendBuff(8) = &H60 'Byte 4 : Key A for stored key input
'SendBuff(8) = &H61 'Byte 4 : Key B for stored key input
SendBuff(9) = &H20 'Byte 5 : Session key for volatile memory
'SendBuff(9) = CDec(<INPUT>) 'Byte 5 : Session key for non-volatile memory
SendLen = &HA
RecvLen = &H2
retCode = SendAPDUandDisplay(0)
Base64StrfrmRFID = Base64StrfrmRFID & RFIDRead(i)
End If
Next
End Sub