I have no idea how the RFID 12-byte type is stored in memory, but you can at least print out this memory this RFID tag contains.
Note that a RFID tag size corresponds with a type of 3 SINGLEs/LONGs, that's why I'm using that type here. In your own program, you need to store the RFID tag somewhere in memory, or convert it to an array of 3 SINGLEs/LONGs for this to work.
[syntax="QBasic"]'$DYNAMIC
DEFINT A-Z
' just my definition of rfid, no relevancy
TYPE RFIDpseudo
Bit95to64 AS LONG
Bit63To32 AS LONG
Bit31To0 AS LONG
END TYPE
' make a rfid
DIM RFID AS RFIDpseudo
' fill with some test values
RFID.Bit95To64 = 840288&
RFID.Bit63To32 = 485&
RFID.Bit31TO0 = 90381183&
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'@ Relevant part starts here
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' You have a RFID structure somewhere in memory
' retrieve the memory location if you didn't do this yet
' also possible to have this structure or memory passed to this program
' if you adapt the code a bit to support this
MSegment = VARSEG(RFID)
MOffset = VARPTR(RFID)
DEF SEG = MSegment
' Read out the 12 bytes and get these in hex
MyHex$ = ""
FOR I = 0 TO 11
Temporary$ = "00" + HEX$(PEEK(MOffset + I))
MyHex$ = MyHex$ + RIGHT$(Temporary$, 2)
NEXT I
' print out this hex string
PRINT MyHex$
' now it's easy to convert this hex string to binary
MyBin$ = ""
FOR I = 0 TO 11
Subchar = VAL("&H" + MID$(MyHex$, I * 2 + 1, 2))
FOR J = 7 TO 0 STEP -1
IF (Subchar AND (2 ^ J)) > 0 THEN MyBin$ = MyBin$ + "1" ELSE MyBin$ = MyBin$ + "0"
NEXT J
NEXT I
' print out this binary string
PRINT MyBin$[/syntax]
In fact, if you have the memory location, or a wrapped-around structure of the same size of the RFID tag (don't forget to convert this RFID to the structure appropriately. As I don't know about RFID I can't do this), a lot can be done.
Hope I was of any help...
Neo
Note: Rebuild this code for the correct endian system... =)
( program outputs something like:
Quote:60D20C00E50100007F1B6305
011000001101001000001100000000001110010100000001000000000000000001111111000110110110001100000101
)