ADSREADRES

ADSREADRES 1:

The ADSREADRES function block acknowledges Indications of a PLC task. A response is sent to the ADS source device via a positive edge on the RESPOND input. The source device is addressed via the PORT and NETID parameters. The INVOKEID parameter is used by the source device to assign the responses to the requests and is adopted by the output of the ADSREADIND function block. An error code can be returned to the ADS source device via the RESULT parameter.

ADSREADRES 2: Inputs

VAR_INPUT
    NETID     : T_AmsNetId;
    PORT      : T_AmsPort;
    INVOKEID  : UDINT;
    RESULT    : UDINT;
    LEN       : UDINT;
    DATAADDR  : PVOID;
    RESPOND   : BOOL;
END_VAR

Name

Type

Description

NETID

T_AmsNetId

String containing the AMS network ID of the source device, to which the ADS command is to be sent (type: T_AmsNetId).

PORT

T_AmsPort

Port number of the ADS source device to which the response should be sent (type: T_AmsPort).

INVOKEID

UDINT

Handle of the command, which was sent. The InvokeID is specified from the source device and serves to identify the commands.

RESULT

UDINT

ADS error code or command-specific error code to be sent to the source device.

LEN

UDINT

Number of data to be read in bytes.

DATAADDR

PVOID

Address of the data buffer, which should be read.

RESPOND

BOOL

The function block is activated by a positive edge at this input.

ADSREADRES 3: Outputs

VAR_OUTPUT
(*none*)
END_VAR

Example of calling the block in ST:

Requirements

Development environment

Target system type

PLC libraries to include (Category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (System)