X20 system modules • Analog input modules • X20AI2438
234
X20 system User's Manual 3.10
General flow chart:
Se
gm
en
t d
at
a
ha
nd
lin
g
Sy
nc
hr
on
iz
at
io
n
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
InputSyncAck = 1?
InputSequenceAck > 0?
InputSyncAck = 1
(InputSequenceCounter –
InputSequenceAck)
AND 0x07 = 1?
MTU_Offset = 0
RemainingSegmentSize = 0?
►
DataSize = InputMTU_Size – MTU_Offset
RemainingSegmentSize >
(InputMTU_Size – MTU_Offset)?
►
DataSize = RemainingSegmentSize
RemainingSegmentSize = 0 AND
(SegmentFlags AND 0x40) = 0?
InputMTU_Size = MTU_Offset?
RemainingSegmentSize = 0 AND
(SegmentFlags AND 0x80) = 0?
► InputSequenceAck =
InputSequenceCounter
►
Mark frame as complete
InputSyncBit = 1?
Start
►
►
►
InputSequenceAck = InputSequenceCounter
RemainingSegmentSize = 0
SegmentFlags = 0
►
►
►
RemainingSegmentSize =
MTU_Data[MTU_Offset] AND 0b0011 1111
SegmentFlags =
MTU_Data[MTU_Offset] AND 0b1100 0000
MTU_Offset = MTU_ 1
►
►
►
copy segment data e.g. memcpy(xxx, ADR(MTU_Data[MTU_Offset]), DataSize)
MTU_Offset = MTU_ DataSize
RemainingSegmentSize = RemainingSegmentSize - DataSize
Figure 80: Flow chart for the input direction