Serial and RS485 Programming Tutorials

Serial Port Programming
This is a collection of articles on programming the serial port of a x86 PC using C,CSharp (C#) and Python.The tutorials covers programming the serial port using native API's like Win32 API on Windows or termios/ioctl() API on Linux. The tutorial also explains how to program the serial port using C# on .NET framework (Windows) . For Cross platform applications you can use the open source Python module PySerial for writing code on Windows and Linux.Since PySerial is available for Mac OSX ,the code provided here can run on Macs too(I have not tested it ).A short description about building an RS485 network is also provided.
The code presented in the tutorials are written using opensource or freely downloadable softwares like GCC,Microsoft Visual Studio Express Edition,Active Python,SharpDevelop etc.The codes are tested on a Windows 7 and a Ubuntu/Linux Mint PC.In the case of Python,seperate code is provided for Python2.7 and Python 3.x to accomadate the differences.
Most PC companies have stopped including hardware based DB9 serial ports in their computers and most laptops never had any to begin with.In this tutorial most of the examples are tested using USB to Serial Converters like USB2SERIAL.You can use any USB to Serial Converters, only requirement is that you should be able to access the RXD ,TXD ,RTS and DTR pins of the module(which are brought out in USB2SERIAL to bergs).
|
Serial Port Programming on Linux |
RS485 Programming Tutorials
Some times we have to communicate with systems that are several 100's of meters away like a remote data acqisition system or a robot, in such cases serial (RS232) will not cut it. You have to use some thing known as a RS485 protocol that can communicate over several Kilo Meters.
One problem with standard PC's is that they dont come with a RS485 port,you can use USB2SERIAL which already have a MAX485 based RS485 tranciever that you can use to implement such a network.check out the below link if you are interested in building an RS485 communication network.You can buy the hardware here .Sample codes are available in C ,Csharp (C#) and Python for Windows and Linux platforms.
Cross Platform RS485 communication using USB2SERIAL
Communicating with a Robot over an RS485 link
Controlling DC Motors using RS485 link on Windows and Linux
Remote DAQ system using MSP430






Comments
Anonymous (not verified)
1 July 2015 - 12:52pm
Permalink
quite comprehensive serial
quite comprehensive serial programming article
Anonymous (not verified)
2 July 2015 - 10:18am
Permalink
java section is missing !
java section is missing !
MackenzieHodgkinson
11 September 2017 - 5:17pm
Permalink
We can install software that
We can install software that is providing best programming these days. From affordable dissertation writing services we can use different tools in software which are useful for us. We can get training to use latest software and can use them for our business.