Hardware Reference
In-Depth Information
4 Programming
Whilst many users of PC-based instrumentation and control systems will be
able to make use of off-the-shelf software packages, others may have specific
applications for which there is no existing software package available. This
is often the case with dedicated process control systems where a particular
operational configuration is unique to the system concerned or where an existing
software package is limited in some way.
The control engineer should be perfectly capable of developing simple,
robust, and efficient control programs without the assistance of a programmer
or software engineer. However, where the software is complex, sophisticated,
or requires a high degree of optimization, then the services of a software
engineer/programmer will almost certainly be required.
At the outset, it should be stated that there is a great deal more to programming
than simply entering code. Programming benefits from a disciplined approach
and this is absolutely essential when developing software which must operate
reliably and be easy to maintain.
Experience shows that electronic engineers (particularly those involved with
control systems) generally make excellent software engineers. They have usu-
ally developed a high degree of familiarity with hardware (microprocessors
and support devices) and will be only too well aware of the characteristics and
constraints of such devices.
Software engineering should not be confused with programming. A pro-
grammer is not necessarily a software engineer neither is a software engineer
necessarily a programmer. In fairness, a software engineer will normally be
proficient in several computer languages; however, such proficiency will be
relatively unimportant if the software he/she produces behaves erratically or
is impossible to maintain.
This chapter introduces some of the basic concepts associated with the pro-
duction of structured code which is both predictable and reliable and is easy to
maintain. This information should be invaluable to the control or test engineer
who may be increasingly involved with the development of programs to con-
trol PC-based systems. Please note, however, that the code fragments used as
illustrations in this chapter are not complete programs and most will require
additional code (such as appropriate C++ pre-processor directives) before they
can be made into complete course code files from which executable programs
can be built.
Choice of language
Sooner or later, the software developer must make some decisions concern-
ing the choice of language used for software development. To some extent
this decision will be crucial to the success of a project. The essential features
to consider when selecting a language for software development in PC-based
Search WWH ::




Custom Search