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

STRNCPY 2: Return value

Name

Type

Description

STRNCPY

BOOL

Copies the string of a variable of the data type STRING and checks whether the string was completely copied.

STRNCPY 3: Inputs

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

Name

Type

Description

pDst

POINTER TO STRING

Pointer to the copied STRING variable (input string)

pSrc

POINTER TO STRING

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

nDstSize

UDINT

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

STRNCPY 4: Outputs

VAR_OUTPUT
    nSrcLen  : UDINT;
    nDstLen  : UDINT;
END_VAR

Name

Type

Description

nSrcLen

UDINT

Length of the specified STRING variable to be copied

nDstLen

UDINT

Length of the copied WSTRING variables

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