Type
| Function block |
Description
| Reads the PDI objects of local Axioline modules.Reading is started in the cycle in which the rising edge is detected at the REQ input. The duration of the read operation depends, among other things, on the bus structure, the type of the object read, etc. Once the read operation is complete the NDR output is set to TRUE. The receive data saved in RD_1 is only valid and readable during the cycle in which NDR is TRUE.
In the event of an error, the ERROR output is set to TRUE. The corresponding error code can be read at the STATUS output. The error information saved in the STATUS array is only valid and readable during the cycle in which the ERROR output is set to TRUE. In the following cycle the ERROR output is set to FALSE. The user can now set the REQ input to FALSE to prepare the next read operation. In the following cycle the next read operation can be executed with a rising edge at the REQ input.If an invalid variable type or an array with an invalid length is applied to RD_1 or STATUS, the ERROR output is set to TRUE and, if possible, the corresponding error code is output at the STATUS output. In this case the ERROR output remains TRUE until the error has been eliminated. While ERROR = TRUE, the corresponding error code can be read at the STATUS output. |
Notes
| Function blocks have to be instantiated. The instance name of the function block has to be declared in the 'Variables' table of the POU where the FB is going to be used. The instance name must be unique within the POU.
Tip: Phoenix Contact provides function block libraries free of charge which simplify the handling of specific Axioline modules. You can download these libraries from the controller's web page ('Downloads' tab) under www.phoenixcontact.com. |
Parameters
| Inputs
REQ
Data type: | BOOL |
Description: | A rising edge at the REQ input starts reading the PDI object. The preparation of a new read operation is done with a falling edge at this input. |
SLOT
Data type: | WORD |
Description: | Specifies the slot of the Axioline module whose PDI object is to be read. |
SUBSLOT
Data type: | BYTE |
Description: | Specifies the subslot of the Axioline module whose PDI object is to be read. |
INDEX
Data type: | WORD |
Description: | Specifies the index of the PDI object to be read. |
SUBINDEX
Data type: | BYTE |
Description: | Specifies the subindex of the PDI object to be read. |
Input/Output
RD_1
Data type: | ARRAY OF BYTE / ARRAY OF WORD |
Description: | Represents the receive buffer of the function block. The array must be adequately dimensioned to be able to save the requested data. If the array is too small, a corresponding error is output at the ERROR output. |
STATUS
Data type: | ARRAY OF WORD[2] |
Description: | Provides the error code in the event of an error (see "Error codes" below). The Error_Code of the negative confirmation of the PDI read request (Error_Code and Add_Info) is used, or, in case of internal errors a code generated by the function block. Only valid for ERROR = TRUE. |
Outputs
DAT_CNT
Data type: | BYTE |
Description: | Indicates the number of received bytes in the RD_1 receive buffer. |
NDR
Data type: | BOOL |
Description: | A rising edge at the NDR (New Data Received) output signals that the PDI read operation has been completed successfully and that the received data in array RD_1 can be read. The output remains TRUE for only one cycle. Only in this cycle the data saved in the array RD_1 is valid. |
ERROR
Data type: | BOOL |
Description: | If an error occurs during the PDI read operation, the ERROR output is set to TRUE. The corresponding error code can be read at the STATUS output. The ERROR output remains TRUE for only one cycle. Only in this cycle the data saved in the STATUS array is valid. |
|
Error codes
| Error codes at the STATUS output
Only valid for ERROR = TRUE.
The following table shows the possible error codes caused by the function block itself and their meaning.
STATUS[0] | STATUS[1] | Meaning |
0x090B | 0x000C | The variable connected to RD_1 is not of the correct type (no array or invalid array type). |
0x090B | 0x000B | The array connected to RD_1 is too small to save the response received. |
0x090B | 0x000E | Timeout. No response to the sent PDI READ request received. |
0x090B | 0x000F | An internal error has occurred. |
0x090B | 0x0011 | Connection to the service manager or subscription to the service failed |
0x090B | 0x0013 | Too many function block instances for acyclic Axio services created. The sum of PDI_WRITE and PDI_READ function blocks must not be greater than 32. |
0x090B | 0x0014 | Connection to the driver could not be established. |
0x090B | 0x0015 | Failed to send the request to the driver |
0x090B | 0x0016 | Failed to receive the response from the driver. |
When receiving a negative confirmation as response to a PDI_READ request, the Axioline module directly copies the received error code (Error_Code and Add_Info) to STATUS[0] or STATUS[1]. These error codes are module-specific. For a description see the respective module documentation.
|