3 programming notes, 1 update function and scaling function, Programming notes – Lenze E94AxPExxxx User Manual

Page 47: Update function and scaling function, 4plc functionality

Advertising
background image

Lenze · 9400 Servo PLC· Reference manual · DMS 4.0 EN · 11/2013 · TD05/06

47

4

PLC functionality

4.3

Programming notes

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

4.3

Programming notes

4.3.1

Update function and scaling function

The update function is used to execute time-consuming calculations - similar to the scaling

functions.

• Scaling functions are always called when the corresponding user code is accessed.
• The update function "listens" to changes that have taken place elsewhere, e.g. changes in the

axis data structure, and executes various calculations again.

Some of the Lenze function blocks have an update function. The update function is not called

automatically by the »9400 ServoPLC«; calling of the function must be programmed.
Lenze function blocks with update function have the following syntax:

• Taskname-FBInstanzname.Update()
• Example: Cam.L_LdVirtualMasterP1.Update();

Tip!
In order to protect the resources, the update function of the function blocks should be

called in an unsolicited task.
Whether a function block has an update function, can be recognised by a corresponding

"Update" entry in the library manager.

Note!

Up to and including version 02.xx.xx

, remanent variables support RETAIN and PERSISENT

and RETAIN PERSISTENT are not supported.

From version 03.00.00

, PERSISTENT and PERSISTENT RETAIN are also supported.

• If a persistent variable is linked to a user-defined write/read code, the variable will be

overwritten as follows after the application has been downloaded:

• When the application is downloaded with the »L-force Engineer«, the parameter

set is also loaded into the »9400 ServoPLC«. Thus, the value of this persistent

variable is overwritten by the download depending on the downloaded parameter

value.

• When the application is downloaded with the »PLC Designer«, the user-defined

codes are set to their initial value. Thus, the value of this persistent variable is

overwritten by the download depending on the initial value of the parameter.

• If a persistent variable is linked to a user-defined read code, the value is kept even

after the application has been downloaded.

• The size of the persistent variable memory is limited to 2 kbytes. During the

compilation, an error message is output if this value is exceeded. Please bear in mind

that permanently available contents as e.g. variable names, module names, and data

types reduce the freely available memory space.

Advertising