Acyclic data

The ADS blocks are used to send acyclic data. These then access the PROFINET record data. So that acyclic data can be read or written, the PROFINET device must be in data exchange mode.

An ADSReadWrite is set.

ADS settings

AMSNetID: The AMSNetID of the PROFINET controller

PORT: Port number of the device (take this from the system manager)

Index GROUP: 0x0000_F823

Index OFFSET: 0x0000_0000

DATA

typedef struct {

       WORD            RW;

               #define         PN_READ         0

               #define         PN_WRITE        1

       WORD            NrOfAR;

       DWORD           API;

       WORD            Slot;

       WORD            SubSlot;

       PNIO_RECORD     RecordData;

} PNIO_CONFIGRECORD

Structure of the record data frame

nRW

nNr

nAPI

nSlot

nSubSlot

nIndex

nLen

nTrans

nReserved

Data (only write)

2 bytes

2 bytes

4 bytes

2 bytes

2 bytes

2 bytes

2 bytes

2 bytes

2 bytes

n bytes

Meaning of data from the record data frame

Designation

Values

Description

nRW

0 – READ
1 - WRITE

read- or write-access

nNr

normally „0“dec

it is possible to put multiple ARs (application releations) to one device (Controller, Supervisor, DeviceAccess).
This indicates in which AR the data is exchanged -> normally there is only one AR, in this case zero.

nAPI

normally „0“dec

-> otherwise, the corresponding application profile should be placed here

nSlot

variable

Slot number

nSubSlot

variable

SubSlot number

nIndex

variable

Index number

nLen

variable

READ if nRW = 0:
if the value „0“ is used when reading, the request is sent with the maximum buffer size, if nLen ≠ 0, the corresponding length is used.

WRITE if nRW = 1:
when writing: number of bytes, which follow from or after the “nReserved” word

nTrans

starts with „1“dec

If multiple records are downloaded at once, this transfer sequence number determines the order in which the data is processed.

nReserved

„0“dec

2 byte alignment

Data

variable

Data
(from here the „nLen“ for the data length counts (writing only))

Sample:

Send a read request for I&M function 0

nRW

nNr

nAPI

InSlot

SubSlot

nIndex

nLen

nTrans

nReserved

00 00

00 00

00 00 00 00

00 00

01 00

F0 AF

00 00

01 00

00 00

Make sure that the receive data memory is large enough!