Hi,
I think yoyr problem is in your DEBUG statements in the PIC code. If you use the #modifier the PIC sends the the value of the variable as "text". So if the varaible lower is a word and set to 1234 the pic will send four bytes ie. "1","2","3","4" instead of the two bytes that the wordvariable consists of. That way the number of bytes the PIC sends depends on the actuall value of the variables so the OnComm() event will fire at different places in your "stream" since it's set to fire after every 6 bytes.
I think that you need to do:
And then on the VB-side you look for "aa" and then extract the high and low byte from the stream and put them together with Result = highbyte*256+lowbyte or something like that.Code:sendlower: debug "aa", lower PAUSE 100
Did it make any sence?
/Henrik Olsson.
Bookmarks