Iec 61131-3 Second edition 2003-01 Programmable controllers – Part 3: Programming languages
Table 32 - Examples of function block I/O variable usage
Download 1.35 Mb. Pdf ko'rish
|
ourdev 569653
- Bu sahifa navigatsiya:
- 2.5.2.1a) Use of EN and ENO in function blocks
Table 32 - Examples of function block I/O variable usage
Usage Inside function block Outside function block Input read IF IN1 THEN ... Not allowed (Notes 1 and 2) Input assignment Not allowed (Note 1) FB_INST(IN1:=A,IN2:=B); Output read OUT := OUT AND NOT IN2; C := FB_INST.OUT; Output assignment OUT := 1; Not Allowed (Note 1) In-out read IF INOUT THEN ... IF FB1.INOUT THEN... In-out assignment INOUT := OUT OR IN1; (Note 3) FB_INST(INOUT:=D); NOTE 1 Those usages listed as “not allowed” in this table could lead to implementation- dependent, unpredictable side effects. NOTE 2 Reading and writing of input, output and internal variables of a function block may be performed by the “communication function”, “operator interface function”, or the “programming, testing, and monitoring functions” defined in IEC 61131-1. NOTE 3 As illustrated in 2.5.2.2, modification within the function block of a variable declared in a VAR_IN_OUT block is permitted. 2.5.2.1a) Use of EN and ENO in function blocks As shown in table 20 for functions, for function blocks an additional Boolean EN (Enable) input or ENO (Enable Out) output, or both, can also be provided by the manufacturer or user according to the declarations VAR_INPUT EN: BOOL := 1; END_VAR VAR_OUTPUT ENO: BOOL; END_VAR When these variables are used, the execution of the operations defined by the function block shall be controlled according to the following rules: 1) If the value of EN is FALSE (0) when the function block instance is invoked, the assignments of actual values to the function block inputs may or may not be made in an implementation- dependent fashion, the operations defined by the function block body shall not be executed and the value of ENO shall be reset to FALSE (0) by the programmable controller system. 2) Otherwise, the value of ENO shall be set to TRUE (1) by the programmable controller system, the assignments of actual values to the function block inputs shall be made and the operations defined by the function block body shall be executed. These operations can include the assignment of a Boolean value to ENO. 3) If the ENO output is evaluated to FALSE (0), the values of the function block outputs (VAR_OUTPUT) keep their states from the previous invocation. NOTE It is a consequence of these rules that the ENO output of a function block must be explicitly examined by the invoking entity if necessary to account for possible error conditions. EXAMPLES The figures below illustrate the use of EN and ENO in association with the standard TP, TON and TOF blocks (represented by T**) defined in subclause 2.5.2.3.4, and the CTU and CTD blocks (represented by CT*) defined in subclause 2.5.2.3.3. In accordance with the above rules, a FALSE value of the EN input may be used to “freeze” the operation of the associated function block; that is, the output values do not change irrespective of changes in any of the other input values. When the EN input value becomes TRUE, normal Copyright International Electrotechnical Commission Provided by IHS under license with IEC Not for Resale No reproduction or networking permitted without license from IHS --``````-`-`,,`,,`,`,,`--- 61131-3 IEC:2003(E) – 69 – operation of the function block may resume. The value of the ENO output is FALSE after each evaluation of the function block for which the EN input is FALSE. When EN is TRUE, a TRUE value of ENO reflects a normal evaluation of the block, and a FALSE value of ENO may be used to indicate an implementation-dependent error condition. +-------+ +-------+ | T** | | CT* | BOOL---|EN ENO|---BOOL BOOL---|EN ENO|---BOOL BOOL---|IN Q|---BOOL BOOL--->CU Q|---BOOL TIME---|PT ET|---TIME BOOL---|R CV|---INT +-------+ INT---|PV | +-------+ Download 1.35 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling