Hi Rob,
Simple one this, I can undertand your approach however it is less complicated than you are making it..
Try this.
TestWrite var word
TestRead var word
TestWrite = 12345
write 0, TestWrite.byte0
write 1, TestWrite.byte1
Read 0, Testread.byte0
Read 1, Testread.byte1
.....
Testread should now be 12345.
You dont need to seperate the value into seperate digits.
Imagine if you will the word value as its 16-bit binary number..
Byte.0 is the lower 8 bits and Byte.1 is the upper 8 bits
When you read the two values back the software cleverly adds the two values and fills the variable with the correct figure.
Hope this helps.
Regards
Darryl
Bookmarks