Overview

The expanded ADS function blocks make it possible to create a client-server communication between an ADS device and a PLC task. The ADS device can be, for example, a Windows application (uses the AdsDLL/AdsOcx) or another PLC runtime system. Communication between the ADS device and the PLC task is processed using the following service primitives:

The communication between an ADS device and a PLC task has the following sequence: an ADS device sends a request to the target device (PLC task). This request is registered in the target device by an indication. The target device (PLC task) then carries out a corresponding service. The service to be carried out is encrypted via the index-group/offset parameter. Next the PLC task sends a response to the ADS device. The response is registered as confirmation by the ADS source device.

The ADS devices are addressed via a port address and a network address (NETID). (Port address of the PLC task = _TaskInfo.AdsPort)

In order for a request to be routed to the PLC task, the most significant bit (e.g. 0x80000001) must be entered in the index group parameter when the request is made.

Communication via IndexGroup 0x80000000 - 0x80FFFFFF

Only one instance of the indication and response function block can be used per PLC task (one instance of ADSREADIND, ADSREADRES, ADSWRITEIND, ADSWRITERES, ADSRDWRTIND and ADSRDWRTRES). Corresponding with the available ADS services: READ, WRITE and READ & WRITE there is an appropriate indication or response function block for each service.

Service

Name

Description

READ

ADSREADIND

ADSREAD Indication

ADSREADRES

ADSREAD Response

WRITE

ADSWRITEIND

ADSWRITE Indication

ADSWRITERES

ADSWRITE Response

READ & WRITE

ADSRDWRTIND

ADS-READ & WRITE Indication

ADSRDWRTRES

ADS-READ & WRITE Response

Overview 1:

FiFos

Each PLC task has 3 FIFOS in which the incoming requests (indications) are first stored. This means that there is an ADSREADIND FIFO, an ADSWRITEIND FIFO and an ADSRDWRTIND FIFO.
In each FIFO a maximum of 10 indications can be stored, until these were processed (until Response was sent). If, for example, 12 ADSREAD requests are sent to a PLC task simultaneously, 10 requests are stored in the FIFO as indications and two are acknowledged (discarded) with ADS error message 1814 (0x716). In this case, the error code should be analyzed and the two failed ADSREAD requests repeated if necessary. The indications are retrieved individually from the associated FIFO by calling the ADSxxxxxxIND instance. Only then can new indications be stored successfully in the FIFO.

Communication via IndexGroup 0x8n000000 - 0x8nFFFFFF

To realize more than one client-server communication per PLC task, the following Indication function blocks are required. These are extended by the possibility to specify a desired range of the IndexGroup.

This way, requests are filtered and only desired areas are responded to.

There are 16 freely selectable ranges available:
0x80000000 - 0x80FFFFFF
0x81000000 - 0x81FFFFFF

0x8E000000 – 0x8EFFFFFF
0x8F000000 – 0x8FFFFFFF

To specify such a range of the index group at an Indication function block, the index group value with which the selected range begins is specified at input MINIDXGRP.
Example: With MINIDXGRP:=16#85000000 all requests are filtered and requests with an index group in the range 0x85000000 - 0x85FFFFFF are registered as Indication.

Service

Name

Description

READ

ADSREADINDEX

ADSREAD Indication with indication of the index group

ADSREADRES

ADSREAD Response

WRITE

ADSWRITEINDEX

ADSWRITE Indication with indication of the index group

ADSWRITERES

ADSWRITE Response

READ & WRITE

ADSRDWRTINDEX

ADS-READ & WRITE Indication with indication of the index group

ADSRDWRTRES

ADS-READ & WRITE Response