My VB is severly rusted but I think you've got a format mismatch between what VB is sending and what the PIC is expecting - as I suggested in a previous post.
I think that SerialPort1.Write(pos) will send the content of variable pos as an ASCII string while the PIC is expecting two binary bytes, not an ASCII string.
If that's the case you need to change the VB program or the PIC program, on the PIC side you can use the DEC modifier to recieve an ASCII string consisting of decimal digits and parse that into a value.
Again, there's a big difference between sending a byte as binary, ie 123 and sending it as an ASCII string. If you loop the TX to RX on the PC and fire up a terminal program, what does the data look like?
/Henrik.
Bookmarks