LGF_ReadPnInterfaceParameter (FB / V1.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

IdentifierData type Default value Description
executeBool FALSE Rising edge starts action once
hardwareIdHW_ANY --- Hardware ID of the Interface where the parameter should be read

Output parameter

IdentifierData type Description
doneBool TRUE: Commanded functionality has been completed successfully
busyBool TRUE: FB is not finished, new output values can be expected
errorBool TRUE: An error occurred during the execution of the FB
statusDWord 16#0000 - 16#7FFF: Status of the FB, 16#8000 - 16#FFFF: Error identification
addressIP_V4 IP Address from interface
subnetMaskIP_V4 Subnet mask from interface
standardGatewayIP_V4 Standard gateway address from interface
macAddressArray[0..5] of Byte MAC Address from interface
pnNameString Profinet name from interface

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_EXECUTION_FINISHED
Execution finished without errors
16#7000STATUS_NO_CALL
No job being currently processed
16#7001STATUS_FIRST_CALL
First call after incoming new job (rising edge 'execute')
16#7002STATUS_SUBSEQUENT_CALL
Subsequent call during active processing without further details
16#9000ERR_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 & DateChange description
01.00.00Siemens Online Support
2022-12-16First released version