ADSWRITEIND

ADSWRITEIND 1:

The function block registers ADSWRITE Requests to a PLC task as Indications and allows them to be processed. The queuing of an Indication is reported at the VALID output port by means of a rising edge. The Indication is reported as processed via a positive edge at the CLEAR input. A falling edge releases the function block for the processing of further indications. After an Indication has been processed a response must be sent to the source device via the ADSWRITERES function block. The PORT and NETID parameters can be used to address the source device for this purpose. The INVOKEID parameter is used by the source device to assign the responses to the requests and is also sent back to the source device as a parameter.

ADSWRITEIND 2: Inputs

VAR_INPUT
    CLEAR : BOOL;
END_VAR

Name

Typ

Beschreibung

CLEAR

BOOL

With a rising edge at this input an indication is reported as processed and the outputs of the ADSWRITEIND function block are reset ( DATAADDR = 0, LENGTH = 0 !). A falling edge releases the function block for the processing of further indications.

ADSWRITEIND 3: Outputs

VAR_OUTPUT
    VALID     : BOOL;
    NETID     : T_AmsNetId;
    PORT      : T_AmsPort;
    INVOKEID  : UDINT;
    IDXGRP    : UDINT;
    IDXOFFS   : UDINT;
    LENGTH    : UDINT;
    DATAADDR  : PVOID;
END_VAR

Name

Type

Description

VALID

BOOL

The output is set if an Indication was registered from the function block and remains set until the latter was reported as processed by a positive edge at the CLEAR input.

NETID

T_AmsNetId

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

PORT

T_AmsPort

Contains the port number of the ADS source device, from which the ADS command was 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.

IDXGRP

UDINT

Index group number (32-bit, unsigned) of the requested ADS service.

IDXOFFS

UDINT

Index offset number (32-bit, unsigned) of the requested ADS service.

LENGTH

UDINT

Length of the written data in bytes.

DATAADDR

PVOID

Address of the data buffer in which the written data is located.

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)