RsKey is a programmable front-end processor. RsKey has a built-in mechanism by which users can configure it to pre-process RS232c data.
RsKey per se does not have any built-in data processing codes; instead, it is equipped with a mechanism whereby users can incorporate processing codes to complete a particular job. This is accomplished by writing sub-modules ( a kind of sub-routine to be called by RsKey to process character / line data ) and by dynamically linking them with RsKey after it is in memory.
A submodules takes a form of stand-alone MS-DOS executable file or pure machine code program with an pre-defined program structure like MS-DOS device drivers. The latter type is loaded into RsKey by the machine code loader supplied with RsKey.
All the data that go to a host program pass through RsKey and its sub-modules. Unlike the hardware keyboard emulator, raw RS232c data from an external device are never directly seen by the host program. It only sees RsKey's post-processed RS232c data.
Multiple submodules may be used simultaneously. When more than one submodule are used, each submodule is stacked on the previous one. A top module can be popped( removed ) from the module stack. The stacked submodules are chained together to form the "module chain" through which data is passed around.
Use of submodule may be thought of as similar to filter programs in the pipe chain on MS-DOS or UNIX. Each submodule is independent and re-usable. By combining submodules, more complex process is attainable.
Submodules are written in C or assembler. They executes as nearly fast as if they were built-in functions. There is no drastic execution speed deterioration due to use of submodules. In a spreadsheet application program, the input can be formatted by its built-in functions but it visibly slows down the program execution.
It is not necessary to modify a host application program. Often, it is not modifiable as with commercial packages. If modifiable at all, writing a submodule, rather than modifying the host, eliminates the need to go over the host program's source codes( which can be very complex and long ) to find out relevant parts and to modify( which often involves in more than one portion ) , not to mention the maintenance problems.
A submodule is a re-usable and context-free program that deals with a specific and well-defined task. In writing a module, no attention to the application context is necessary. It permits total concentration on data manipulations in developing a module. Debugging is easy, mainly because most of them are single functional.
The line processing function of RsKey is built in so that a submodule can easily handle the line data. It is the line data that a submodule is often expected to process. Since RsKey re-constructs the line data and submits it to a module, it only has to perform a string operation.
To illustrate, suppose that RsKey would receive the line data, from a measurement instrument, like "+ 123.3456" and that you had to,
a. remove the character '+' at the beginning
b. remove all the spaces in the string
c. limit the data to have 2 decimal places.
For this, 3 separate submodules to implement a., b. & c. should be written, rather than preparing one to discharge the 3 jobs. One submodule is to remove '+' character at the head of a string. This will receive a string and check if the first digit of the string is '+' and, if so, remove it. In writing this submodule, it is not necessary to think about how and where it is used. The other 2 modules can be written in the same way. Each of these submodules may be utilized for other purposes in totally different application contexts. Each alone is context-free and not very useful, but when they are combined in a certain way, they will perform a practical application-specific task.
A submodule can be written to filter data, to furnish special software protocols or to set specific characters to emulate certain function keys. RsKey comes with example submodules. Refer to the section on them for what submodules can do.
A submodule can be developed, using the standard MS-DOS software development tools. No special hardware or software is required. Often, having TurboC++ ( Borland ) is enough. To write a machine code module, only an assembler like MASM( Microsoft ) is required.
A submodule development kit is also included with RsKey. Refer to the last section for the details.
[NOTE]
A submodule may be regarded as a binary "object". A submodule "encapsulates" the specific data processing function and it provides an external interface. Because every submodule has the same interface, they can be chained in any order.
Loading a submodule means adding a function to RsKey. All the previous submodules' functions are alive as well as one by a new submodule. This compares well with "inheritance" feature of object programming.