- Community Pick
Introduction
Although it is an old technology, serial ports are still being used by many hardware manufacturers.
If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports. I needed to work on many clinical instruments as a job requirement to parse, extract patient test results and send them to a database backend for reporting. This means there are many serial ports attached to the computer. I developed different C# applications for each instrument. However, whenever I needed to make any changes, I had to open source code of the application, compile and deploy over and over again. It was very time consuming and a headache.
This is why I developed a serial port programming language: To reduce development time. I have made the tool available as project on SourceForge. In this article, I'll discuss some of its features and give you an idea of how to use it.
Application Features
It is a handy, simple application specially designed to simplify the development of RS232 based applications. It makes it easy not only to communicate with the serial port but also data parsing and extraction.
It requires .NET Framework 3.5 or above and supports all major Windows platforms including Windows XP, Windows Vista and Windows 7.
Key Features
- Able to log multiple serial ports at the same time. The data logger has the capability to log multiple ports simultaneously so that multiple external serial devices can be logged.
- Integrated Development Environment (IDE). You do NOT have to install any other development tools.
- Built-in debugger makes it easy to find and fix errors. It saves a lot of time.
- Regular expression support for easy data extraction.
Getting Started
Application has two main windows.
1- Main Application Window
2- IDE
Example - 1
Two serial port commands ( recv and send ) will allow you to interact with the serial port.
For example; if you want to send an ACK to the serial port;
NOTE: Control characters must be enclosed with prefix "<" and suffix ">"
Example - 2
Since bytes may come in at any time, buffering incoming data is critical. To solve this;
1. Buffer the incoming data.
2. Scan your buffer to find complete data.
3. remove the used data from the buffer.
The application program has a solution in order to buffer the incoming data.
The application provides many, many options and abilities to help you work with serial ports. It supports a rich programming language, including variables, expression evaluation, debugging, ... you name it. It supports over 50 useful commands -- too many to describe in this article.
For more information, please visit the project homepage or the SourceForge project page. The User Guide documentation is here.
by: DanRollins on 2010-10-31 at 16:23:27ID: 20981
One of the very first projects I worked on (back in about 1980), was an interpretive language for use in controlling a modem during the log-in process when connecting to remote host systems (such as CompuServe). It is VERY useful to be able to just tweak a script and retry -- much better than re-coding!