Go Down

Topic: .Net SerialPort class with XON/XOFF (Read 3134 times) previous topic - next topic


Hi everybody,

I'm using the .Net Serial Port class (C#) to send commandos to the the Arduino, which processes them. This works fine.

Unfortunately, the Arduino HardwareSerial has no support for flow control included. With SerialPort objects I could use XON - XOFF; if this would be supported by the Arduino.

Has anybody ever gotten this to work with the .Net SerialPort class? How do I have to configure the serialPort instance? What do I have to send how from the Arduino?

Simply writing or printing the XON and XOFF dec or hex values doesn't seem to get the job done (ex.: Serial.Write/print(19) ). Maybe my expectations here, are wrong too. I would expect, that the .NET SerialPort hierarchy would process the value so that I do not see it?!

I would be very happy about every tip or hint.

thx + greetings


Oct 28, 2010, 07:09 pm Last Edit: Oct 28, 2010, 07:17 pm by robtillaart Reason: 1
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/89b88e89-5814-4819-8b50-7caa3faf5f54 states it is a seriously non-trivial problem. Normally the XON/XOFF handshakes are done in the low level drivers and the programmer doesn't need to send them manually as far as I know.

you could implement your own high and low water mark. e.g. sending @+ means XON and @- means XOFF and @@ means @.

Q: what is the purpose of your app? Why you need the XON/XOFF.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Thx a lot for your answer! I'm gonna read that :).

I have a robot, being built on Arduino basis. I' m a student and I need it for university of applied science (dt. Fachhochschule). The task is to integrate this robot into Microsoft Robotics Developer Studio.

The irony is, that I have tested, better really tried, to overflow the Arduino with my "invented" commands. I couldn't achieve that, even without flow control. Of course I know that I really can't rely on that on every machine (used a laptop, which can't be called high end).
But, and that's why I noted that I'm a student, I should try to go the secure way - programming defensively.

Sure - I could implement some sort of "manual" flow control; but I think, that this solution isn't very graceful and therefore isn't really my first resort.

Greetz Garfield

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