# LGF_ReadPnInterfaceParameter (FB / 1.0.0)

Overview

Author: Siemens Industry Support

## Short description

The function block provides Interface parameter like the IP Address settings, MAC Address and the PN Name.

### Block Interface

| LGF_ReadPnInterfaceParameter (FB) |
--- | --- | ---
Bool |  |  | execute |  | done |  |  | Bool
HW_ANY |  |  | hardwareId |  | busy |  |  | Bool
|  |  |  |  | error |  |  | Bool
|  |  |  |  | status |  |  | DWord
|  |  |  |  | address |  |  | IP_V4
|  |  |  |  | subnetMask |  |  | IP_V4
|  |  |  |  | standardGateway |  |  | IP_V4
|  |  |  |  | macAddress |  |  | Array[0..5] of Byte
|  |  |  |  | pnName |  |  | String

### Input parameter

Identifier | Data type | Default value | Description
--- | --- | --- | ---
execute | Bool | FALSE | Rising edge starts action once
hardwareId | HW_ANY | --- | Hardware ID of the Interface where the parameter should be read

### Output parameter

Identifier | Data type | Description
--- | --- | ---
done | Bool | TRUE: Commanded functionality has been completed successfully
busy | Bool | TRUE: FB is not finished, new output values can be expected
error | Bool | TRUE: An error occurred during the execution of the FB
status | DWord | 16#0000 - 16#7FFF: Status of the FB, 16#8000 - 16#FFFF: Error identification
address | IP_V4 | IP Address from interface
subnetMask | IP_V4 | Subnet mask from interface
standardGateway | IP_V4 | Standard gateway address from interface
macAddress | Array[0..5] of Byte | MAC Address from interface
pnName | String | Profinet name from interface

### Status & Error codes

Code / Value | Identifier / Description
--- | ---
16#0000 | STATUS_EXECUTION_FINISHED Execution finished without errors
16#7000 | STATUS_NO_CALL No job being currently processed
16#7001 | STATUS_FIRST_CALL First call after incoming new job (rising edge 'execute')
16#7002 | STATUS_SUBSEQUENT_CALL Subsequent call during active processing without further details
16#9000 | ERR_UNDEFINED_STATE Error: due to an undefined state in state machine

## Functional description

The function reads the Interface settings / parameters using the system function `RDREC` (Read data record).

To read the MAC and IP address of the interface provided via it's hardware ID, it is mandatory to read the `PD_INTERFACE_DATA_REAL` data record of any PROFINET compliant interface.

Note
  Upon TIA Portal V17, it’s possible to use as well the system function `CommConfig`, which is in the `Instructions / Communication / Open user communication (Version >= V8.1)` located.

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Siemens Online Support
| 2022-12-16 | First released version