FB_sACN_UDP_Communicator

The FB_sACN_UDP_Communicator continuously tracks active sACN receivers and sources and manages a shared UDP socket for sACN traffic.
- Socket management: Automatically opens the UDP socket when at least one receiver or source is enabled and closes it when all are disabled. If opening fails, reconnection attempts are scheduled.
- Multicast group control: For sACN receivers (implementing I_sAcnReceiver), joins and leaves multicast groups based on the receivers internal state (e.g., a waiting-to-add/waiting-to-drop flag).
- Packet reception: Continuously listens for UDP packets. A packet is treated as sACN only if the ACN Packet Identifier "ASC-E1.17" and the relevant root/framing vectors match. Valid sACN packets (Data, Synchronization, Universe Discovery) are dispatched to the matching I_sAcnReceiver by universe.
- Source notification: When the socket is ready, notifies sACN sources (implementing I_sAcnSource) that are waiting to transmit, passing the socket handle.
- Logging: Records key events and errors related to adapter status, socket operations, and multicast group management.

Inputs
|
Name |
Type |
Description |
|---|---|---|
|
NetworkAdapterNum |
USINT |
Selects the network adapter index to use for communication. |
|
ReconnectTime |
TIME |
Delay before attempting to reopen the socket after a failure. |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
BindedToNetworkAdapter |
BOOL |
Indicates whether the function block is currently bound to the selected network adapter. |
|
BindedAdapterInfo |
ST_IPAdapterInfo |
Information about the network adapter the function block is bound to. |