MasterUDP

MasterUDP (FB)

FUNCTION_BLOCK MasterUDP IMPLEMENTS IKnxConnector

Overview

The MasterUDP function block serves as a KNX driver for communication with a KNX Net/IP gateway. It processes telegrams and coordinates communication with slave function blocks.

Inputs

Inputs
Initial value
Description

xEnable

TRUE

Enable/disable the function block

sIPAddressKNXInterface

''

IP address of the KNX interface

uiPortKNXInterface

gc_LibPara.gc_uiPort

Port number of the KNX interface

itfNetworkInterface

-

Network interface for communication

uiPortPLC

gc_LibPara.gc_uiPortLocal

Port number of the PLC

xResError

FALSE

Error reset flag

tResponseTimeout

gc_LibPara.gc_tResponseTimeout

Timeout duration for requests

Outputs

  • xConnected (BOOL): Connection status

  • itfKnxConnector (IKnxConnector): Interface for slave blocks

  • udiConnectedSlaves (UDINT): Number of connected modules

  • eStatus (KnxStatus): Current KNX connection status

  • stDeviceInfo (DeviceInfo): Device information

  • stKnxData (KnxData): KNX data structure

  • bChannel (BYTE): Communication channel identifier

  • eError (ErrorKnx): Current error status

  • eLastError (ErrorKnx): Last error

Usage

  1. Configure the KNX interface with sIPAddressKNXInterface and uiPortKNXInterface.

  2. Set uiPortPLC according to your PLC configuration.

  3. Enable the block with xEnable = TRUE.

  4. Monitor xConnected for the connection status.

  5. Use itfKnxConnector to interact with slave function blocks.

  6. Check eStatus and eError regularly.

  7. Use xResError to reset error states.

Notes

  • Ensure correct network settings (itfNetworkInterface) are set.

  • Adjust tResponseTimeout adjust for network latency if needed.

InOut:

Scope
Name
Type
Initial
Comment

Input

xEnable

BOOL

TRUE

On/Off

Input

sIPAddressKNXInterface

STRING

‘’

IP of the peer e.g. IP/Knx

Input

uiPortKNXInterface

UINT

gc_LibPara.gc_uiPort

Port of the peer e.g. KNX GW

Input

itfNetworkInterface

IIoDrvEthernet.INetworkInterface

Input

uiPortPLC

UINT

gc_LibPara.gc_uiPortLocal

Port of the controller

Input

xResError

BOOL

FALSE

Error reset

Input Const

tResponseTimeout

TIME

gc_LibPara.gc_tResponseTimeout

Timeout time for request

Output

xConnected

BOOL

Output

itfKnxConnector

IKnxConnector

THIS^

IF for comm. module FBs

Output

udiConnectedSlaves

UDINT

Number of modules

Output

eStatus

KnxStatus

Output

stDeviceInfo

DeviceInfo

Output

stKnxData

KnxData

Output

bChannel

BYTE

Output

eError

ErrorKnx

Output

eLastError

ErrorKnx

Last updated