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.

function block ASR_PORT_STATE_AXLBK

 

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

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

xActivate

BOOL

Input

With TRUE, the function block is activated, and reading of the port states is started.

FALSE deactivates the function block, and reading of the port states is stopped.

xQuit

BOOL

Input

With a rising edge at this input parameter, error messages that occurred during requesting the port states are acknowledged.

iScanTimeSP

INT

Input

Desired scanning cycle time in seconds.

xMRP_RingClosed

BOOL

Input

With TRUE the reading of the 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.

arrAR_DevList

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.

xActive

BOOL

Output

TRUE at this output parameter indicates that the initialization phase of the function block has been successfully terminated, and the function block is reading now the port states cyclically.

xError

BOOL

Output

This output indicates with a rising edge that an error has occurred. You can read the corresponding error codes at the wDiagCode and dwAddDiagCode output parameters during the cycle in which the rising edge occurs.

wDiagCode

WORD

Output

Indicates the cause of the error.

dwAddDiagCode

DWORD

Output

Indicates additional information to the cause of the error.

iScanTimeAV

INT

Output

Actual scanning cycle time in seconds.

arrPortInfo

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 arrAR_DevList input parameter.

For each PROFINET bus coupler the following values are available:

  • xDataValid:

    This element indicates whether the last reading of the port states from the bus coupler was successful (TRUE) or unsuccessful (FALSE).

    The following values are only valid, if this bit is TRUE.

  • xLinkPort1 and xLinkPort2:

    Link state of the port.

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 dwAddDiagCode output parameter indicates the error code of the conversion function (High Word) and the index of the relevant bus coupler (Low Word). The acknowledgement of this error is done by deactivating the function block.

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 dwAddDiagCode output parameter contains the DiagCode of the function block (High Word) and the index of the relevant bus coupler (Low Word).

The acknowledgement of this error message is carried out at a rising edge of the xQuit input parameter.

C403

Time-out detection of the internal state machine (5 s).

The dwAddDiagCode output parameter indicates the step of the internal state machine (High Word) and the index of the relevant bus coupler (Low Word) at which this error has occurred. The acknowledgement of this error message is carried out at a rising edge of the xQuit input parameter.

 

 


• Published/reviewed: 2024-10-30   ☀  Revision 074 •