X20 system modules • Analog input modules • X20AI2438
X20 system User's Manual 3.10
223
4.3.7.9.9.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
on the module is
adapted cyclically to
OutputMTU via X2X
.
_data_01
_data_02
_data_03
_data_04
_data_05
_data_xx
. . .
*RxBytes
Module-internal
Receive buffer
Type: USINT
Module-internal
Receive array
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.
If OutputMTU
is enabled:
CPU fills
OutputMTU
with the next
sequence from the
Transmit array
Module-internal
Send buffer
Type: USINT
Module-internal
Transmit array
Type: USINT
If permitted:
Module fills the internal
transmit buffer with the
next sequence
of the transmit array
Module increments the
InputSequence counter
If the
InputSequence-
counter is incremented:
InputMTU must
be added to the
end of the receive array
(Increase InputSequenceAck
to finish correctly)
If the OutputSequence-
counter is incremented:
Module adds the transmit buffer
to the internal array
If successful:
InputSequenceAck is
adapted to the
transmit array.
InputMTU is
adapted cyclically to
adapted to the
receive buffer.
Figure 74: 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.
Summary of Contents for X20 System
Page 2: ......