ExDatamodelInfo

<< 点击显示目录 >>

主页  exOS使用助手 > exOS Automation Help > Diagnose > Function blocks >

ExDatamodelInfo

功能块

clip0003

 

参数

输入/输出

参数

数据类型

说明

IN

ExTargetLink

REFERENCE TO ExTargetLink

连接至 exOS 目标配置。

IN

Enable

BOOL

只要该输入被设置,功能块就处于激活状态。

IN

InstanceName

STRING[35]

数据模型的实例名称。

OUT

Active

BOOL

功能块激活。

OUT

Error

BOOL

执行过程中发生错误。

OUT

StatusID

DINT

状态信息。

OUT

TargetConnected

BOOL

与 exOS 目标机的数据连接已建立。

OUT

PeersConnected

ExTargetCounterType

连接的对等点数量。

OUT

Diag

ExDatamodelDiagType

数据模型的诊断数据。

 

数据类型

ExTargetCounterType - 已连接对等设备的数量。

参数

数据类型

说明

Local

UDINT

连接到此数据模型的 AR 连接数。

Remote

UDINT

此数据模型的 Linux 连接数。

ExDatamodelDiagType - 数据模型的诊断数据。

参数

数据类型

说明

Local

ExDatamodelDiagTargetType

AR 中数据模型的诊断数据。

Local.DatasetsActive

UDINT

从本地应用程序注册的数据集数量。

Local.DatasetErrors

UDINT

缓冲区溢出或配置错误导致的数据集错误计数器。

Remote

ExDatamodelDiagTargetType

Linux 中数据模型的诊断数据。

Remote.DatasetsActive

UDINT

从本地应用程序注册的数据集数量。

Remote.DatasetErrors

UDINT

由于缓冲区溢出或配置错误造成的数据集错误计数器。

DataTransmitted

ExDataTransferType

传输到 Linux 的数据计数器。

DataTransmitted.Bytes

UDINT

字节数(0...1023)。

DataTransmitted.KiB

UDINT

字节数(0...1023)。

DataTransmitted.MiB

UDINT

MB 字节数(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

吉比特数

 

使用方法

该功能块获取 exOS 目标配置生成的全局配置链接地址(包含目标名称),以及  exOS 目标配置(和  应用程序中exos_datamodel_connect() API 函数) 中提供的 数据模型实例名称

ExDatamodelInfo_0(ExTargetLink := ADR(gTarget_0), Enable := TRUE, InstanceName := 'WaterTank_0');

有关 StatusID 输出,请参阅 功能块 StatusID

 

说明

ExDatamodelInfo 功能块提供 DMR 有关 数据模型 连接的信息  ,或 AR 和 Linux 程序之间的内置数据连接。

 

TargetConnected 表示 AR 和 Linux 程序之间存在使用给定数据模型实例的连接。在 AR 建立此连接之前,使用此功能块无法获得更多信息。 要 了解 Linux 中的数据模型实例是否为 AR 连接开放但尚未连接 , 应使用ExDataConnectionInfo 功能块。

 

PeersConnected 显示 有多少 应用程序在 AR(本地)和 Linux(远程)上连接到给定的数据模型实例。例如,一个组件在 Linux 中可能有两个运行时服务,它们都连接到同一个数据模型实例,因为应用程序需要交换信息。在这种情况下, PeersConnected.Remote 将是 2,因为有两个应用程序(对等程序)连接到 Linux 中的数据模型实例。请注意,在这种情况下,Linux 中的两个应用程序之间通过数据模型实例进行的任何通信都是通过 Linux DMR 传输 的, 不经过 AR。

 

进一步的诊断信息显示

 

如果  发生DatasetErrors 。如果数据通信中出现缓冲区溢出,或者 Linux 和 AR 应用程序之间的数据模型不匹配(例如,一方数据集的大小发生变化),就会出现这种情况。由于 exOS 构建链可以在编译 AR 应用程序时更新数据模型和 Linux 程序,因此不匹配的情况应该是可以避免的。

使用给定数据模型实例从 AR 传输到 AR 的数据量。数值单位为 kebi,即字节(Bytes)、千字节(KiB)、兆字节(MiB)和吉字节(GiB)之间的 1024 倍。

ExDatamodelInfo


Function Block

clip0003

 

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.

IN

InstanceName

STRING[35]

Instance name of the datamodel.

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

PeersConnected

ExTargetCounterType

Number of conencted peers.

OUT

Diag

ExDatamodelDiagType

Diagnostic data of the datamodel.

 

Data types

ExTargetCounterType - Number of conencted peers.

Parameter

Data type

Description

Local

UDINT

Number of AR connections to this datamodel.

Remote

UDINT

Number of Linux connections to this datamodel.

ExDatamodelDiagType - Diagnostic data of the datamodel.

Parameter

Data type

Description

Local

ExDatamodelDiagTargetType

Diagnostic data of the datamodel in AR.

Local.DatasetsActive

UDINT

Number of datasets registered from local applications.

Local.DatasetErrors

UDINT

Counter of dataset errors, due to buffer overflow or configuration errors.

Remote

ExDatamodelDiagTargetType

Diagnostic data of the datamodel in Linux.

Remote.DatasetsActive

UDINT

Number of datasets registered from local applications.

Remote.DatasetErrors

UDINT

Counter of dataset errors, due to buffer overflow or configuration errors.

DataTransmitted

ExDataTransferType

Counter of 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 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.

 

Usage

The function block takes the address to the global configuration link generated by the exOS Target configuration (with the name of the target), and the data model instance name provided in the exOS Target configuration (and in the exos_datamodel_connect() API function in the application)

ExDatamodelInfo_0(ExTargetLink := ADR(gTarget_0), Enable := TRUE, InstanceName := 'WaterTank_0');

For the StatusID output, please refer to the Function block StatusIDs.

 

Description

The ExDatamodelInfo function block gives information from the DMR regarding a datamodel connection, or which is the built-in data connection between an AR and a Linux program.

TargetConnected indicates that there is a connection between the AR and Linux program using the given datamodel instance. Until this connection is established from AR, no further information is available using this function block. In order to know, if datamodel instances in Linux are open for AR connections, but not yet connected, the ExDataConnectionInfo function block should be used.

PeersConnected shows how many applications are connecting to the given datamodel instace on AR (Local) and on Linux (Remote). For example, a component could have two runtime services in Linux that are both connecting to the same datamodel instance, because the applications need to exchange information. In this case, PeersConnected.Remote would be 2, as there are two applications (peers) connecting to the datamodel instance in Linux. Note that in this case, any communication that takes place between the two applications in Linux via the datamodel instance are transferred via the Linux DMR without going through AR.

Further diagnostics information shows:

If DatasetErrors have occurred. This can happen if there are buffer overflows in the data communication or if there is a mismatch of the datamodel between the Linux and AR application (for example, the size of a dataset has changed on one side). As the exOS build chain offers the possibility to update the datamodel and the Linux program at the time of compiling the AR application, the situation of mismatches should be avoidable.

The amount of data that has been transferred to and from AR using the given datamodel instance. The values are in kebi, meaning a factor of 1024 between Bytes, KiB, MiB and GiB.

ExDatamodelInfo