Pages: [1]   Go Down
Author Topic: .Net SerialPort class with XON/XOFF  (Read 1618 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Garfield
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12487
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: October 28, 2010, 12:17:36 pm by robtillaart » Logged

Rob Tillaart

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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
Logged

Pages: [1]   Go Up
Jump to: