调整Flat流 - Adjusting the Flatstream

<< 点击显示目录 >>

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

调整Flat流 - Adjusting the Flatstream

 

If the way messages are structured is changed, then the way data in the transmit/receive array is arranged is also different. The following changes apply to the example given earlier.

如果消息的结构方式发生了变化,那么发送/接收数组中数据的排列方式也不同。以下更改适用于前面给出的示例。

 

 

MultiSegmentMTU

多分段MTU

 

If MultiSegmentMTUs are allowed, then "open positions" in an MTU can be used. These "open positions" occur if the last segment in a message does not fully use the entire MTU. MultiSegmentMTUs allow these bits to be used to transfer the subsequent control bytes and segments. In the program sequence, the "nextCBPos" bit in the control byte is set so that the receiver can correctly identify the next control byte.

 

如果允许多段MTU,那么可以使用MTU中的 "open positions(空点)"。如果消息中的最后一个段没有完全使用整个MTU,就会出现这些 "open positions(空点)"。多分段MTU允许使用这些比特来传输后续的控制字节和段。在程序序列中,控制字节中的 "nextCBPos "位被设置,以便接收端能够正确识别下一个控制字节。

 

Example

示例

3 autonomous messages (7 bytes, 2 bytes and 9 bytes) are being transmitted using an MTU with a width of 7 bytes. The configuration allows the transfer of MultiSegmentMTUs.

使用宽度为7字节的MTU传输3个自主消息(7字节、2字节和9字节)。该配置允许传输多分段MTU。

array_msm.en

Fig.: Transmit/receive array (MultiSegmentMTUs)

图: 发送/接收数组(多分段MTU)

 

First, the messages must be split into segments. As in the default configuration, it is important for each sequence to begin with a control byte. The free bits in the MTU at the end of a message are filled with data from the following message, however. With this option, the "nextCBPos" bit is always set if payload data is transferred after the control byte.

首先,必须将消息拆分为若干段。在默认配置中,每个序列都必须以一个控制字节开始。然而,然而,消息末尾的MTU中的空闲位被下面的消息中的数据填充。使用此选项,如果在控制字节之后传输有效载荷数据,则始终设置“nextCBPos”位。

 

MTU = 7 bytes → Max. segment length = 6 bytes

MTU = 7字节 → 最大段长 = 6字节

Message 1 (7 bytes)

消息1(7字节)

First segment = Control byte + 6 bytes of data (MTU full)

第一段 = 控制字节 + 6 个字节的数据(MTU满)

Second segment = Control byte + 1 byte of data (MTU still has 5 open bytes)

第二段 = 控制字节 + 1 个数据字节(MTU仍有5个开放字节)

Message 2 (2 bytes)

消息2(2字节)

First segment = Control byte + 2 bytes of data (MTU still has 2 open bytes)

第一段 = 控制字节 + 2 个字节的数据(MTU仍有2个开放字节)

Message 3 (9 bytes)

First segment = Control byte + 1 byte of data (MTU full)

第一段 = 控制字节 + 1 个字节的数据(MTU满)

Second segment = Control byte + 6 bytes of data (MTU full)

第二段 = 控制字节 + 6 个字节的数据(MTU满)

Third segment = Control byte + 2 bytes of data (MTU still has 4 open bytes)

第三段 = 控制字节 + 2 个字节的数据(MTU仍有4个开放字节)

No more messages

不再发送消息

C0 control byte

C0 控制字节

 

A unique control byte must be generated for each segment. In addition, the C0 control byte is generated to keep communication on standby.

必须为每个段生成一个唯一的控制字节。此外,生成 C0 控制字节是为了使通信处于待机状态。

C1 (control byte 1)

C1(控制字节 1)

C2 (control byte 2)

C2(控制字节 2)

C3 (control byte 3)

C3(控制字节 3)

- SegmentLength (6)

=

6

- SegmentLength (1)

- 段长度 (6)

=

1

- SegmentLength (2)

- 段长度 (2)

=

2

- nextCBPos (1)

- 下一个 CB 位置 (1)

=

64

- nextCBPos (1)

- 下一个 CB 位置 (1)

=

64

- nextCBPos (1)

- 下一个 CB 位置 (1)

=

64

- MessageEndBit (0)

- 消息结束位 (0)

=

0

- MessageEndBit (1)

- 消息结束位 (1)

=

128

- MessageEndBit (1)

- 消息结束位 (1)

=

128

Control byte

控制字节

Σ

70

Control byte

控制字节

Σ

193

Control byte

控制字节

Σ

194

Table: Flatstream determination of the control bytes for the MultiSegmentMTU example (part 1)

表: 多分段MTU示例的控制字节的Flat流确定(第1部分)

Warning!

警告!

 

The second sequence is only permitted to be acknowledged via SequenceAck if it has been completely processed. In this example, there are 3 different segments within the second sequence, i.e. the program must include enough receive arrays to handle this situation.

只有在第二个序列已被完全处理的情况下,才允许通过SequenceAck对其进行确认。在这个例子中,在第二序列中有3个不同的段,也就是说,程序必须包括足够的接收数组来处理这种情况。

 

C4 (control byte 4)

C4(控制字节 4)

C5 (control byte 5)

C5(控制字节 5)

C6 (control byte 6)

C6(控制字节 6)

- SegmentLength (1)

- 段长度 (1)

=

1

- SegmentLength (6)

- 段长度 (6)

=

6

- SegmentLength (2)

- 段长度 (2)

=

2

- nextCBPos (6)

- 下一个 CB 位置 (6)

=

6

- nextCBPos (1)

- 下一个 CB 位置 (1)

=

64

- nextCBPos (1)

- 下一个 CB 位置 (1)

=

64

- MessageEndBit (0)

- 消息结束位 (0)

=

0

- MessageEndBit (1)

- 消息结束位 (0)

=

0

- MessageEndBit (1)

- 消息结束位 (1)

=

128

Control byte

控制字节

Σ

7

Control byte

控制字节

Σ

70

Control byte

控制字节

Σ

194

Table: Flatstream determination of the control bytes for the MultiSegmentMTU example (part 2)

表: 多分段MTU示例的控制字节的Flat流确定(第2部分)

 

Large segments

大分段

Segments are limited to a maximum of 63 bytes. This means they can be larger than the active MTU. These large segments are divided among several sequences when transferred. It is possible for sequences to be completely filled with payload data and not have a control byte.

分段最大限制为63字节。这意味着它们可以比激活的MTU大。这些大段在传输时被分成几个序列。序列有可能完全被有效载荷数据填满而没有控制字节。

 

Information:

注意:

 

It is still possible to subdivide a message into several segments so that the size of a data packet does not also have to be limited to 63 bytes.

仍然可以将消息细分为若干段,使得数据包的大小不必也限制在63字节。

 

Example

举例

3 autonomous messages (7 bytes, 2 bytes and 9 bytes) are being transmitted using an MTU with a width of 7 bytes. The configuration allows the transfer of large segments.

使用宽度为7字节的MTU传输3个自主消息(7字节、2字节和9字节)。该配置允许传输大分段消息。

array_grs.en

Fig.: Transmit/receive array (large segments)

图 发送/接收数组(大分段)

 

First, the messages must be split into segments. The ability to form large segments means that messages are split up less frequently, which results in fewer control bytes generated.

首先,必须将消息拆分为若干段。形成大段的能力意味着消息被拆分的频率较低,从而减少生成的控制字节。

Large segments allowed → Max. segment length = 63 bytes

允许大段 → 最大段长 = 63 字节

Message 1 (7 bytes)

消息1 (7 字节)

First segment = Control byte + 7 bytes of data

第一段 = 控制字节 + 7字节的数据

Message 2 (2 bytes)

消息2 (2 字节)

First segment = Control byte + 2 bytes of data

第一段 = 控制字节 + 2字节的数据

Message 3 (9 bytes)

消息3 (9 字节)

First segment = Control byte + 9 bytes of data

第一段 = 控制字节 + 9字节的数据

No more messages

不再发送消息

C0 control byte

C0 控制字节

A unique control byte must be generated for each segment. In addition, the C0 control byte is generated to keep communication on standby.

必须为每个段生成一个唯一的控制字节。此外,生成 C0 控制字节是为了使通信处于待机状态。

C1 (control byte 1)

C1(控制字节 1)

C2 (control byte 2)

