Flat流原理 - The Flatstream principle

<< 点击显示目录 >>

主页  振动监测 > X20(c)CM4810使用手册 > 寄存器说明 - Register description  > Flat 流 - Flatstream  > Flat流通信 - Flatstream communication >

Flat流原理 - The Flatstream principle

Requirement

要求

Before Flatstream can be used, the respective communication direction must be synchronized, i.e. both communication partners cyclically query the sequence counter on the opposite station. This checks to see if there is new data that should be accepted.

在使用Flatstream之前,必须同步相应的通信方向,即两个通信伙伴循环查询对方站上的序列计数器。这将检查是否存在应接受的新数据。

 

Communication

通信

If a communication partner wants to transmit a message to its opposite station, it should first create a transmit array that corresponds to Flatstream conventions. This allows the Flatstream data to be organized very efficiently without having to block other important resources.

如果通信伙伴想要向其对方站发送消息,则应首先创建一个对应于 Flatstream 约定的传输数组。这允许 Flatstream 数据被非常有效地组织起来,而不必阻塞其他的重要资源。

com_general.en

Fig.: Flatstream communication

图.: Flat流通信

Procedure

程序

The first thing that happens is that the message is broken into valid segments of up to 63 bytes, and the corresponding control bytes are created. The data is formed into a data stream made up of one control bytes per associated segment. This data stream can be written to the transmit array. The maximum size of each array element matches that of the enabled MTU so that one element corresponds to one sequence.

If the array has been completely created, the transmitter checks whether the MTU is permitted to be refilled. It then copies the first element of the array or the first sequence to the Tx byte registers. The MTU is transported to the receiver station via X2X Link and stored in the corresponding Rx byte registers. To signal that the data should be accepted by the receiver, the transmitter increases its SequenceCounter.

If the communication direction is synchronized, the opposite station detects the incremented SequenceCounter. The current sequence is appended to the receive array and acknowledged by SequenceAck. This acknowledgment signals to the transmitter that the MTU can now be refilled.

If the transfer is successful, the data in the receive array will correspond 100% to the data in the transmit array. During the transfer, the receiving station must detect and evaluate the incoming control bytes. A separate receive array should be created for each message. This allows the receiver to immediately begin further processing of messages once they have been completely transferred.

 

首先发生的事情是,消息被分解成最多63个字节的有效段,并创建相应的控制字节。数据形成为数据流,该数据流由每个关联段的一个控制字节组成。这个数据流可以被写入传输数组。每个数组元素的最大长度与启用的MTU的最大大小匹配,使得一个元素对应于一个序列。 如果数组已经被完全创建,发送端检查MTU是否允许被重新填充。然后它将数组的第一个元素或第一个序列复制到Tx字节寄存器中。MTU通过X2X Link传送到接收站,并存储在相应的Rx字节寄存器中。为了表示数据应该被接收端接受,发送端增加其SequenceCounter。 如果通信方向同步,则对方站检测到递增的SequenceCounter。当前序列被附加到接收数组中,并由SequenceAck进行确认。该确认信号向发送端发送MTU现在可以重新填充的信号。

如果传输成功,则接收数组中的数据将100%对应于发送数组中的数字。在传输过程中,接收站必须检测和评估传入的控制字节。应为每条消息创建一个单独的接收数组,这样,一旦消息被完全传输,接收站可以立即开始进一步处理。