NBS.UDP_Peer (FB)

This function block of the CAA_NetBaseServices.library activates a Peer by setting xEnable to TRUE. As long as xActive is TRUE the handle of the connection hPeer is valid. Is xActive FALSE the handle is invalid. The handle hPeer can be used as input hPeer at function blocks NBS.UDP_Send, NBS.UDP_SendBuffer, NBS.UDP_Receive and NBS.UDP_ReceiveBuffer. ipAddr and uiPort indicate the ip and port to establish the connection.

Input:

xEnable

BOOL

see: “CAA 指南”

ipAddr

NBS.IP_ADDR

The ip address to establish a connection

uiPort

UINT

The port to establish a connection

ipMultiCast

IP_ADDR

Multicast address. '255.255.255.255' => INADDR_NONE

Output:

xDone

BOOL

see: “CAA 指南”

xBusy

BOOL

see: “CAA 指南”

xError

BOOL

see: “CAA 指南”

eError

NBS.ERROR

Error id

xActive

BOOL

TRUE: Handle valid

FALSE: Handle invalid

hPeer

CAA.HANDLE

Handle of Peer