ArtNet

FB_ArtNetSend

This function block sends Art-Net telegrams via UDP.

VAR_INPUT

   bExecute                  : BOOL;
   bArtPoll                  : BOOL;
   bArtPollReply             : BOOL;
   stPollReplyParameter      : ST_PollReplyParameter;
   sSrvNetId                 : T_AmsNetId,
   sLocalHost                : T_IPv4Addr;
   nLocalPort                : UDINT;
   sRemoteHost               : T_IPv4Addr;
   sDirectedBroadcastAddress : T_IPv4Addr;
   nRemotePort               : UDINT;
   tCycleTimeTransmit        : TIME;
   tTimeout                  : TIME;
   stDmxData                 : ST_DmxArtNetData;

 

bExecute: The block starts processing if a positive edge is encountered at this input. A negative edge terminates processing.

bArtPoll: A one-off 'ArtPoll' telegram is sent via a positive edge at this input.
All Art-Net™ devices (including the sender) then respond with an 'ArtPollReply' telegram.

bArtPollReply: A one-off 'ArtPollReply' telegram is sent via a positive edge at this input.

stPollReplyParameter: This structure provides information for other Art-Net™ devices.

sSrvNetId: String containing the network address of the TwinCAT TCP/IP Connection Server. For the local computer (default) an empty string may be specified.

sLocalHost: The local IP address (IPv4) of the UDP client/server socket as a string (e.g. '2.168.0.5'). An empty string may be specified for the default network adapter.

nLocalPort: The local IP port number of the UDP client/server socket (e.g. 6454).

sRemoteHost: The remote IP address (IPv4) of the UDP client/server socket as a string (e.g. '2.17.54.239').

sDirectedBroadcastAddress: The IP address (IPv4) for 'directed broadcasts' as a string (e.g. '2.255.255.255').
This address is used in 'broadcast' mode, and also for sending 'ArtPoll' and 'ArtPollReply' telegrams.

nRemotePort: The remote IP port number of the UDP client/server socket (e.g. 6454).

tCycleTimeTransmit: Determines the cycle in which the telegrams are sent (e.g. t#20ms).

tTimeout: States the length of the timeout that may not be exceeded during execution of the command.

stDmxData: This structure contains the data to be sent.

 

VAR_OUTPUT

   bBusy                     : BOOL;
   bError                    : BOOL;
   nErrorID                  : UDINT;
   stFrameCounterErrorID     : ST_FrameCounter;

 

bBusy: When the function block is activated this output is set. It remains set until a feedback is received.

bError: In the event of an error during the command transfer, this output is set once the bBusy output has been reset.

nErrorID: Returns the error code of the last executed step, if the bError output is set.
See Error codes.

stFrameCounter: Structure with information about the number of sent 'ArtPoll', 'ArtPollReply' and 'ArtDmx' telegrams.

 

VAR_IN_OUT

   hSocket                   : T_HSOCKET;

 

hSocket: Input/output variable with the handle of an opened UDP socket. If the transfer takes place at input 0, the system tries to create a new socket.
If successful, a new socket is opened, and hSocket provides the associated socket handle.