Receiving string from Windows form application

I have hooked up a program in Arduino to when it get's a string from serial port it uses function to
Serial.parseInt() to seperate string into integers separated by comma. From Serial Monitor it works fine, but when I use SerialPort*.Write() in visual basic, the led blinks but it doesn't seem to have received it the right way, because program doesn't work. Should I specify encoding or something?

Is there a way to monitor what Arduino does like from serial monitor, I can't run program and have monitor open in the same time.
I'm a total noob so don't judge me.

What are you sending, and what are you expecting it to do??

Posting the Arduino code would help..

kycountry:
What are you sending, and what are you expecting it to do??

Posting the Arduino code would help..

Well I have Items in a table in visual basic.
it takes all the items of the row and should send them in a format like this..........200,234,784
If I send it trough serial monitor it does exactly what it is supposed to do. But in visual basic it should send like this "SerialPort*.Write(200,234,784")" and then wait for some response "Serial.println("done")" by using data received event handler and "SerialPort*.ReadExisting()" but nothing happens. I have been changing my code for like 100 times but nothing worked. I don't know if the arduino is getting that string and there's something wrong with the response or it doesn't get the string in the right format.

I think it is something with VB because in Serial monitor it works perfectly.

Does you VB code allow time for the Arduino to reset after it opens the serial port?
A good way to do this is to have the Arduino send a message from setup() e.g. Serial.println("Ready"); and then the PC program waits until it receives that before doing anything else.

And does your VB code keep the serial port open all the time it is connected to the Arduino? (it should).

...R

So I made a test program in VB. And it runs Perfectly.
Though had to turn Dtr on to get it running. Now I will just have to find what's wrong in my original programm.

Used in VB:
SerialPort1.Write(integer1 & "," & integer2 & "," & integer3)

And under

Private Sub DataReceivedHandler(sender As Object, e As IO.Ports.SerialDataReceivedEventArgs)
TextBox2.AppendText(SerialPort1.ReadLine() & vbNewLine)
End Sub *//to show what's going on in arduino

Used in arduino:
a lots of (debugging purpose) Serial.println("...")

Used in VB:

SerialPort1.Write(integer1 & "," & integer2 & "," & integer3)

You might want to consider sending a terminator for the string, by using WriteLine(), instead of Write().

You might need to convert the ints to strings BEFORE you attempt to write them. Otherwise, you might be sending binary data.