Example

 

This sample contains a PLC program for TwinCAT 3 that presents general sending and receiving of sACN frames. In any use case the user data of the sACN frame can be linked with any PLC variables. This allows a very flexible use of this example. Users can create their own programs based on their needs. The individual function blocks of the example are explained in the Programming section.

For example, a state machine can be used to realize a logic, where listening in the receiving method is basically used and followed by the sending method on a special event or timer. Alternatively, if the sending method and receiving method should be triggered at the same time, two instances could be declared: One instance for sending and the other for receiving.

There is in addition a TwinCAT 2 sample available which support only the sACN version 2009.

Both sACN versions “sACN 2009” and “sACN 2016” are implemented in this TwinCAT 3 example. So that users who want to use the “sACN 2009” version on the TwinCAT 3 platform can do this. The main idea of this sample is to be used for sACN applications using version sACN 2016, nevertheless the online switching of both sACN versions is demonstrated in this sample. It is possible to switch online between these two sACN versions with the help of instantiating the interface “isACN” and triggering the variable “bSwitch”.

 

Example 1: