<< 点击显示目录 >> 主页 exOS使用助手 > exOS Automation Help > Diagnose > Function blocks > ExTargetInfo |
功能块
参数
输入/输出 |
参数 |
数据类型 |
说明 |
---|---|---|---|
IN |
ExTargetLink |
REFERENCE TO ExTargetLink |
连接至 exOS 目标配置。 |
IN |
Enable |
BOOL |
只要该输入被设置,功能块就处于激活状态。 |
OUT |
Active |
BOOL |
功能块激活。 |
OUT |
Error |
BOOL |
执行过程中发生错误。 |
OUT |
StatusID |
DINT |
状态信息。 |
OUT |
Deploying |
BOOL |
exOS 目标器正在部署。 |
OUT |
Operational |
BOOL |
exOS 目标处于运行状态。在部署被禁用(关闭)的情况下,当与 exOS 目标器建立数据连接(TargetConnected)时,运行被设置。 |
OUT |
Stopped |
BOOL |
exOS 目标已停止。 |
OUT |
Aborted |
BOOL |
exOS 目标已中止。 |
OUT |
Diag |
ExTargetDiagType |
exOS 目标的诊断数据。 |
数据类型
ExTargetDiagType - exOS 目标的诊断数据。
参数 |
数据类型 |
说明 |
---|---|---|
Components |
ExTargetDiagComponentType |
exOS 目标的 exOS 组件的诊断数据。 |
Components.Configured |
UDINT |
已配置组件的数量。 |
Components.Deploying |
UDINT |
部署组件的数量。 |
Components.Operational |
UDINT |
运行组件数量。 |
Components.Stopped |
UDINT |
停止的组件数量。 |
Components.Aborted |
UDINT |
中止的组件数量。 |
该功能块只需一个参数,即 exOS 目标配置生成的全局配置链接地址(包含目标名称)
ExTargetInfo_0(ExTargetLink := ADR(gTarget_0), Enable := TRUE);
关于 StatusID 输出,请参阅 功能块 StatusID。
ExTargetInfo 功能块提供有关 部署序列 和目标机上所有组件的整体状态 。
有关部署序列不同步骤的详细信息,可在 ExDeploy 日志中找到。该功能块应提供与控制应用程序相关的信息。
例如, "运行 "表示 目标系统上的 所有组件都 已部署并进 入"运行 "状态(即 "部署序列完成")。如果任何组件在执行过程中失败(即崩溃), Diag.Components.Aborted 计数器将增加, Diag.Components.Operational 计数器将减少。这将提供足够的信息,让我们知道是 "一切正常 "还是需要采取进一步的诊断措施。
通常情况下, 如果组件崩溃 ,ExTargetInfo 将保持 运行状态, 因为目标本身(与其他组件) 仍在运行 。但是 ,如果将ErrorHandling(错误处理) 设置为 Stopall components(停止所有组件) 或 RestartEvent(重启事件) 设置为 Target(目标)的 组件 崩溃, ExTargetInfo 将进入 Stopped(停止) 状态 。在此 ,Diag.Components.Stopped 和 Diag.Components.Aborted 可能会有所不同,这取决于有多少组件实际崩溃(中止),以及有多少组件被部署序列停止。
Function Block
Parameters
I/O |
Parameter |
Data type |
Description |
IN |
ExTargetLink |
REFERENCE TO ExTargetLink |
Connection to exOS Target configuration. |
IN |
Enable |
BOOL |
The function block is active as long as this input is set. |
OUT |
Active |
BOOL |
Function block active. |
OUT |
Error |
BOOL |
Error occurred during execution. |
OUT |
StatusID |
DINT |
Status information. |
OUT |
Deploying |
BOOL |
exOS Target is deploying. |
OUT |
Operational |
BOOL |
exOS Target is operational. In case Deployment is disabled (Off), Operational is set when the data connection to the exOS Target is established (TargetConnected). |
OUT |
Stopped |
BOOL |
exOS Target is stopped. |
OUT |
Aborted |
BOOL |
exOS Target is aborted. |
OUT |
Diag |
ExTargetDiagType |
Diagnostic data of the exOS Target. |
Data types
ExTargetDiagType - Diagnostic data of an exOS Target.
Parameter |
Data type |
Description |
Components |
ExTargetDiagComponentType |
Diagnostic data of the exOS Components of an exOS Target. |
Components.Configured |
UDINT |
Number of configured components. |
Components.Deploying |
UDINT |
Number of deploying components. |
Components.Operational |
UDINT |
Number of operational components. |
Components.Stopped |
UDINT |
Number of stopped components. |
Components.Aborted |
UDINT |
Number of aborted components. |
The function block only takes one parameter, which is the address to the global configuration link generated by the exOS Target configuration (with the name of the target)
ExTargetInfo_0(ExTargetLink := ADR(gTarget_0), Enable := TRUE);
For the StatusID output, please refer to the Function block StatusIDs.
The ExTargetInfo function block gives an overall status regarding the Deployment sequence and all components on a target.
More detailed information regarding the different steps of the deployment sequence can be found in the ExDeploy logger. This function block should supply information that is relevant for controlling an application.
For example, Operational means that all components on a target system have been deployed and entered Operational state (i.e. "deployment sequence done"). Should any of the components fail during execution (i.e. crash), the Diag.Components.Aborted counter will increase and the Diag.Components.Operational counter will decrease. This gives enough information to know if "everything is OK" or if further diagnostic actions need to be taken.
Normally, the ExTargetInfo will remain in Operational if a component crashes, because the target itself (with other components) is still up and running. In case, however, a component with ErrorHandling set to Stop all components or RestartEvent set to Target crashes, the ExTargetInfo will go into state Stopped. Here the Diag.Components.Stopped and Diag.Components.Aborted may vary depending on how many components actually crashed (Aborted) and how many were stopped by the deployment sequence.