Iniciado por
novato1223
otro qu esupuestamente lee la tarjeta
' Vb Script creato il 25/06 /2005 da studio-nds2
' Questo commento è necessario perchè winexplorer riconosce il vb sript
'
Call DxSetting()'con questo impostiamo i setting
Sub Main()
Dim i
sc.Verbose = False
Sc.write("D0 58 00 00 4C")
Sc.read(76 + 1) <------ He kitado el 3 y he puesto un 1 para ke lea 77 bytes en vez de 79.
Seriale = HexString(Sc.Getbyte(4),2) & " " & HexString(Sc.Getbyte(5),2)& " " & HexString(Sc.Getbyte(6),2) & " " & HexString(Sc.Getbyte(7),2)
Fus = HexString(Sc.Getbyte(3),2)
Share = HexString(Sc.Getbyte(35),2) & " " & HexString(Sc.Getbyte(36),2)& " " & HexString(Sc.Getbyte(37),2)
Select Case Fus
Case 25
Fuse = "25 Active"
Case 00
Fuse = "00 Virgin"
End Select
Print
Print "Seriale hex " & Seriale
Print
Print "Seriale Decimale " & "0001." & Left(HexToDec(Seriale),4) & "." & Right(HexToDec(Seriale),4)
Print
Print "Shared " & Share
Print
Print "Fuse Byte " & Fuse
Print
for i = HexToDec("00") to HexToDec("08") 'inserire tra virgolette il valore in hex
Comando = "D0 76 " & HexString(i,2) & " 00 0A"
sc.write(Comando)
Sc.read(11 + 2 )
Tiers = HexString(Sc.Getbyte(3),2) & HexString(Sc.Getbyte(4),2)
Mese = Sc.Getbyte(5)
Giorno = Sc.Getbyte(6)
Temp = DateAdd("m", Mese, #31/12/1996#)'utilizzando la funzione DateAdd è necessario mettere 31/12/1996
DataNds = DateAdd("d", Giorno , Temp) 'per avere la data corretta
Print
Print "Tiers " & Tiers & " Scadenza " & DataNds
next
End Sub
'===============================================
Function HexString(ThisNumber, Length)
Dim RetVal
Dim CurLen
RetVal = Hex(ThisNumber)
CurLen = Len(RetVal)
If CurLen < Length Then
RetVal = String(Length - CurLen, "0") & RetVal
End If
HexString = RetVal
End Function
'================================================
Function HexToDec(NumHex) ' converte un numero hex in decimale
NumHex=Replace(UCase(NumHex)," ","")
HexToDec=CLng("&H" & NumHex)
End Function
'================================================
Sub DxSetting()
Device=com1:
BaudRate=38400
ResetBaudRate=9600
ResetDelay=40000
ByteDelay=40000
RxByteTimeout=1000
Parity=1
StopBits=2
FlushBeforeWrite=1
FlushEchoByte=1
DTRControl=1
RTSControl=0
ResetMode=1
IgnoreTimeouts=0
ResetAfterTimeout=0
ResetLine=0
LogTransactions=0
DisplayUSW=1
DisplayFuse=1
ByteConvention=0
End Sub
Marcadores