[MAT logo][Prev][Up][Next]

Introduction to custom modules

Most of the time, a combination of existing modules (generic and/or specific) will fulfil the requirements of a project. However, sometimes only a custom-made module will do. This chapter provides a short tutorial on writing custom modules.

Unless you need a custom module, you can safely skip this chapter.

Custom modules can be written in several languages. They fall into two broad groups, C and everything else.

C
C in a group of its own because it's the native language of the MatPLC. As such, it allows access to 100% of the functionality as soon as it appears in the MatPLC, and is a little more efficient (though with current computers that generally doesn't matter).

Everything else
Writing C is a specialist job, and sometimes it's better to write in a more user-friendly language such as python (sort of like BASIC or VB but about three decades more modern). If you are already using one of these languages elsewhere in the project, you can also connect directly from there to the MatPLC without going through an intermediary.

If you decide to use one of the other languages, you should still skim the chapter on C, as the other languages may be incomplete (please file a bug or ask on the mailing list if there's a function there that you want to use from one of the other languages), and in any case they generally follow the same layout and structure.

Another purpose of this chapter is to explain somewhat the workings of the supplied generic and specific modules. The modules supplied with the MatPLC work exactly the same way as custom modules. Currently they're all written in native C.

Contributing modules to the project

If you write an interesting custom module that you think other people would find useful, you can contribute it to the project. There's no difference between writing a custom module and writing a module to contribute.

Just about the only requirement is that the module has to be under the GPL licence. We may make some adjustments to the module to make it fit better with our intended architecture or project organization, of course, or merge it with an existing module; but if it's something that people would generally find useful, we'd love to have it in the CVS!

For other ways of contributing to the project, please see the Contributing to the MatPLC chapter.

[Prev][Up][Next]

$Date: 2004/12/28 05:32:09 $