As you said,
if the Temp = 123 and the Light = 456 and volts = 156 and Current = 45
send "T0123L0456V0156C0045" with a following 0x10 & 0x13.
Its set up for FOUR digits so pad with zero's
I can't send these values from my microcontroller to the VB since it is Hi-Tech compiler and has its own syntax and codes. I am using putch command to send data and it is sent successfully, i checked it out with LABVIEW and it is working.
I really can't get your meaning that why i shall modify that part.
As you say stringtoparse contains the readings, so why later on no process is done on that to take the readings and put it into the proper textbox in VB.
Instead of that i can see you introduced Newstring as:
Temperature.Text = New String(stringtoparse, 1, 5)
Light.Text = New String(stringtoparse, 6, 5)
Volt.Text = New String(stringtoparse, 11, 5)
Current.Text = New String(stringtoparse, 16, 5)
By the way, now the error is eliminated but still nothing appears on the textbox. I don't know what happens to the data coming from PIC.
Navid.... Are you still having problems... When do you receive this error, After a received data interrupt or when you try to compile? I run it on ISIS, but as the connection is clean, ie internal coms, I receive no problems.. You may need a try / catch for the serial data.
Index non zero means that the calling function has returned -1 (fault)... which one generates the error!! Temperature? or Light? or one of the others.