Go Down

Topic: cannot read the data from arduino to the c# (Read 10524 times) previous topic - next topic


that's means it will not read the data into gui?

No it will read data if you send it data and if you write the code correctly.


PaulS, my problem now, the serialport is open..however the data cannnot be uploaded in the WPF?
if every function im doing the threading part..is it works to received the data in synchronous manner?
im handle the serial port class in one threads and the data in another threads..


Did you try running my application? Did you look at how it handles the serial data in one thread and communicates with the GUI thread?


yes.n i have take a look on the threading..when i click on the button..it says "The port is already open". However there is no data appeared on the WPF.it appeared in the console application and arduino serial monitor but not in the WPF C# application.


when i click on the button..it says "The port is already open". However there is no data appeared on the WPF.

Are you trying to run my application and the serial monitor at the same time?

If my application can't open the serial port, is it any wonder why no serial data appear on the form?


there's an error " Couldn't find input file"Properties\Resources.resx.what thats mean?


there's an error " Couldn't find input file"Properties\Resources.resx.what thats mean?
The file is in the zip file I attached.



the result of the code is appeared in the serial monitor of the arduino and on the console application...however the data is not appeared on the windows form? is there any wrong with my code?


When I click on the zip file, I get:
Error 503 Service Unavailable

Service Unavailable
Guru Meditation:

XID: 1078454701

Varnish cache server

So, if you could please varnish the cache server again, that would be good.


hi PaulS, attached is my code that will received the arduino data.


Can't read them, either. I posted in Website and Forum about the problem. When the new coat of varnish dries, I'll try again.


Let me make sure I understand correctly.

1. Your Arduino is running code outputting data to serial port.
2. You want the data Arduino is sending to serial port to be read into your C# program and displayed on a Windows Form.

I think you have your read and write backwards.  You aren't trying to WRITE the output from serial to your C# GUI, you want to READ the output from Arduino, into your C# program and then display it in the GUI.

set a string variable in C# = sp1.readline()

Then set the GUI element ".TEXT" field = to the string variable you created to display it.


Simple serial monitor test code that sends back what is sent to the arduino. If this works, then the issue is with your pc code. If your pc code opens/closes the pc com port on each write, that will cause the arduino to reset each write.

Code: [Select]

// zoomkat 7-30-11 serial I/O string test
// type a string in serial monitor. then send or enter
// for IDE 0019 and later

String readString;

void setup() {
  Serial.println("serial test 0021"); // so I can keep track of what is loaded

void loop() {

  while (Serial.available()) {
    delay(2);  //delay to allow byte to arrive in input buffer
    char c = Serial.read();
    readString += c;

  if (readString.length() >0) {


Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


you are right ,jjspierx

im just receiving the latitude sent by the transmitter and display on GUI.does the code for dispalying the latlong making any sense?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131