0.1 ctb overview 1
0.1 ctb overview
The ctb (communication toolbox) library was realized, to simplify the communication with other
instruments throughout the ser ial com ports (at ﬁrst). To make my life easier, it should works
with Linux and all win32 plattforms (excepted windows 3.1, which is a only 16bit OS) because I
develope my applications for both plattforms).
Some times later GPIB support was added to make ctb an integrated part for the extensive test
and calibration system of a company I worked these days.
The main goal of the library was a non-blocked communication to avoid frozen GUIs waiting for
data which in some conditions never arrives.
On the base ctb deﬁnes an abstract class IOBase, which must be derivate for several interfaces
(at now this was done for the RS232 comports and GPIB IEEE488 interface).
This leads to another feature: Because all classes depends on one super class, you have just
open your wanted interface and don’t worry about it’s special typ later. This is like the ’Virtual
Instrument’ featured by Nation Instruments LabView.
Last not least: ctb provides one written code for Linux and Windows (compiles well with GNU
G++ and VC++). Without any dependences (execept for a standard C++ compilier) ctb runs also
in small enviroments like embedded systems and doesn’t need any graphic stuff for use.
ctb is composed of ﬁve parts:
• ctb::IOBase class
• ctb::SerialPort class
• ctb::GpibDevice class
• ctb::Timer class
• ctb::Fifo class
0.1.1 IOBase class
An abstract class for different interfaces. The idea behind this: Similar to the virtual ﬁle system
this class deﬁnes a lot of preset member functions, which the derivate classes must be overload.
In the main thing these are: open a interface (such as RS232), reading and writing non blocked
through the interface and at last, close it.
For special interface settings the method ioctl was deﬁned. (control interface). ioctl covers some
interface dependent settings like switch on/off the RS232 status lines and must also be deﬁned
from each derivated class.
0.1.2 SerialPort class
The class for the serial ports is named as
ctb::SerialPort. SerialPort is a wrapper for non blocked
reading and writing. This is easy under linux, but with windows a lot more tricky. SerialPort is as
simple as possible. It doesn’t create any gui events or signals, so it works also standalone. It’s
also not a device driver, means, you must call the read method, if you look for receiving data.
Generated on Mon Sep 20 13:47:00 2010 for libctb by Doxygen