C2(控制字节 2)

C3 (control byte 3)

C3(控制字节 3)

- SegmentLength (7)

- 段长度 (7)

=

7

- SegmentLength (2)

- 段长度 (2)

=

2

- SegmentLength (9)

- 段长度 (9)

=

9

- nextCBPos (0)

- 下一个 CB 位置 (0)

=

0

- nextCBPos (0)

- 下一个 CB 位置 (0)

=

0

- nextCBPos (0)

- 下一个 CB 位置 (0)

=

0

- MessageEndBit (1)

- 消息结束位 (1)

=

128

- MessageEndBit (1)

- 消息结束位 (1)

=

128

- MessageEndBit (1)

- 消息结束位 (1)

=

128

Control byte

C0 控制字节

Σ

135

Control byte

C0 控制字节

Σ

130

Control byte

C0 控制字节

Σ

137

Table: Flatstream determination of the control bytes for the large segment example

表: 大分段示例的控制字节的Flat流确定

 

Large segments and MultiSegmentMTU

大分段和多分段MTU

 

Example

示例

3 autonomous messages (7 bytes, 2 bytes and 9 bytes) are being transmitted using an MTU with a width of 7 bytes. The configuration allows transfer of large segments as well as MultiSegmentMTUs.

使用宽度为7字节的MTU传输3个自主消息(7字节、2字节和9字节)。该配置允许传输大分段消息和多分段MTU。

array_all.en

Fig.: Transmit/receive array (large segments and MultiSegmentMTUs)

图: 发送/接收数组(大分段和多分段MTU)

 

First, the messages must be split into segments. If the last segment of a message does not completely fill the MTU, it is permitted to be used for other data in the data stream. Bit "nextCBPos" must always be set if the control byte belongs to a segment with payload data.

The ability to form large segments means that messages are split up less frequently, which results in fewer control bytes generated. Control bytes are generated in the same way as with option "Large segments".

 

首先,必须将消息拆分为若干段。如果消息的最后一段没有完全填满MTU,则允许将其用于数据流中的其他数据。如果控制字节属于具有有效负载数据的段,则必须始终设置“nextCBPos”位。

形成大段的能力意味着消息被拆分的频率较低,从而减少生成的控制字节。控制字节的生成方式与选项“大分段”相同。

 

Large segments allowed → Max. segment length = 63 bytes

允许大段 → 最大段长 = 63 字节

Message 1 (7 bytes)

消息1 (7 字节)

First segment = Control byte + 7 bytes of data

第一段 = 控制字节 + 7字节的数据

Message 2 (2 bytes)

消息2 (2 字节)

First segment = Control byte + 2 bytes of data

第一段 = 控制字节 + 2字节的数据

Message 3 (9 bytes)

消息3 (9 字节)

First segment = Control byte + 9 bytes of data

第一段 = 控制字节 + 9字节的数据

No more messages

不再发送消息

C0 control byte

C0 控制字节

 

A unique control byte must be generated for each segment. In addition, the C0 control byte is generated to keep communication on standby.

必须为每个段生成一个唯一的控制字节。此外,生成 C0 控制字节是为了使通信处于待机状态。

C1 (control byte 1)

C1(控制字节 1)

C2 (control byte 2)

C2(控制字节 2)

C3 (control byte 3)

C3(控制字节 3)

- SegmentLength (7)

- 段长度 (7)

=

7

- SegmentLength (2)

- 段长度 (2)

=

2

- SegmentLength (9)

- 段长度 (9)

=

9

- nextCBPos (0)

- 下一个 CB 位置 (0)

=

0

- nextCBPos (0)

- 下一个 CB 位置 (0)

=

0

- nextCBPos (0)

- 下一个 CB 位置 (0)

=

0

- MessageEndBit (1)

- 消息结束位 (1)

=

128

- MessageEndBit (1)

- 消息结束位 (1)

=

128

- MessageEndBit (1)

- 消息结束位 (1)

=

128

Control byte

C0 控制字节

Σ

135

Control byte

C0 控制字节

Σ

130

Control byte

C0 控制字节

Σ

137

Table: Flatstream determination of the control bytes for the large segment and MultiSegmentMTU example

表: 大分段和多分段MTU示例的控制字节的Flat流确定