Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advice on Linux and RS232 Communications

Status
Not open for further replies.

CaKiwi

Programmer
Apr 8, 2001
1,294
US
Hi all,

We have written a application in visual basic to communicate with a machine controller over an RS232 line and we would like some advice on the best way to convert this to Linux. When the PC is powered on, the application will come up running unattended and receive all its instructions over the serial line, mostly sending and receiving files to and from the controller. It will be on a LAN so that other windows PC's can copy files to its disk. I am an experienced C programmer on Unix systems but have no direct Linux experience. Here are the questions I have thought of so far.
(1) Should I rewrite it in C or could it run under an emulator (Wine?)
(2) If I rewrite it, what information is available on how to comminicate with the serial port from C?
(3) What is the best Linux distribution to use for this situation? I have Redhat, Mandrake and Debian available.
(4) How easy is it to configure a Linux system for a PC network?
(5)Is there a better way to implement rather than using C? What development tools are available?

I'm sure i'll think of some more questions as soon as I submit this but that should do for a start.

Any advice would be greatly appreciated. CaKiwi
 
Well, I sure wouldn't run it under an emulator.

Unlike Windows, Unix systems have been using serial ports since day one- hence there is lots of support for setting, controlling and using the ports. Unless you are doing something very low-level, you shouldn't have to get down to the actual hardware at all- I can't really think of anything you'd likely need to for. Even at the shell level you have incredible control over serial characteristics.

And since source code is readily available, you should have no trouble finding numerous examples of serial port coding.

If you don't want to write it, programs like Kermit are fully scriptable and run on just about anything you have ever even heard of:
Configuring Linux to live with PC's is very easy- remember that Unix was doing networking before PC's existed, and it was Windows that had to adjust to the TCP/IP that we were already doing. Everything you have in Windows networking is here, including SMB.

You should probably just set up a Linux box and see how far you get- come back here as questions arise.


Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Thank you for your suggestions, pcunix. The application is not low level, but the control it is communicating with is a bit quirky e.g. parity is turned on and off depending on what messages are being sent, so I don't think kermit would be appropriate. Do you know of any C source the web that I could use as a starting point?
I have loaded Mandrake Linux onto my PC and immmediately had a number of simple questions which I posted in another thread but overall it seemed to be remarkably painless. Do you have any opinion on what would be the best Linux distribution for this application?
Thanks again. CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top