L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 559

Advertising
background image

L-force | PLC Designer

Siemens Import



DMS 3.2 EN 02/2011 TD29

557

A STEP5 POU that accesses data words (data bytes, etc.) should always open the
data block first. If necessary, the POU should be improved before being imported
by inserting the appropriate A DB command preferably at the beginning of the
POU. Otherwise the converted POU will have to be edited after the fact.
If there is more than one A BD operation that must be partially skipped, the
conversion may have a errors, i.e., code may be generated that accesses the wrong
DB.

• Higher Concepts Related to Data Block Access

In STEP5 you have the option of creating something similar to instances by having
the Code block open an indexed version of a data block. This could be done with
the following sample code sequence:
L KF +5
T MW 44
B MW 44
A DB 0
The DB5 is opened at the end of this sequence (in general, the DB whose number is
found in the memory location word %MW44 will be opened). This type of access is

not recognized in the conversion which means that the following changes have to
be made after the conversion:
First, all DBs must be imported that act as instance DBs , e.g., DB5 and DB6. They
will be imported as normal IL, LD or FBD POUs whichever you prefer. The POUs do

not have a code, but rather a header with definitions of local variables. Type
instances can now be created from these POUs. Create a user-defined type (e.g.,
named DBType) and insert the local variables and converted DBs as components.

Then create global instances of this type by writing to a global variable list:
VAR_GLOBAL
DB5, DB6 : DBType;
END_VAR
You can now delete the converted DBs from your project.
Then you have to create a copy of the indexed version of the DBs by giving the

corresponding POU another VAR_INPUT parameter of the type DBType. Data
access within the POU must now be redirected to this instance. You must then
include one of the instance DBs as an actual parameter when you open it.

• The so-called integrated S5 function blocks that have a STEP5 access interface

have a special function but their implementation is either not written in STEP5 (or
MC5) or is protected by a special mechanism. POUs of this kind are generally
firmware and can only be "imported as an interface". The implementation portion

of this type of POU is empty. These POUs must generally be reprogrammed after
being converted.

Advertising