Home Page Products Main Page Greenleaf Secure Store and Catalog Technical Support Request Download listings There is a lot of reference material online here. All about Greenleaf, privacy, policies, legal corner... We add to the top of this when things of note occur.
View Cart
Greenleaf Software Inc, home of Greenleaf serial communications including protocol analyzers and data compression tools

CommX Port Control Overview

30,000 ft. View

The Greenleaf CommX Port Control provides the interface for robust access to all functionality of one or more serial ports. Win32 serial communications drivers are used. The Port Control runs one or more threads separate from your application. Property pages provide for design and run time settings of such parameters as port, baud rate, parity, handshaking, etc.

A major advantage of using CommX is that it is event driven. Our definition of "Event Driven" means something beyond what you might be used to if you've used the MSComm control or competing class libraries or controls.

Your applications can respond to clearly defined events rather than have to poll some port parameter or interpret a status word, as is the case with other products. Incoming data, completion of an outgoing file, reception of a particular terminal escape sequence -- these and many more events are available when you use CommX.

This form of event drive means that you can write very specific handlers for each event -- instead of the kind of spaghetti code that results from having one event handler for everything. If you think about this one feature of CommX, you will conclude as many have that here is a major time saving device.

Zoom in a little...

The Port control is at the heart of any serial communications application. The CommX Terminal and File Transfer controls interface seamlessly with the Port Control.

You can have as many instances of the Port Control as you wish -- one for each port you want to work with. (You can also have multiple Terminal and/or File Transfer controls.

Port configuration can be done in several manners:

  1. Just call Port.Configure and our built in property pages pop up providing full control.
  2. You can set the port properties at design time in the IDE and they will persist.
  3. You can programmatically set or alter any port parameter whether the port is open or not.

Given options 2 and 3 above, you can build a GUI-less application or service.

About threads and multithreading

When a serial port is opened in Win32, Windows launches three worker threads: One each for read, write, and status. Incoming data is automatically placed in a buffer; there are several methods by which you can move data to your application.

As an example of our type of event drive, an IncomingData event will be fired when data starts coming into the port. You will have lots of ways to move data and you will be notified when it is available. No more Do Events or timers.

Your application can be multithreaded if you wish. CommX is thread-safe. Some users have built Windows Services using CommX. Others have encapsulated CommX controls into their custom ActiveX controls or DLLs.

It's Easy to Use

Greenleaf ships about a dozen examples of use of CommX in each of a number of languages -- Visual Basic 5 and 6, Visual C++, C++Builder, Delphi, FoxPro, PowerBuilder, and others. It absolutely amazes us how many people have built their application by starting with oue of our examples.

We also ship several Tutorials to help you get CommX installed into various development environments. Pictures. Words and step-by-step pictorials.

Overview of functionality

The CommX Port control provides a single point of interface for everything having to do with simple serial port communications. This includes:

  • Opening and closing ports
  • Setting up basic parameters: baud rate, stop bits, parity, etc.
  • Setting up hardware and software handshaking
  • Reading and writing individual characters or buffers
  • Channeling comm events, such as buffers going empty. Your application can do other tasks while awaiting notification of an event

Go to the Category Map (button at top center in the green menu bar) and click on Port Control Interface to see the details.
The actual interface to the serial port is managed in several threads running independently of your main program. The design of Microsoft's Win32 comm driver requires independent I/O threads so that your main thread is not blocked due to various conditions. This multithreading also allows for efficient event driven programming. For example, instead of polling a port for input data, you can direct the CommX Port control to generate events whenever new data appears. Likewise, you can generate events when a modem hangs up or detects an incoming call -- the list goes on.

Back     Return to home page     To top of this page        Greenleaf CommX

products | serial comm libraries | protocol analyzers | serial hardware
data compression/archiving/encryption | About Us | news | Updates
downloads | site map

Google
Web GreenleafSoft