
Appendix: Flow Charts Showing the Operation of the Device
Flow chart: Command processing with fragmentation
238
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | [email protected] | www.turck.com
15.3
Flow chart: Command processing with fragmentation
busy
Start
in.responseCode < 0
in.readFragmentNo <> 0
out.readFragmentNo == in.readFragmentNo
in.responseCode < 0x4000
yes
yes
no
no
no
yes
in.loopCount <> 0
or
in.responseCode <> 0
idle:
out.loopCount := 0
out.commandCode := 0
out.writeFragmentNo := 0
out.readFragmentNo := 0
initiate command and send 1st fragment:
out.loopCount = out.lo1
out.commandCode := [0x0001…0x3FFF]
out.length = length of writedata
out.writeFragmentNo := 1
out.writeData := part 1
send next fragment:
out.writeFragmentNo := out.writeFra1
out.writeData := part 2…(n-1)
send last fragment:
out.writeFragmentNo := 0
out.readFragmentNo := 0
out.writeData := part n
in.errorCode = 0x0000
in.lengst = length of read data
in.readData = part 1
error
in.errorCode = [0x0001…0xffff ]
acknowledge 1st fragment
out.readFragmentNo := in.readFragmentNo
in.readData = part 2…(n)
acknowledge next fragment
out.readFragmentNo := in.readFragmentNo
done
in.write FragmentNo <> out.writeFragmentNo
in.writeFragmentNo <> out.writeFragmentNo
more than one fragment left
new command desired?
Fig. 134: Flow chart for command processing with fragmentation