Have you determined whether your problem is with the PIC or with VB's comms handling?

There is a limit to VB's string handling capability where when the limit is reached it with either hang or corrupt incomming data. If this is the problem, the solution is simply to terminate each transmission sequence from the PIC with a Return/Line-Feed combination.

Also, as a note, jumping into the middle of IF/ENDIF statements is bad programming, and whilst I cannot say if PBP will tollerate this, I do know many compilers that will behave unexpectedly... so this...

CommandIN:
If PIR1.5=1 then
HSERIN ,2000, TIMEOUT, [STR COMMAND\2] etc
GOSUB EXECUTE
TIMEOUT:
ENDIF
RETURN

... is better written like so...

CommandIN:
If PIR1.5=1 then
HSERIN ,2000, TIMEOUT, [STR COMMAND\2] etc
GOSUB EXECUTE
ENDIF
TIMEOUT:
RETURN

The result is the same.

Melanie