I have found that if you put the Gosub DoUSBin routine at the beginning of the code (ie before the Main: routine) then the PIC waits for data transfer and when you send the variables from VB, then it continues with the PICs primary function and uses the variables you sent correctly. This is fine if it is a one of function when you power up the PIC. However, it is not, the PIC will always be powered-up.

So, if you want to change the variables, then you need to reset the PIC and resend them again using USB.

I want to get away from using a button for 'programming mode', so in otherwords it doesn't matter at what stage you send the variables from VB without there being a need for user intervention on the PIC side.

I need to get it out of the loop !!

Steve