Function block for gathering port states from Axioline F PROFINET bus couplers
Available with AXC F 2152 and AXC F 3152
General concept
By the means of this function block the port states from PROFINET bus couplers of the type AXL F BK PN TPS can be read directly by the PLC via PROFINET acyclic services.
The PROFINET IO device names of the bus couplers must be applied to the arrAR_DevList
input parameter. This input parameter is an array of string with 50 elements, so that a maximum number of 50 PROFINET IO device names can be used.
xActivate
A TRUE
at the xActivate
input parameter activates the function block. After the activation the function block starts with the initialization phase. During this initialization phase the applied PROFINET IO device names are converted into unique IDs by the means of special PROFINET function blocks. This process can take several seconds. The successful termination of the initialization phase is indicated with a TRUE
at the xActive
output parameter. As soon as this output parameter is set to TRUE
, the function block requests cyclically the port states from the specified bus couplers. A FALSE
at the xActivate
input parameter deactivates the function block and requesting of the port states is stopped.
xError
The appearance of an error is indicated by the xError
output parameter. The wDiagCode
and dwAddDiagCode
output parameters display the cause of the error. The values are valid within the cycle in which the rising edge of the xError
output parameter occurred. The acknowledgment of an error message which occurred during requesting the port states (xActive
output parameter is TRUE
) is carried out by a rising edge of the xQuit
input parameter. The acknowledgment of an error message during the initialization phase of the function block (xActive
output parameter is FALSE
) is only possible by deactivating the function block.
xMRP_RingClosed
If the bus couplers are integrated into an MRP network ring structure and a signal is available indicating that the ring structure is closed, reading of the port states can be skipped by setting the xMRP_RingClosed
input parameter to TRUE
. As soon as this input parameter is set to TRUE
the reading of port states via PROFINET acyclic services is stopped and the values of the elements xLinkPort1
and xLinkPort2
for all bus couplers are set to TRUE
.
Prerequisites
From the PLCnext Store, download the ASR AXC F 2152 or the ASR AXC F 3152 function block library (free of charge) and import it into PLCnext Engineer on your computer.
Description of inputs and outputs
Name |
Data type |
Data direction |
Description |
|
BOOL |
Input |
With
|
|
BOOL |
Input |
With a rising edge at this input parameter, error messages that occurred during requesting the port states are acknowledged. |
|
INT |
Input |
Desired scanning cycle time in seconds. |
|
BOOL |
Input |
With |
|
ASR_ARR_STRING_1_50 |
Input |
List of PROFINET IO device names of the bus couplers from which the port states should be collected. This input parameter is an Array of String with 50 elements, so that a maximum number of 50 PROFINET IO device names can be used. |
|
BOOL |
Output |
|
|
BOOL |
Output |
This output indicates with a rising edge that an error has occurred. You can read the corresponding error codes at the |
|
WORD |
Output |
Indicates the cause of the error. |
|
DWORD |
Output |
Indicates additional information to the cause of the error. |
|
INT |
Output |
Actual scanning cycle time in seconds. |
|
ASR_ARR_PORT_INFO |
Output |
Port states from the specified PROFINET bus couplers. This output parameter is an Array of Struct, in which each field contains the port states of a bus coupler corresponding to the PROFINET IO device names at the For each PROFINET bus coupler the following values are available:
|
Error Codes
Error Code |
Description |
C401 |
Indicates that an error occurred at the initialization phase during the conversion of the PROFINET IO device names into unique IDs. One possible reason for such an error could be that the appropriate PROFINET IO device name doesn’t exist in the bus configuration of the project. The |
C402 |
Indicates that the function block for reading the port states reported an error while a request was sent to a PROFINET bus coupler. The The acknowledgement of this error message is carried out at a rising edge of the |
C403 |
Time-out detection of the internal state machine (5 s). The |