I have RS485 (900 devices with displays and work 100% ok) now I need to implementa 9 more displays as terminals on network and pc send to my pic next:
Chr$(4) + Adr1 + Adr1 + Adr2 + Adr2 + Chr$(2) + Adr3 + "W" + "Q" + "PRESS INTERNATIONAL" + Chr$(3) + Chr$(crc) ' vb6 code
adr1 = number 0-9
adr2 = number 0-9
adr3 = number 0-9
and dat 1 to 4 are numbers 0-255
crc calculation on pc work fine with next:
crc = Dat1 Xor Dat2 Xor Dat3 Xor Dat4 Xor Hex(Adr3) ' vb6 code
I was probe in pbp : crc = Dat1 ^ Dat2 ^ Dat3 ^ Dat4 ^ Hex(Adr3)
but not success ....
Any idea for XOR for these crc calculation in pbp ?
And second question is any way to index variables ?
let we have :
a1 var byte[18]
a2 var byte[18]
a3 var byte[18]
... and up to a40
how can I say a(index) var byte[18]
and call in program loop "a" from 1 to 40 ....
sorry maybe i dont know to write good my question's.
example:
Code:
loop:
for i = 1 to 40
hserin [str a(i)/18]
next i
goto loop
end
Bookmarks