6. Function blocks
6.3 UF - User function block
6.3 UF - User function block
Only possible with easySoft 8.
6.3.1 General
easyE4 base devices provide 128 user function blocks, UF01
through UF128.
You can configure these function blocks yourself and then use
them in the main program the same way as manufacturer function
blocks.
User function blocks are used whenever a recurring functionality needs to be pro-
grammed with various parameters. For example, when similar machines need to be
controlled, the actual control program for them can be written in a user function
block and then called multiple times – separately for each machine. User function
blocks also feature inputs and outputs that can be used to pass custom parameters
for each call.
The programming language used in each user function block is independent from the
programming language used for the corresponding main program. In other words,
you can use user function blocks written in ST in an FBD or LD main program, for
instance.
User function blocks have their own data range. In fact, there are 64 bytes, which
can be used as bits, bytes, words, or double words, available for each instance (call)
of a user function block. This means, for example, that marker M01 in the main pro-
gram is not the same marker M01 in a user function block.
Parts of the markers can be declared as being retentive. In this case, it is important
to keep in mind that the total number of retentive markers must not be exceeded, and
that this total includes the retentive markers from the main program and the retentive
markers from all user function block instances.The total number of retentive markers
depends on the firmware version – please refer to → "Retention section", page 594.
Just like a main program, a user function block is made up of FBD/LD networks or ST
source code. This means that a user function block can be created the same way as
a main program, with the only differences consisting of the available operands.
The maximum number of user function blocks that can be called in a single main pro-
gram is 128.
588
easyE402/24 MN050009ENEaton.com