C program to write to the com port

David Kelly dkelly at HiWAAY.net
Sun Jul 31 21:14:14 GMT 2005


On Jul 31, 2005, at 9:50 AM, Paul Hamilton wrote:

> I am trying to write a C program that will send 3 bytes to the  
> cuaa0 com
> port at 9600 baud, 8n1.

Oddly I found information on how to do that very easy to find for  
Unix. Conversely wanted to do the same thing in Windows and hit a  
brick wall. Everyone does it differently with different compilers. So  
I told the boss a Windows Weenie would have to take over.

Had a perfectly good minimal text-only program which formed serial  
Modbus ASCII packets, and displayed the response, under FreeBSD.  
Would be interested in a library for mingw or similar with termios  
cloned. Else some simple documented way to do unbuffered serial I/O.  
ASCII Modbus doesn't really require unbuffered I/O but thats the path  
I started on and would be required for Modbus RTU mode.

--
David Kelly N4HHE, dkelly at HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.



More information about the freebsd-questions mailing list