F_CheckSum16

F_CheckSum16 1:

The function "F_CheckSum16" can be used to determine a 16-bit checksum for any data.

FUNCTION F_CheckSum16: WORD

VAR_INPUT

VAR_INPUT
    dwSrcAddr  : POINTER TO BYTE;
    cbLen      : UDINT;
    wChkSum    : WORD;
END_VAR

dwSrcAddr: Address of the data buffer.

cbLen: Length of the data buffer.

wChkSum: Initial value = 0 or last checksum.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_Utilities (System)