Arithmetic instructions
84
Part II IEC Instructions
CRC16
Cyclic Redundancy Check
Depending on the PLC type, one of the following two implementations of the function will be used:
PLCs which support the instruction F70_BCC (see page 411) with the parameter
s1=10 to calculate CRC16 (FP-e, FP-Sigma, FP2, FP2SH, FP10S
H) use
F70_BCC (see page 411) directly.
For the other PLCs (FP0, F
P0R, FP3, FP5, FP10), a sub-program making an
explicit CRC16 calculation is called. The following restrictions apply to this
sub-program:
During the first eight execution scans an internal table is built. During this time, no
check sum is calculated, and the output IsValid remains FALSE. Starting with the fifth
scan, the check sum is calculated, and the output IsValid is set to TRUE.
StartAddress requires an address in the DT or FL area.
The number of steps can increase up to approx. 200 when CRC16 is used as
a sub-program.
When programming, please be aware that a certain amount of time is
needed to build the internal table and to calculate the check sum, especially
for large data volumes.
PLC types
Availability of CRC16 (see page 1318)
Description
This function calculates the CRC16 (Cyclic Redundancy Check) for all PLC types by using 8 bytes
(8 bits) specified with the parameter NumberOfBytes and the starting address StartAddress.