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
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 |
Designation | Values | Description |
---|---|---|
nRW | 0 – READ | read- or write-access |
nNr | normally „0“dec | it is possible to put multiple ARs (application releations) to one device (Controller, Supervisor, DeviceAccess). |
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: WRITE if nRW = 1: |
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 |
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!