Herunterladen Inhalt Inhalt Diese Seite drucken

Exercises; Logic Functions - IFM Electronic ecomot mobile R 360 Serie Starterset-Handbuch

Inhaltsverzeichnis

Werbung

Verfügbare Sprachen

Verfügbare Sprachen

4.

Exercises

4.1.

Logic functions

In the brief introduction of chapter 3 only a simple logic function (AND) was
used as an example. Those who have studied this chapter should not have any
problems to set up other logic functions or networks from linked logic functions
without any help. This will not be described in detail here. Some exercises
should help you become more familiar with the subject. For some short hints for
the solution see the appendix.
Some brief remarks should help to clearly structure the programs. Experience
has shown that even experienced programmers do not understand their own
program any more after some weeks. The meaning of a good structure
becomes particularly evident if some people work on partial programs or if
several people are to make modifications. In such cases it is necessary to make
exact agreements and to set up rules how the program is to be structured. Even
though this takes quite some time in the beginning and seems to be quite
complex, it will become clear during the first search for errors at the latest, that
this time was a good investment.
Documentation
Besides the item "structure" which will be dealt with in detail below, we also
want to remind you that detailed and clear comments are always helpful.
Program
There is not THE ideal program structure so that you can simply give an
structure
example solution which can serve for orientation. Therefore you will find below
tips which should be seen as suggestions.
Networks
It is confusing to create one network for each link. In principle you could assign
a flag to the result of a link and to further link this flag in the next network. Then
it is pretty tiring to pursue the effects of the change of a bit in the first network
via many other networks.
Vice versa it is also confusing when there are many links in one network. This is
in particular the case if lateral scrolling is necessary because the chain of links
is too long. Then the process described above is of advantage.
Conclusion
As is often the case it is a matter of finding a good compromise between these
extremes.
S/R
It helps to set up the program in a clear way if you regularly use the self-hold
function. This does not have to be done for each auxiliary flag. The author
prefers a program structure that has two networks for each output. At the end of
one of them you find "SET OUTPUT", at the end of the other one "RESET
OUTPUT". This structure has the following advantages:
R
4-1

Werbung

Kapitel

Inhaltsverzeichnis
loading

Inhaltsverzeichnis