Section 6 Program Code Issues
Parameter Dependency on Tasks and Controllers
3BSE042835-600
95
feature of sub function blocks executing in another task than its parent is that it will
not be executed at function block calls in structured text code.
Parameter Dependency on Tasks and Controllers
The tasks within a controller are recommended to have interval times that are
multiples of each other, for scheduling purposes. The tasks in different controllers
execute asynchronously.
For control modules and diagrams, the code is sorted to minimize delays in the
signal flow. The code sorting has no effect on control modules connected to
different tasks.
The task ownership of the parameter is divided between the tasks, according to the
particular task that writes to the parameter at a time. Therefore, it is possible to have
reliable execution of control modules over task and controller borders.
According to IEC 61131, function blocks are designed to execute in the same task as
the program they are part of. For example, some parameters like
Done
are only set
during one scan. This is the reason why an object in a slower task, reading this
parameter, may not receive it.
The passing of parameters to and from the function block is controlled by the
program task. The code in the function block that is connected to another task, runs
according to its task, but the parameters are updated according to the program task.
In such a situation, it is possible that the IN_OUT parameters of a function block are
changed during its execution, if a task switch occurs.
This problem does not occur for
In
and
Out
parameters, since they make use of local
copies within the function block, which remain unchanged during the execution of
the whole function block.
An application using function blocks shall not be separated into several tasks.
The initialization of objects using an IF-clause may not receive necessary input
parameters, if these come from objects residing in other tasks or controllers.
Calls to Asynchronous Functions
Use parameters like Enable to govern asynchronous Function Blocks. Do not use
SFC or IF-clauses since the asynchronous FB can have an internal state which will
influence next invocation.
Содержание AC 800M
Страница 1: ...Power and productivity for a better worldTM AC 800M Library Object Style Guide System Version 6 0...
Страница 2: ......
Страница 3: ...AC 800M Library Object Style Guide System Version 6 0...
Страница 12: ...Related Documentation About This User Manual 12 3BSE042835 600...
Страница 18: ...Naming Convention Section 1 Libraries 18 3BSE042835 600...
Страница 108: ...SIL Mark Restrictions Section 6 Program Code Issues 108 3BSE042835 600...
Страница 116: ...Standard Library Parameters Appendix A Names and Abbreviations 116 3BSE042835 600...
Страница 119: ......