F_BA_MemSetEx

F_BA_MemSetEx 1:

The function F_BA_MetSetEx of return type UDINT fills the address range starting with pDestAddr and length nDestSize with the value of a variable xValue of any type.

The prerequisite for this is that the defined filling area is larger by an integer multiple than the filling variable xValue itself: nDestSize = n * xValue.diSize.

The function return value itself is assigned the result of the internal MEMCPY function, i.e. "0" for incorrect copying and values greater than "0" for the number of bytes copied.

The value "0" is also returned if the defined filling area is not larger than the filling variable xValue by an integer multiple, and filling has not taken place.

Syntax

FUNCTION F_BA_MemSetEx : UDINT
VAR_INPUT
  pDestAddr    : PVOID;
  nDestSize    : UDINT;
  xValue       : ANY;
END_VAR

F_BA_MemSetEx 2: Inputs

Name

Type

Description

pDestAddr

PVOID

Destination address of the filling area.

nDestSize

UDINT

Size of the filling area.

xValue

ANY

Filling value

Requirements

Development environment

Required PLC library

TwinCAT 3.1 4024.35

Tc3_BA2_Common from V2.1.20.0