hallo,
kann mir bitte jemand erklären wieso das so ist.....
wenn ich einen rfid tag auslese, und ihn mir am display anzeige, stimmt die hex zahl verwende ich hexval stimmt der umgerechntet dezimalwert nicht.
woran kann das liegen?
hex:
9D100372
hexval:
168294 die richtige zahl sollte aber 2635072370 lauten
vielen dank im voraus für eure hilfe!
flo
On Urxc Rec_isr 'define serial receive ISR
Enable Urxc 'enable receive isr
Const Header = &H0AB
'Const Cmd1 = &H01 'Read the Card Type
Const Cmd2 = &H02 'Search Cards, and reads the cards serialnumber
'Const Cmd3 = &H03 'Read data in The Card
Declare Sub Read_card()
'_______________________________________________________________________________
'*******************************************************************************
'Variable
Dim Data_ptr As Byte
Dim In_data(20)as Byte '20
Dim Len_data As Byte At In_data(1) Overlay '1
Dim Curcommand As Byte
Dim Neue_daten As Bit
Dim In_byte As Byte
Dim Card_nr As Long At In_data(3) Overlay '3
'Hauptprogramm
Enable Interrupts
Do
Cls
Call Read_card()
Waitms 200
If Neue_daten = 1 Then
If Curcommand = In_data(2) Then 'gültiges Telegramm erhalten
Select Case Curcommand
Case Cmd2:
If Len_data > 1 Then
Locate 1 , 2 : Lcd "Card Nr :" ; Hex(card_nr) ; " " '"HEXval "
Locate 2 , 2 : Lcd "Card Nr :" ; Hexval(card_nr) ; " "
Select Case Card_nr
'_______________________________________________________________________________
'*******************************************************************************
'Berechtigte Transponder:
Case &H1BD624D5: ' Karte1
Gosub Tuere_oeffnen
' nicht berechtigter Transponder
Case Else:
Gosub Falsch
End Select
End If
End Select
End If
Neue_daten = 0
Cls
End If
Loop
End
Sub Read_card()
Printbin Header ; &H02 ; Cmd2
Curcommand = Cmd2
End Sub
'Interrupt-Service-Routinen:
Rec_isr:
In_byte = Udr
If In_byte = Header Then
Data_ptr = 0
Else
Incr Data_ptr
In_data(data_ptr) = In_byte
If Data_ptr = In_data(1) Then Neue_daten = 1
End If
Return
'*******************************************************************************
'Unterprogramme:
kann mir bitte jemand erklären wieso das so ist.....
wenn ich einen rfid tag auslese, und ihn mir am display anzeige, stimmt die hex zahl verwende ich hexval stimmt der umgerechntet dezimalwert nicht.
woran kann das liegen?
hex:
9D100372
hexval:
168294 die richtige zahl sollte aber 2635072370 lauten
vielen dank im voraus für eure hilfe!
flo
On Urxc Rec_isr 'define serial receive ISR
Enable Urxc 'enable receive isr
Const Header = &H0AB
'Const Cmd1 = &H01 'Read the Card Type
Const Cmd2 = &H02 'Search Cards, and reads the cards serialnumber
'Const Cmd3 = &H03 'Read data in The Card
Declare Sub Read_card()
'_______________________________________________________________________________
'*******************************************************************************
'Variable
Dim Data_ptr As Byte
Dim In_data(20)as Byte '20
Dim Len_data As Byte At In_data(1) Overlay '1
Dim Curcommand As Byte
Dim Neue_daten As Bit
Dim In_byte As Byte
Dim Card_nr As Long At In_data(3) Overlay '3
'Hauptprogramm
Enable Interrupts
Do
Cls
Call Read_card()
Waitms 200
If Neue_daten = 1 Then
If Curcommand = In_data(2) Then 'gültiges Telegramm erhalten
Select Case Curcommand
Case Cmd2:
If Len_data > 1 Then
Locate 1 , 2 : Lcd "Card Nr :" ; Hex(card_nr) ; " " '"HEXval "
Locate 2 , 2 : Lcd "Card Nr :" ; Hexval(card_nr) ; " "
Select Case Card_nr
'_______________________________________________________________________________
'*******************************************************************************
'Berechtigte Transponder:
Case &H1BD624D5: ' Karte1
Gosub Tuere_oeffnen
' nicht berechtigter Transponder
Case Else:
Gosub Falsch
End Select
End If
End Select
End If
Neue_daten = 0
Cls
End If
Loop
End
Sub Read_card()
Printbin Header ; &H02 ; Cmd2
Curcommand = Cmd2
End Sub
'Interrupt-Service-Routinen:
Rec_isr:
In_byte = Udr
If In_byte = Header Then
Data_ptr = 0
Else
Incr Data_ptr
In_data(data_ptr) = In_byte
If Data_ptr = In_data(1) Then Neue_daten = 1
End If
Return
'*******************************************************************************
'Unterprogramme: