ProfinetDeviceInstance (FB)

FUNCTION_BLOCK ProfinetDeviceInstance

An instance of this function block represents a Profinet field device.
The internal protocol stack has to be configured with DeviceIdentification and module configuration (method ConfigureDevice() or ReconfigureModules()).
For operation, a cyclic call of methods ReceiveData() and SendData() is required. Additionally acyclic service requests have to be processed by cyclic call of method ProcessServices().
A sample project can be found on CODESYS forge.
InOut:

Scope

Name

Type

Initial

Comment

Output

DeviceID

DWORD

CommFB.Constants.INVALID_ID

Device ID for usage in Profinet service function blocks (e.g. ProfinetCommon.DeviceAR, ProfinetCommon.SubmoduleIterator, CommFB.SUBSLOT_ID …)

interfaceName

WSTRING(255)

Configured name of ethernet interface

deviceIdent

DeviceIdentification

Configured identification data

xInit

BOOL

Function block is initialized with all required paramters (methods ConfigureDevice() and ConfigureModules()

xStartup

BOOL

Protocol stack is in startup phase

xOnline

BOOL

Profinet device is online

IPActive

BOOL

IP Stack is operating (valid IP-Address assigned)

xError

BOOL

Any error occured (Details see output DeviceStatus)

DeviceStatus

Profinet.DeviceState

Profinet.DeviceState.NotInit

Current Status of the Device.

StationName

STRING(240)

Currently active Stationname

IPParameter

ProfinetCommon.IPParameterValue

Currently active IP-Address

NumPorts

DINT

Number of configured / active ethernet ports (for this device instance)

PortStatus

ARRAY [0..7] OF PortStatus

Current status of Ethernet ports

EthernetStatistic

InterfaceEthernetStatistic

Ethernet Statistics