ADSREADINDEX
The function block registers ADSREAD Requests at 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 negative edge at the CLEAR input releases the function block for processing further Indications. After an Indication has been processed a response must be sent to the source device via the ADSREADRES 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.
Compared to the function block ADSREADIND there is the possibility to specify a desired range of the IndexGroup via an additional input.
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.
Inputs
VAR_INPUT
CLEAR : BOOL;
MINIDXGRP : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
CLEAR | BOOL | With a rising edge at this input an Indication is reported as processed and the outputs of the ADSREADIND function block are reset. A falling edge releases the function block for the processing of further indications. |
MINIDXGRP | UDINT | This input allows filtering the requests by IndexGroup ranges. Specification of the IndexGroup value with which the selected range begins. |
Outputs
VAR_OUTPUT
VALID : BOOL;
NETID : T_AmsNetId;
PORT : T_AmsPort;
INVOKEID : UDINT;
IDXGRP : UDINT;
IDXOFFS : UDINT;
LENGTH : UDINT;
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 | Number of data to be read in bytes. |
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4024.35 | PC or CX (x86, x64, ARM) | Tc2_System (system) >= 3.4.26.0 |