<< 点击显示目录 >> 主页 exOS使用助手 > exOS Automation Help > Diagnose > Function blocks > ExComponentInfo |
功能块
参数
I/O |
参数 |
数据类型 |
说明 |
---|---|---|---|
IN |
ExTargetLink |
REFERENCE TO ExTargetLink |
连接到 exOS 目标配置。 |
IN |
ExComponentLink |
REFERENCE TO ExComponentLink |
连接至 exOS 组件配置。 |
IN |
Enable |
BOOL |
只要设置了该输入,功能块就处于激活状态。 |
OUT |
Active |
BOOL |
功能块激活。 |
OUT |
Error |
BOOL |
执行过程中发生错误。 |
OUT |
StatusID |
DINT |
状态信息。 |
OUT |
Name |
STRING[35] |
exOS 组件名称。 |
OUT |
Deploying |
BOOL |
exOS 组件正在部署。 |
OUT |
Operational |
BOOL |
exOS 组件正在运行。如果部署被禁用(关闭),则在与 exOS 目标建立数据连接(TargetConnected)时设置为运行。 |
OUT |
Stopped |
BOOL |
exOS 组件停止。 |
OUT |
Aborted |
BOOL |
exOS 组件中止。 |
OUT |
Diag |
ExComponenInfoDiagType |
exOS 组件的诊断数据。 |
数据类型
ExComponenInfoDiagType-exOS组件的诊断数据。
参数 |
数据类型 |
说明 |
---|---|---|
Files |
ExComponenInfoDiagFilesType |
exOS 组件文件的诊断数据。 |
Files.Configured |
UDINT |
已配置文件的数量。 |
Files.Deployed |
UDINT |
已部署文件的数量。 |
Files.Failed |
UDINT |
失败(未找到)文件的数量。 |
StartupServices |
ExComponenInfoDiagStartSvcType |
exOS 组件启动服务的诊断数据。 |
StartupServices.Configured |
UDINT |
已配置启动服务的数量。 |
StartupServices.Finished |
UDINT |
已完成的启动服务数量。 |
StartupServices.Failed |
UDINT |
失败的启动服务数量。 |
RuntimeServices |
ExComponenInfoDiagRunSvcType |
exOS 组件运行时服务的诊断数据。 |
RuntimeServices.Configured |
UDINT |
已配置服务的数量。 |
RuntimeServices.Running |
UDINT |
运行服务的数量。 |
RuntimeServices.Stopped |
UDINT |
主动停止的服务数量。 |
RuntimeServices.Failed |
UDINT |
失败的运行时服务数量。 |
该功能块只接受由exOS目标配置(包含目标名称)和exOS组件配置(包含组件名称)生成的两个全局配置链接
ExComponentInfo_0(ExTargetLink:=ADR(gTarget_0),ExComponentLink:=ADR(gWaterTank_0),Enable:=TRUE);
有关StatusID输出,请参阅 功能块 StatusID。
ExComponentInfo功能块提供有关组件部署和执行的信息,该组件通过AR中的部署 序列 服务进行控制。类似的信息也可通过ExDeploy日志记录器获取,但该记录器可在组件到达中止状态(由于错误)时获取更多详细信息。
该功能块提供的信息可用于AR应用程序,以确定组件在目标系统上的状态。例如,"运行"(Operational)表示组件已成功部署和启动,除非错误被忽略(请参阅"开发人员"部分的"错误处理"(ErrorHandling)),否则表示所有运行时服务正在执行。这表明Linux和AR应用程序之间的数据交换功能(使用exos_api)可以启动。
如果关闭了部署功能,并且Linux应用程序需要手动调试或启动,那么一旦AR和Linux-DMR之间建立了数据连接,就会立即设置为运行状态,因此应用程序可以将逻辑保持为"运行状态时连接"。
//自动连接:
WaterTankCyclic_0.Enable := ExComponentInfo_0.Operational;
请注意,在这种情况下,需要手动启动LinuxDMR。在"真实"部署目标(刚刚暂时禁用部署)上,可通过在目标Linux系统上调用sudosystemctlstopexos-data.0.runtime.exos.service;sudo /usr/bin/exos_mr来 完成 。有关模拟环境,请参阅 Windows Subsystem for Linux (WSL)。
ExComponentInfo 还包含额外的诊断信息,如配置文件和服务的数量,以及有多少文件/服务被成功传输/执行。如果应用程序不能按预期运行,这些信息将有助于快速调试。
在大多数情况下,数据连接是通过 ExDataConnectionInfo 功能块进行监控的,该功能块提供来自LinuxanAR上两个DMR进程的信息。如果该功能块报错或信息不足,可使用ExComponentInfo检查包含DMR的组件(exos-data)的状态。由于该组件对用户是隐藏的,因此没有指定的ExComponentLink,将ExComponentLink设置为0将显示给定目标的外显子数据组件的状态。
ExComponentInfo_DataConnection(ExTargetLink:=ADR(gTarget_0),ExComponentLink:=0,Enable:=TRUE);
Function Block
Parameters
I/O |
Parameter |
Data type |
Description |
IN |
ExTargetLink |
REFERENCE TO ExTargetLink |
Connection to exOS Target configuration. |
IN |
ExComponentLink |
REFERENCE TO ExComponentLink |
Connection to exOS Component 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 |
Name |
STRING[35] |
Name of the exOS Component. |
OUT |
Deploying |
BOOL |
exOS Component is deploying. |
OUT |
Operational |
BOOL |
exOS Component 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 Component is stopped. |
OUT |
Aborted |
BOOL |
exOS Component is aborted. |
OUT |
Diag |
ExComponenInfoDiagType |
Diagnostic data of the exOS Component. |
Data types
ExComponenInfoDiagType - Diagnostic data of an exOS Component.
Parameter |
Data type |
Description |
Files |
ExComponenInfoDiagFilesType |
Diagnostic data of the files of an exOS Component. |
Files.Configured |
UDINT |
Number of configured files. |
Files.Deployed |
UDINT |
Number of deployed files. |
Files.Failed |
UDINT |
Number of failed (not found) files. |
StartupServices |
ExComponenInfoDiagStartSvcType |
Diagnostic data of the startup services of an exOS Component. |
StartupServices.Configured |
UDINT |
Number of configured startup services. |
StartupServices.Finished |
UDINT |
Number of finished startup services. |
StartupServices.Failed |
UDINT |
Number of failed startup services. |
RuntimeServices |
ExComponenInfoDiagRunSvcType |
Diagnostic data of the runtime services of an exOS Component. |
RuntimeServices.Configured |
UDINT |
Number of configured services. |
RuntimeServices.Running |
UDINT |
Number of running services. |
RuntimeServices.Stopped |
UDINT |
Number of actively stopped services. |
RuntimeServices.Failed |
UDINT |
Number of failed runtime services. |
The function block only takes two global configuration links generated by the exOS Target configuration (with the name of the target), and the exOS component configuration (with the name of the component)
ExComponentInfo_0(ExTargetLink := ADR(gTarget_0), ExComponentLink := ADR(gWaterTank_0), Enable := TRUE);
For the StatusID output, please refer to the Function block StatusIDs.
In most cases the data connection is monitored via the ExDataConnectionInfo function block which provides information from the two DMR processes on Linux an AR. Should this function block report an error or insufficient information, the ExComponentInfo can be used to check the state of the component that contains the DMR, the exos-data. As this component is hidden from the user and therefore does not have a designated ExComponentLink, setting the ExComponentLink to zero will show the state of the exos-data component for the given target.
ExComponentInfo_DataConnection(ExTargetLink := ADR(gTarget_0), ExComponentLink := 0, Enable := TRUE);