RS232 return values

Thanks for your response, cosma. I will try the asynchronous i/o method.

sww wrote: Our linux software ended up working much like what Cosma described. We read into a buffer whenever there are characters on the serial port. The commands are written asnychronously.

I started out trying to time/wait for things to happen, but the code did not work well.
You problem sounds like a software problem with your buffer, not an hardware issue.

Cool, I am glad to hear it is working for you.

I am wanting to run these queries/commands inside of a time-sensitive application, so being able to time the queries and returns would be nice. The time/wait is definitely giving problems, as well as a possible buffer issue. I realized it definitely wasn't a hardware issue (meaing motor controller) after it was working with minicom. I think I can make this work using async i/o however. I am also going to play with canonical vs. non-canonical as well.

Ok, I know this thread is pretty old, but maybe someone still knows...

My robotics club is building a linux robot, and were having some trouble with the communications. I think we are configuring something wrong, so I was playing with the options you use, but I cant seem to the "ioctl(fd, TCFLSH, 2);" working. What .h is that defined in, and are you defining TCFLSH someplace? Or do we even need that line?

Quick hint to anyone having problems with this stuff, the roboteq wants carriage returs ("
"), not the more standard (at least in UNIX) newline ("
"). That seems to have solved all of our problems, I cant believe I didnt think of that sooner.

post back if you need help with any other gotchas.
And for those curious about the system where the controllers were used, check out our website:
<a target="_blank" href="
www.niitek.com
">
www.niitek.com
</a>

the "latest news" section contains the story/summary of the system that uses two Roboteq controllers, one in RC mode and one in RS232 mode.

Thanks for the open_port() code, serial i/o can be a pain.. This works great. After I got my port configured the link from TSA was very helpful:
<a target="_blank" href="
www.tsatechnologies.com/roboteq_api.pdf
">RoboteQ API</a>
Although code examples are in VB, the string sequences are the same, info on the "Input Control Modes" diagram let me switch modes easily between RC/RS-232/etc..
cheers,
Pablo Rivera