X20 system modules • Other functions • X20CM4810
X20 system User's Manual 3.10
2183
4.26.2.6.1.3 The FlatStream principle
Requirements
Before FlatStream can be used, the respective communication direction must be synchronized, i.e. both commu-
nication partners cyclically query the sequence counter on the opposite station. This checks to see if there is new
data that should be accepted.
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.
_data_01
_data_02
_data_03
_data_04
_data_05
_data_xx
. . .
TxBytes
Transmit array
Type: USINT
OutputMTU
Type: USINT
PLC / Bus controller
The transmit buffer
of the module is
adjusted cyclically to
OutputMTU via X2X
_data_01
_data_02
_data_03
_data_04
_data_05
_data_xx
. . .
*RxBytes
Module-internal
receive array
Type: USINT
Module-internal
transmit array
Type: USINT
Module-internal
transmit buffer
Type: USINT
Module-internal
receive buffer
Type: USINT
Module
Cyc.
_data_01
_data_02
_data_03
_data_04
_data_05
_data_xx
. . .
RxBytes
Receive array
Type: USINT
InputMTU
Type: USINT
_data_01
_data_02
_data_03
_data_04
_data_05
_data_xx
. . .
*TxBytes
Cyc.
CPU fills
OutputMTU
with the next
sequence of the
transmit array
When OutputMTU
released:
Module increases the
InputSequence counter
If permitted:
Module fills the internal
transmit buffer with the
next sequence of the
transmit array
InputMTU must be
added to the end
of the receive array
(increase InputSequenceAck
to end properly)
If the
InputSequence
counter is increased:
Module adds the transmit buffer
to the internal array
If successful:
InputSequenceAck is
adjusted to the
transmit counter
If the OutputSequence
counter is increased:
InputMTU is
adjusted cyclically
to the receive
buffer via X2X
Figure 723: FlatStream communication
Procedure
The first thing that happens is that the message is broken into valid segments of up to 63 bytes, and the corre-
sponding control bytes are created. The data is formed into a data stream made up of one control bytes per asso-
ciated 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.
When the array has been completely created, the transmitter checks whether the MTU is allowed to be refilled.
Then it 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 transmission is successful, the data in the receive array will correspond 100% to the data in the transmit array.
During the transmission, 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 transmitted.
4.26.2.6.1.4 Registers for FlatStream mode
Five registers are available for configuring FlatStream. The default configuration can be used to transmit small
amounts of data relatively easily.
Information:
The CPU communicates directly with the field device via the "OutputSequence" and "InputSequence"
as well as the enabled Tx and Rx bytes. For this reason, the user needs to have sufficient knowledge
of the communication protocol being used on the field device.
Summary of Contents for X20 System
Page 2: ......