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

Page 1007

Advertising
background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

1005

The exemplary implementation of this workflow is restricted to the initial step
followed by one single step with associated step action ActiveAction concerned with
the assignment of the output variables:

an_int:=an_int+1; // integer counting the calls to the action
test_act:='father_action'; // assignment of the string variable test_act
METH(); // call to method assigning the string variable test_meth

In case of the derived class POU_child the step action will be overwritten by a specific
implementation of ActiveAction differing from the original one by assigning the string
'child_action' instead of 'father_action' to variable test_act.
Likewise the method METH, assigning the string "father_method" to variable
test_meth within the base class, will be overwritten such, that test_meth will be
assigned to "child_method" instead.
The main program PLC_PRG will execute repeated calls to "Child" (an instance of
POU_child).
As expected, the actual value of the output strings report the call to action and method
of the derived class:


However, if the base class is preceded by the attribute 'no_virtual_actions'

{attribute 'no_virtual_actions'}
FUNCTION_BLOCK POU_SFC...

a different behaviour can be observed: whereas method METH will still be overwritten
by its implementation within the derived class, a call of the step action will now result
in a call of action ActiveAction of the base class. Therefore, test_act will be assigned to
string 'father_action':

Advertising