Interface, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 86

Advertising
background image

L-force | PLC Designer

Concepts and Base Components

84

DMS 4.1 EN 03/2011 TD29

You can write the property of the function block (Set method) for example by
"fbinst.seconds := 22;" (fbinst is the instance of FB1)
You can read the property of the function block (Get method) for example by "testvar
:= fbinst.seconds;"

Abb. 8

Example: Property "seconds" added to function block FB1


A property can have additional local variables but no additional inputs and - in
contrast to a function or method - no additional outputs.

Note: When copying or moving a Property from a POU to an Interface the contained
implementations will be deleted automatically. When copying or moving from an
Interface to a POU the user will be asked to specify the desired implementation
language.


Monitoring a property
A property may be monitored in online mode either with help of Inline Monitoring or
with help of a Watch List. The condition precedent to monitoring a property is the
addition of the pragma '{attribute 'monitoring':='variable'}' on top of its definition.

3.7.7

Interface

Note: This functionality is only available if supported by the currently used feature
set.

The use of interfaces is a means of object oriented programming.
Interfaces can be used to organize methods which are used by function blocks. An
"Interface" is a POU describing a collection of method-prototypes. "Prototype" means
that just declarations but no implementation is contained. A function block can
implement one or several interfaces which means that basically all methods of the
interface(s) are available in the function block.
The advantage: The method calls are defined and thus unique for all function blocks
implementing the same interface. Within a function block the methods have to be
filled with implementation code.

Advertising