STRNCPY

STRNCPY 1:

The function copies the character string of a variable of the data type STRING and checks whether the character string was completely copied.

The function returns

FUNCTION STRNCPY : BOOL

VAR_INPUT

VAR_INPUT
    pDst     : POINTER TO STRING;
    pSrc     : POINTER TO STRING;
    nDstSize : UDINT;
END_VAR

pDst: Pointer to the copied STRING variable (input string)

pSrc: Pointer to the STRING variable to be copied (output string)

nDstSize: Size of the resulting STRING variable (output string) in bytes. The operator SIZEOF() can be used for the assignment.

VAR_OUTPUT

VAR_OUTPUT
    nSrcLen  : UDINT;
    nDstLen  : UDINT;
END_VAR

nSrcLen: Length of the specified STRING variable to be copied

nDstLen: Length of the copied WSTRING variable

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.4022

PC or CX (x86, x64, ARM)

Tc2_Utilities (System) >= 3.3.21.0