-2
  • I have tag of rfid is 0011029196 when i convert it to Hexadecimal it just 0A84ACC and lost 1E0 how i can convert it to
  • 1E00A84ACC.

p/s: tag 1E00A84ACC is read from serial com port

  • i'm using window form with c#

  • how i can code it. thanks

  • It would be useful to see your current code. – Klaus Gütter Aug 22 '23 at 09:18
  • From my experience with ID tags, the visible ID number (e.g. the "*rfid is 0011029196*") is only part of the complete value stored (and retrieved) (e.g. the 0x1E00A84ACC that is read). The ID tag typically consists of two values: (a) a facility (or site) code, and (b) the tag (or card) number. In your case, the tag returns 40 bits (or 10 hex digits) of data. Perhaps 16 bits are for the facility code, and 24 bits are for the card/tag number. The decimal value of those 24 bits is the exposed "tag/card number". Or maybe the split is 8 bits and 32 bits, given the 10-digit length of the rfid. – sawdust Aug 23 '23 at 03:59

1 Answers1

1

It looks like somewhere the highest 32 bits are getting lost, perhaps by an explicit cast to an int? If so, try using a long types instead of int types.

Example of the issue:

long longRFID = 0x1E00A84ACC;
int intRFID = (int)longRFID;
Console.WriteLine($"Dec (long): {longRFID}");
Console.WriteLine($"Hex (long): {longRFID:x}");
Console.WriteLine($"Dec (int):  {intRFID}");
Console.WriteLine($"Hex (int):  {intRFID:x}");

Output:

Dec (long): 128860048076
Hex (long): 1e00a84acc
Dec (int):  11029196
Hex (int):  a84acc
hawky
  • 116
  • 6