26
ifm
Programming Manual BasicController relay CR0431 v03.03.00
05 / 2018
System description
Software description
3.4.2
Programming notes for CODESYS projects
FB, FUN, PRG in CODESYS .................................................................................................................26
Note the cycle time! ................................................................................................................................27
Important note to program the device ....................................................................................................27
Creating application program .................................................................................................................28
Using ifm maintenance tool ....................................................................................................................29
Distribution of the application program ...................................................................................................29
7426
Here you receive tips how to program the device.
► See the notes in the CODESYS programming manual.
>
FB, FUN, PRG in CODESYS
15410
In CODESYS we differentiate between the following types of function elements:
FB = function block
• An FB can have several inputs and several outputs.
• An FB may be called several times in a project.
• An instance must be declared for each call.
• Permitted: Call FB and FUN in FB.
FUN = function
• A function can have several inputs but only one output.
• The output is of the same data type as the function itself.
PRG = program
• A PRG can have several inputs and several outputs.
• A PRG may only be called once in a project.
• Permitted: Call PRG, FB and FUN in PRG.
NOTE
Function blocks must NOT be called in functions!
Otherwise: During execution the application program will crash.
All function elements must NOT be called recursively, nor indirectly!
An IEC application may contain maximum 8000 function elements; in this device maximum 512
function elements!
Background:
All variables of functions...
• are initialised when called and
• become invalid after return to the caller.
Function blocks have 2 calls:
• an initialisation call and
• the actual call to do something.
Consequently that means for the function block call in a function:
• every time there is an additional initialisation call and
• the data of the last call gets lost.
Summary of Contents for ioControl CR2050
Page 228: ...228 10 Notizen Notes Notes ...