<< 点击显示目录 >> 主页 exOS使用助手 > exOS Automation Help > Diagnose > Function blocks > ExDataConnectionInfo |
功能块
参数
输入/输出 |
参数 |
数据类型 |
说明 |
---|---|---|---|
IN |
ExTargetLink |
REFERENCE TO ExTargetLink |
连接至 exOS 目标配置。 |
IN |
Enable |
BOOL |
只要该输入被设置,功能块就处于激活状态。 |
OUT |
Active |
BOOL |
功能块激活。 |
OUT |
Error |
BOOL |
执行过程中发生错误。 |
OUT |
StatusID |
DINT |
状态信息。 |
OUT |
TargetConnected |
BOOL |
与 exOS 目标机的数据连接已建立。 |
OUT |
TargetSynchronized |
BOOL |
exOS 目标器与 AR 同步。 |
OUT |
LoggerConnected |
BOOL |
远程记录仪已连接。 |
OUT |
Diag |
ExDataConnectionDiagType |
数据连接的诊断数据。 |
Data types
ExDataConnectionDiagType - Diagnostic data of the data connection.
参数 |
数据类型 |
说明 |
---|---|---|
Local |
ExDataConnectionDiagTargetType |
AR 数据连接的诊断数据。 |
Local.DatamodelsConfigured |
UDINT |
目标配置中的数据模型数 |
Local.DatamodelsActive |
UDINT |
连接到本地应用程序的数据模型数。 |
Local.DatamodelErrors |
UDINT |
来自本地应用程序的失败连接尝试计数器。 |
Remote |
ExDataConnectionDiagTargetType |
Linux 数据连接的诊断数据。 |
Remote.DatamodelsConfigured |
UDINT |
目标配置中的数据模型数 |
Remote.DatamodelsActive |
UDINT |
连接到本地应用程序的数据模型数。 |
Remote.DatamodelErrors |
UDINT |
从本地应用程序尝试连接失败的计数器。 |
DataTransmitted |
ExDataTransferType |
传输到 Linux 的总数据计数器。 |
DataTransmitted.Bytes |
UDINT |
字节数(0...1023)。 |
DataTransmitted.KiB |
UDINT |
字节数(0...1023)。 |
DataTransmitted.MiB |
UDINT |
兆字节数(0...1023)。 |
DataTransmitted.GiB |
UDINT |
吉比特数。 |
DataReceived |
ExDataTransferType |
从 Linux 接收到的全部数据的计数器。 |
DataReceived.Bytes |
UDINT |
字节数(0...1023)。 |
DataReceived.KiB |
UDINT |
基字节数(0...1023)。 |
DataReceived.MiB |
UDINT |
MB 字节数 (0...1023)。 |
DataReceived.GiB |
UDINT |
Gibibytes 数量。 |
该功能块只需一个参数,即 exOS 目标配置生成的全局配置链接地址(包含目标名称)
ExDataConnectionInfo_0(ExTargetLink := ADR(gTarget_0), Enable := TRUE);
关于 StatusID 输出,请参阅 功能块 StatusID。
ExDataConnectionInfo 功能块提供 目标连接的整体 DMR 状态,即数据连接的状态。 最重要的信息是
•目标连接:该值应始终为 "true",只有 在系统启动或更改配置 时才会变为 "false"。 如果该值仍 为FALSE,最可能的原因是 exOS 目标配置中的 IP 地址或主机名设置不正确。在这种情况下,也请检查 ExTargetInfo 状态。其他原因可能是 Linux 中防火墙的外部更改会阻止数据通信。
•目标同步:它提供的信息与 ExSyncInfo 功能块 中的 PrecisionReached 相同 ,意味着目标的时间同步在配置的 精度 范围内 。
•已连接记录仪:数据连接记录器 ExData 有自己的信息交换通道,如果没有此连接,来自 Linux 应用程序的信息将无法在 AR 记录器中看到。该输出遵循与 TargetConnected 相同的规则 。
它还提供额外的诊断信息:
•DatamodelsConfigured:这应与 exOS 目标配置中设置的 数据模型实例数量一致 。由于每个数据连接都是通过一个 数据模型实例 建立 的,因此这是每一方配置的可能连接通道的数量。 本地 和 远程 值应始终相同。
•数据模型激活:如果至少有一个 对等体 (请参阅 ExDatamodelInfo)连接到 数据模型实例,则认为该数据模型 处于活动状态。这意味着,如果所有配置的应用程序都在运行并交换数据,那么 DatamodelsActive 就等于 DatamodelsConfigured。在下面的示例中,可以看到两个 数据模型实例在 Linux 上都 处于 活动状态(即连接到应用程序),而在 AR 中只有一个应用程序处于活动状态。
•DatamodelErrors(数据模型错误):如果应用程序 使用错误的配置连接到 数据模型实例,该计数器的值就会增加 。每次尝试失败,该值都会增加一次。由于 exOS 构建链允许在编译 AR 应用程序的同时生成数据模型并编译 Linux 程序,因此这个问题应该是可以避免的。
•发送/接收数据(DataTransmitted/Received) 此项显示在所有活动 数据模型实例中, Linux 和 AR 运行时之间发送和接收的数据量 。数值单位为 kebi,即字节(Bytes)、千字节(KiB)、兆字节(MiB)和吉字节(GiB)之间的 1024 倍。
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 |
TargetConnected |
BOOL |
Data connection to the exOS Target is established. |
OUT |
TargetSynchronized |
BOOL |
exOS Target is synchronized with AR. |
OUT |
LoggerConnected |
BOOL |
Remote Logger is connected. |
OUT |
Diag |
ExDataConnectionDiagType |
Diagnostic data of the data connection. |
Data types
ExDataConnectionDiagType - Diagnostic data of the data connection.
Parameter |
Data type |
Description |
Local |
ExDataConnectionDiagTargetType |
Diagnostic data of the data connection for AR. |
Local.DatamodelsConfigured |
UDINT |
Number of datamodels in the target configuration |
Local.DatamodelsActive |
UDINT |
Number datamodels connected to local applications. |
Local.DatamodelErrors |
UDINT |
Counter failed connection attempts from local applications. |
Remote |
ExDataConnectionDiagTargetType |
Diagnostic data of the data connection for Linux. |
Remote.DatamodelsConfigured |
UDINT |
Number of datamodels in the target configuration |
Remote.DatamodelsActive |
UDINT |
Number datamodels connected to local applications. |
Remote.DatamodelErrors |
UDINT |
Counter failed connection attempts from local applications. |
DataTransmitted |
ExDataTransferType |
Counter of overall transmitted data to Linux. |
DataTransmitted.Bytes |
UDINT |
Number of Bytes (0..1023). |
DataTransmitted.KiB |
UDINT |
Number of Kibibytes (0..1023). |
DataTransmitted.MiB |
UDINT |
Number of Mebibytes (0..1023). |
DataTransmitted.GiB |
UDINT |
Number of Gibibytes. |
DataReceived |
ExDataTransferType |
Counter of overall received data from Linux. |
DataReceived.Bytes |
UDINT |
Number of Bytes (0..1023). |
DataReceived.KiB |
UDINT |
Number of Kibibytes (0..1023). |
DataReceived.MiB |
UDINT |
Number of Mebibytes (0..1023). |
DataReceived.GiB |
UDINT |
Number of Gibibytes. |
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)
ExDataConnectionInfo_0(ExTargetLink := ADR(gTarget_0), Enable := TRUE);
For the StatusID output, please refer to the Function block StatusIDs.
The ExDataConnectionInfo function block provides the overall DMR status of a target connection, i.e. the status of the data connection. The most important information is
•TargetConnected: This should always be TRUE, and only go to FALSE during system boot or during configuration changes. If this value remains FALSE, the most likely reason is that the IP address or hostname is incorrectly set in the exOS Target configuration. In this case, also check the ExTargetInfo status. Other reasons could be an external change of the firewall in Linux that would block the data communication.
•TargetSynchronized: This provides the same information as PrecisionReached in the ExSyncInfo function block, meaning that the time synchronization of the target is within the configured Precision.
•LoggerConnected: The data connection logger ExData, has its own channel for exchanging messages, and without this connection, messages from Linux applications will not be visible in the AR Logger. This output follows the same rules as TargetConnected.
It also provides additional Diagnostic information:
•DatamodelsConfigured: This should correspond to the number of datamodel instances set up in the exOS Target configuration. As every data connection is established via a datamodel instance, this is the number of possible connection channels that are configured on each side. The Local and Remote values should always be the same.
•DatamodelsActive: If at least one Peer (see ExDatamodelInfo) is connected to a datamodel instance, this datamodel is considered Active. This means that if all configured applications are operational and are exchanging data, the DatamodelsActive is equal to DatamodelsConfigured. In the example below it is visible that both datamodel instances are active on Linux (i.e. connected to applications), whereas only one application is active in Automation Runtime.
•DatamodelErrors: This counter is increased if an application connects to a datamodel instance using the wrong configuration. The value is increased once for every failed attempt. As the exOS build chain allows to generate the datamodel and compile Linux programs alongside the Automation Runtime applications, this problem should be avoidable.
•DataTransmitted/Received This shows the collected amount of data sent and received between Linux and Automation runtime over all active datamodel instances. The values are in kebi, meaning a factor of 1024 between Bytes, KiB, MiB and GiB.