控制字 - Control bytes

<< 点击显示目录 >>

主页  振动监测 > X20(c)CM4810使用手册 > 寄存器说明 - Register description  > Flat 流 - Flatstream  > Flat流通信 - Flatstream communication > Flat流模式的寄存器 - Registers for Flatstream mode > Flat流操作 - Flatstream operation  >

控制字 - Control bytes

In addition to the payload data, the Tx and Rx bytes also transfer the necessary control bytes. These control bytes contain additional information about the data stream so that the receiver can reconstruct the original message from the transferred

 

除了有效载荷数据外,Tx和Rx字节还传输必要的控制字。这些控制字包含关于数据流的额外信息,以便接收方能够从传输的段中重构原始信息。

 

Bit structure of a control byte

控制字的位结构

Bit

Description

描述

Value

Information

说明

0 - 5

SegmentLength

段长

0 - 63

Size of the subsequent segment in bytes (default: Max. MTU size - 1)

后续段的大小,以字节为单位(默认值:最大 MTU 大小 - 1)

6

nextCBPos

0

Next control byte at the beginning of the next MTU

下一个MTU开头的控制字

1

Next control byte directly after the end of the current segment

当前段结束后的下一个控制字节

7

MessageEndBit

0

Message continues after the subsequent segment

消息在下一段继续

1

Message ended by the subsequent segment

消息在随后续的段结束

 

SegmentLength

段长

The segment length lets the receiver know the length of the coming segment. If the set segment length is insufficient for a message, then the information must be distributed over several segments. In these cases, the actual end of the message is detected using bit 7 of the control byte.

 

段长使接收端知道即将到来的分段的长度。如果设置的段长度不足以容纳一条消息,则信息必须分布在多个段上。在这些情况下,使用控制字节的bit 7来检测消息的实际结束。

 

Information:

注意:

 

The control byte is not included in the calculation to determine the segment length. The segment length is only derived from the bytes of payload data.

控制字节不包括在用于确定段长的计算中。分段长度仅从有效载荷数据的字节中得出。

 

nextCBPos

This bit indicates the position where the next control byte is to be expected. This information is especially important when using option "MultiSegmentMTU".

When using Flatstream communication with multi-segment MTUs, the next control byte

 

该位指示下一个控制字节的位置。当使用选项 "MultiSegmentMTU "时,这一信息特别重要。

当使用多段MTU的Flats流通信时,下一个控制字节不再预置于后续MTU的第一个Rx字节中,而是直接在当前段后传输。

 

MessageEndBit

"MessageEndBit" is set if the subsequent segment completes a message. The message has then been completely transferred and is ready for further processing.

 

如果后续段来完成消息,则设置“MessageEndBit”。这时,消息已经完全传输完毕,可以进一步处理。

 

Information:

注意:

 

In the output direction, this bit must also be set if one individual segment is enough to hold the entire message. The module will only process a message internally if this identifier is detected.

The size of the message being transferred can be calculated by adding all of the message's segment lengths together.

在输出方向上,如果一个单独的段足以容纳整个消息,则也必须设置该位。只有在检测到这个标识符时,模块才会在内部处理一条消息。

可以通过将消息的所有分段长度相加来计算正在传输的消息的大小。

 

 

Flatstream formula for calculating message length:

计算Flatst流消息长度的公式:

Message [bytes] = Segment lengths (all CBs without ME) + Segment length (of the first CB with ME)

消息 [字节] = 段长度 (所有没有 ME 的 CB ) + 段长度 (第一个有 ME 的 CB)

CB

Control byte

控制字

ME

MessageEndBit

消息结束位