EasyManua.ls Logo

IFM Electronic CR0451 - Programming notes for CoDeSys projects

IFM Electronic CR0451
263 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
40
ifm System Manual ecomatmobile BasicDisplay (CR0451) V01
Limitations and programming notes Programming notes for CoDeSys projects
6.2 Programming notes for CoDeSys projects
FB, FUN, PRG in CoDeSys .........................................................................................................40
Operating sequence.....................................................................................................................41
Creating application program .......................................................................................................42
CoDeSys visualisation elements (CR0451) .................................................................................43
Texts (CR0451) ............................................................................................................................44
Movement of elements.................................................................................................................44
Using ifm maintenance tool..........................................................................................................45
7426
Here you receive tips how to program the device.
See the notes in the CoDeSys programming manual
ecomatmobile DVD "Software, tools and documentation".
6.2.1 FB, FUN, PRG in CoDeSys
8473
In CoDeSys we differentiate between the following types of units (POUs):
FB = function block
A FB may have several inputs and several outputs.
A FB may be called several times within a project.
For every call you must declare an instance.
Allowed: in a FB call of FB or FUN.
FUN = function
A function may have several inputs but only one output.
The output is of the same data type as the function itself.
PRG = program
A PRG may have several inputs and several outputs.
A PRG may be called only once within a project.
Allowed: in a PRG call of PRG, FB or FUN.
NOTE
Function blocks must NOT be called within a function.
Otherwise: During the executing the application program will crash.
POU-calls must not be recursive (POU must not call itself), also not indirectly.
Background:
By calling a function all variables...
- will become initialised and
- after return will lose their validity.
Function blocks have two calls:
- one initialising call and
- the call to do something.
Therefore, that means for a FB call inside a function, that there is every time an additional initialising
call.

Table of Contents

Related product manuals