AddWriteByteArray

Adds a write command to the request in an optimized manner if several data points located consecutively in the memory of the S7 Controller are to be written.

Syntax

METHOD AddReadVar   : HRESULT
VAR_INPUT
    pVar            : PVOID;
    nByteSize       : WORD;
    nByteOff        : WORD;
    nArea           : E_S7COMM_DATAAREA;
    nDatablock      : WORD;
END_VAR

AddWriteByteArray 1: Return value

Name

Data type

Description

AddReadVar

HRESULT

E_HRESULTAdsErr.NOTINIT = Function block has not been initialized correctly.

E_HRESULTAdsErr.BUSY = Request is active

E_HRESULTAdsErr.INVALIDDATA = A transfer parameter has been defined incorrectly

E_HRESULTAdsErr.INVALIDSIZE = The frame length is greater than the PDU length

AddWriteByteArray 2: Inputs

Name

Data type

Description

pVar

PVOID

Address of the target variables in the TwinCAT PLC

nByteSize

WORD

Byte length of the data type to be read from the S7 Controller

nByteOff

WORD

Byte offset in the S7 Controller

nArea

E_S7COMM_DATAAREA

S7 data area

nDatablock

WORD

ID of the data block. Is only sent if E_S7COMM_DATAAREA.DATA_BLOCKS is used as the data area.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64)

Tc3_S7Comm (Communication)