X90 mobile modules
204
X90 mobile system User's manual V 1.20 - Translation of the original manual
Flatstream operation
When using Flatstream, the communication direction is very important. For transmitting data to a module (output
direction), Tx bytes are used. For receiving data from a module (input direction), Rx bytes are used.
Registers "OutputSequence" and "InputSequence" 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.
Format of input and output bytes
Name:
"Format of Flatstream" in Automation Studio
On some modules, this function can be used to set how the Flatstream input and output bytes (Tx or Rx bytes)
are transferred.
•
Packed:
Data is transferred as an array.
•
Byte-by-byte:
Data is transferred as individual bytes.
Transport of payload data and control bytes
Name:
TxByte1 to TxByteN
RxByte1 to RxByteN
(The value the number N is different depending on the bus controller model used.)
The Tx and Rx bytes are cyclic registers used to transport the payload data and the necessary control bytes.
The number of active Tx and Rx bytes is taken from the configuration of registers
"OutputMTU"
and
"InputMTU"
,
respectively.
In the user program, only the Tx and 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, the names were chosen from the point
of view of the CPU.
•
"T" - "Transmit" →CPU
transmits
data to the module.
•
"R" - "Receive" →CPU
receives
data from the module.
Data type
Values
USINT
0 to 255
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
Description
Value
Information
0 - 5
SegmentLength
0 - 63
Size of the subsequent segment in bytes (default: Max. MTU size - 1)
0
Next control byte at the beginning of the next MTU
6
nextCBPos
1
Next control byte directly after the end of the current segment
0
Message continues after the subsequent segment
7
MessageEndBit
1
Message ended by the subsequent segment
SegmentLength
The segment length lets the receiver know the length of the coming segment. If the set 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 option "MultiSegmentMTU".
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 transferred directly after the current segment.