X20 system modules • Digital signal processing modules • X20DS1928
1424
X20 system User's Manual 3.10
FlatStream operation
When using FlatStream, the communication direction is enormously important. For sending data to a module ("out-
put" direction), the Tx bytes are used. For receiving data from a module ("input" direction"), the Rx bytes are used.
The "OutputSequence" and "InputSequence" registers are used to control and ensure that communication is taking
place properly, i.e. the transmitter issues the directive that the data should be accepted and the receiver acknowl-
edges that a sequence has been transferred successfully.
Tx-/Rx-Bytes:
The Tx and Rx bytes are cyclic registers used to transport the payload data and the necessary control bytes.
The number of active Tx/Rx bytes is taken from the configuration of the "OutputMTU" and "InputMTU" registers,
respectively.
In the user's program, only the Tx/Rx bytes from the CPU can be used. The corresponding counterparts are located
in the module and are not accessible to the user. For this reason, names were chosen from the CPU point of view.
•
"T" - "Transmit" → CPU
transmits
data to the module
•
"R" - "Receive" → CPU
receives
data from the module
Data type
Values
USINT
0...65535
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 segments.
Bit structure of a control byte:
Bit
Name
Information
0-5
SegmentLength
0-63
Size in bytes of the following segment (default: max. MTUSize
- 1)
0
Next control byte at the beginning of the next MTU
6
nextCBPos
1
Next control byte directly at the end of this segment
0
Message continues after the subsequent segment
7
MessageEndBit
1
Message ends after the subsequent segment
Segment length:
The segment length lets the receiver know the length of the coming segment. If the configured 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.
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 the "MultiSegmentMTU" option.
When using FlatStream communication with multi-segment MTUs, the next control byte is no longer expected in
the first Rx byte of the subsequent MTU, but directly after the current segment.
MessageEndBit:
The "MessageEndBit" is set if the subsequent segment completes a message. The message is then completely
transferred and can be processed further.
Information:
In the output direction, this bit must also be set if one individual segment is enough to take on the
entire message. The module will only process a message internally if this identifying mark 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:
CB
Control byte
Message [bytes] = SegmentLengths (all CBs without ME) + SegmentLength (of the first CB with
ME)
ME MessageEndBit
Summary of Contents for X20 System
Page 2: ......