| Program
structure |
|
| In order to meet the
various requirements of modern automation systems, MPC Solution offers
different kinds of programming, which are arbitrarily combinable with
one another, offering new possibilities. The Soft-PLC part of the
system consists of so-called machines and subroutines. Those subroutines
are re-usable and seperately storable program sections whose parameters
can be changed. A machine consists of pre-defined program modules
for manual and automatic operations, for initialization, two switching
off routines and a continuous program. Because of the predefinition,
only the assigned on-, off-, manual- and automatic push buttons must
be assigned when being assumed. A program modul consists of variables,
conditions, loops and sequences. |
 |
|
| Components
of the program structure |
Program structure
Logics
Conditions
Loops
Step
sequences
Subroutines
DLL-Interface
|
| Logics |
|
The logic functions correspond in the first instance to the classical
PLC. MPC Solution thus also presents the functionality of a PLC.
Extensions were accomplished in areas where new functionality facilitates
the programming.
Logics consist of a arbitrary number of operations.
Operations which are put down into logics, are processed with each
program cycle. A logic can also
be implemented conditionally. For the program structuring conditions
and loops were implemented.
|
 |
|
| Conditions |
 |
 |
These
special operations process an instruction if a condition is true.
The "if" and "switch-case" conditions can be found in programming
languages like C, JAVA, or VB, and also in MPC-Solution. They are
giving a good oppurtunity to structure your program. In the separated
folders (THEN, ELSE, CASE, DEFAULT) other logics, operations and step
sequences can be implemented.
For this, the normal "if (then else)" condition and a "switch
(case default)" element is available. |
| if |
If the condition
from this at "if" indicated variable is true, this
element will be executed. I.e. all operations which are agreed
underneath this folder, will be activated.
If the condition from this at "if" indicated variable
is not true, no execution will take place. I.e. all operations
which are agreed underneath this folder, will not be activated. |
|
switch
|
This
operation processes an instruction if a certain value complies
to the "Switch" variable. The "case" element
of a "Switch case" unit is implemented, if the indicated
value applies. I.e. all operations which are agreed underneath
this folder, will be activated. The "Default" element
of a "Switch case" unit is implemented, if no "case"
value applies. I.e. all operations which are agreed underneath
this folder, will be activated. |
|
| Loops |
|

|
 |
The loops
operate as long as their stopping condition is true. This kind of
commands is well known in other programming languages like C, JAVA
or VB.
|
| for |
The
"For" - loop increases and/or decreases the counter
step-by-step until reaching the final value. |
| while |
This
loop is accomplished until the condition of "While"
gets WRONG. |
| do
while |
The
"Do-While" - loop is at least once passed through,
until the condition of "Do-While" gets WRONG. |
|
| Step
sequences |
Step sequences frequently
appear in almost every application and have proven themselves in this system.
A step sequence consists of any number of steps. Every step has its
condition to move to the next step and any number of logics and/or
operations. Because only the active step is worked off, this construction
helps saving processing time.
|
 |
|
| Subroutines |
You can
also use all operations now in subroutines. The status of each call-instance
can now be displayed. You need no longer help variables in operations
because there are new parameter types. You can store subroutines as
reusable components on disk and reuse them afterwards in other applications.
|
|
|
DLL-Interface
|
A
DLL-Interface is used to call specific functions, which are deposited
in a DLL (library).
Parameters
from MPC-Solution can be given to the DLL - these are evaluated resp.
processed by the DLL - and a return value passes back. In this case
it is not important whether the DLL was written in C or VB.
In the software folder you can insert a new interface by opening the
context menu with the right mouse button. After clicking on the newly
created DLL-Interface you can now insert the function through opening
the context menu. Finally, when the name, the call convention and
the process is determined, the
return value and parameters to the DLL can be assigned in the parameter
box.
|
|