你可以在控制器内定义计算,使得控制器执行时进行相应计算。这些计算可被用来根据当前操作条件和/或控制器/DCS信号修改控制器参数。例如,你可以定义一个计算,当特定的POV断开连接或返回一个错误值时,自动排除问题控制器中的CV。这个计算功能与其它PCTP应用(如AIDAPro, MDPro和RQEPro)使用相同的计算引擎,从而提供了整个PCTP产品套装的一致性。此外,该计算引擎还可用于EXAITG。
计算的设计理念需基于以下原则:
•首先,所需的计算需要离线编写。鉴于所定义的计算在控制器中有重要的作用,最重要的是任何被嵌入其中的计算都应该用适当的值进行检查,以确保返回SMOCPro内核的值是有效的。例如,若计算需要修改控制器请求状态,建议您仔细计算以确保返回的值是0、1、2或4中的一个。更多的细节将在后续的章节中提到。
•一旦所需的计算已经制定,下一步的工作是通过仿真确认预期行为并使用计算调试文件查看器。在PCTP 2009 Build 1中有一个新的特点,是计算可以(有限制的)在离线仿真包里进行仿真。请参见下述仿真部分以获取更多细节。
•接下来,包含所有计算信息的EXA文件建立。
•最后,EXA文件在线导入。如果控制器状态是ACTIVE (在EXASMOC中),在线控制器在每个控制器执行时执行计算。
如上所述,这个特性的意图是便于运行时修改控制器参数。SMOCPro的传统模式如下图所示。
注意在该模型中与内核交互的输入/输出并不能基于当前操作和/或运行条件修改。因此,内核使用直接嵌入的传递值。为了克服这个困难,用户通常采用的是提供应用程序代码(用户代码)的方法将输入修改到内核。该用户提供的应用也可以采用内核中的输出计算所需的数量/测量量。
为尽量减少用户维护多个应用程序(控制器应用程序、用户代码应用程序等等)的负担,在PCTP 2008 Build 1中引入一个计算引擎。
通过将计算整合到控制器设计层内,你作为用户基本上只需要维护SMOCPro控制器应用。计算的GUI被设计为通过有效的方式帮助用户建立相对大量的计算。随着计算作为控制器设计的一部分,我们现在有一个如下图的修改模型:
现在人们看到,控制器的范围已经扩大到包含了计算。计算可以通过SMOCPro内核执行之前或之后进行评价。
我们现在引进和介绍一些术语。
• 预置内核计算—这些计算是在SMOCPro内核之前执行的。预置内核计算允许用户基于当前操作情况和/或其它参数修改SMOCPro内核中的输入参数。
•内核后计算 – 这些计算是在SMOCPro内核执行之后执行的。除了我们即将介绍的对外输出位号外,设计上内核的输出参数将不能被修改。
•外部输入/输出位号 – 这些可能是DCS位号或外部控制器的值,但也相应地作为计算输入/输出。外部输入位号可能不是计算的输出。外部输出位号可以作为计算输入。它们也可以作为临时变量构建复杂计算。
原文:
You may define calculations that are evaluated during controller executions. These calculations may be used to modify controller parameters based on current operating conditions and/or controller/DCS flags. For example, you can design a calculation that automatically removes a CV from the control problem whenever a particular POV is either disconnected or returns a bad value. This calculations feature utilizes the same calculation engine used in other PCTP applications such as AIDAPro, MDPro and RQEPro, thereby providing consistency across the suite of PCTP products. Furthermore, this calculation engine is also used in EXAITG.
The design philosophy for calculations follows the following guidelines:
• First, the required calculations are built offline. Since the results for the specified calculations may have a significant bearing on the controller, it is imperative that any calculations be embedded within appropriate value checks to ensure that the value returned to the SMOCPro kernel is valid. For example, if a calculation modifies a controller request flag, it is recommended that you provide additional calculations to ensure that the value returned is one of 0, 1, 2 or 4. Further details will be provided in subsequent sections.
• Once the necessary calculations have been formulated, the next step is to confirm the expected behavior through simulation and use of the calculation debug file viewer. A new feature in PCTP 2009 Build 1 is that (with restrictions) calculations can now be simulated with the offline simulation package. Please see the simulation section below for more details.
• Next, the EXA file is built containing all the calculation information.
• Finally, the EXA file is imported online. The online controller now evaluates the calculations during each controller execution if the calculation status is ACTIVE (in EXASMOC).
As mentioned above, the intent of this feature is to facilitate run time modifications to controller parameters. The traditional model for SMOCPro is shown below
Notice in this model that inputs/outputs to/from the kernel cannot be modified based on current operating and/or runtime conditions. Hence, the kernel uses the values passed by the embedding directly. To circumvent this difficulty, users have typically adopted an approach whereby they provide an application code base (“user code”) that modifies the inputs to the kernel. This user-supplied application may also utilize the outputs from the kernel to calculate required quantities/metrics.
To minimize the burden on the user with regards to maintaining multiple applications (controller application, user-code applications et cetera), a calculation engine was introduced in PCTP 2008 Build 1.
By integrating the calculations within the realm of controller design, you as the user essentially have to maintain only the SMOCPro controller application. The calculations-GUI has been designed to help the user build a relatively large number of calculations in an efficient manner. With the calculations being part of the controller design, we now have a modified model as shown below
It is now seen that the scope of the controller has been extended to include calculations. A calculation may be evaluated either prior to the execution of the SMOCPro kernel or subsequent to it.
We now introduce and describe some terminology.
• Pre-kernel calculations – These are calculations that are executed before the SMOCPro kernel. Pre-kernel calculations allow the user to modify input parameters to the SMOCPro kernel based on current operating conditions and/or values of other parameters.
• Post-kernel calculations – These are calculations that are evaluated subsequent to the execution of the SMOCPro kernel. By design, output parameters from the kernel may not be modified except for external output tags, which we introduce next.
• External input/output tags – These are DCS tags or values that may be external to the controller but are relevant as inputs/outputs for calculations. External input tags may not be outputs for a calculation. External output tags may be used as inputs for calculations. They may be also used as temporary variables for building complex calculations.
20160417