future56k
08-17-2009, 07:06 PM
Hello,
I want to store a UDT in an eeprom and retrieve it later. Also I want to have a microcontroller doing some things with the data.
I've created a test case:
Private Type Teste
aa As Byte
P() As Integer
V() As Integer
End Type
t.aa = 10
ReDim t.P(t.aa)
ReDim t.V(t.aa)
Dim ccc As Byte
For ccc = 0 To t.aa - 1
t.P(ccc) = ccc
t.V(ccc) = ccc + 100
Next
ccc = FreeFile()
Open "test.dat" For Random As #ccc
Put #ccc, , t
Close #ccc
test.dat contents:
0A
01000B000000000000
0000000100020003000400050006000700080009000000
01000B000000000000
006400650066006700680069006A006B006C006D000000
I've separated the hex numbers in a way that looks right to me.. 1st, 3rd and 5th lines seem to be data. I don't imagine what could be lines 2 and 4.
Can anyone point me to the right direction?
Thank you.
I want to store a UDT in an eeprom and retrieve it later. Also I want to have a microcontroller doing some things with the data.
I've created a test case:
Private Type Teste
aa As Byte
P() As Integer
V() As Integer
End Type
t.aa = 10
ReDim t.P(t.aa)
ReDim t.V(t.aa)
Dim ccc As Byte
For ccc = 0 To t.aa - 1
t.P(ccc) = ccc
t.V(ccc) = ccc + 100
Next
ccc = FreeFile()
Open "test.dat" For Random As #ccc
Put #ccc, , t
Close #ccc
test.dat contents:
0A
01000B000000000000
0000000100020003000400050006000700080009000000
01000B000000000000
006400650066006700680069006A006B006C006D000000
I've separated the hex numbers in a way that looks right to me.. 1st, 3rd and 5th lines seem to be data. I don't imagine what could be lines 2 and 4.
Can anyone point me to the right direction?
Thank you.