X90 mobile modules
202
X90 mobile system User's manual V 1.20 - Translation of the original manual
The Flatstream principle
Requirement
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
adapted 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
Cycl.
_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
Cycl.
CPU fills
OutputMTU
with the next
sequence of the
transmit array
If OutputMTU
is enabled:
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 at the end of the
receive array
(increase InputSequenceAck
to end correctly)
If counter
InputSequence
is increased:
Module adds the transmit buffer
to the internal array
If successful:
InputSequenceAck is
adapted to the
transmit counter
If counter OutputSequence
is increased:
InputMTU is
adapted cyclically to the
receive buffer
via X2X
Figure 44: 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.
If the array has been completely created, the transmitter checks whether the MTU is permitted to be refilled. It then
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 transfer is successful, the data in the receive array will correspond 100% to the data in the transmit array.
During the transfer, 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 transferred.