Beckhoff Knowledge Base: sACN |
This example contains a PLC program with a Target Visualization and an MA Lighting RPU showfile (Beckhoff_pl&s.show.gz). It supports sending and receiving of sACN frames via multicast groups from a Beckhoff PLC to an MA Lighting RPU.
The basic principle of the setup: Both devices (MA RPU and Beckhoff Controller) have an own IP address (it does not have to be the same IP class). To “connect” the devices, the TCP/IP Multicast function is used. Multicast groups use class D networks (224.0.0.0 to 239.255.255.255) per definition. In Multicast groups the slaves join to a group (FB_SocketUdpAddMulticastAddress); the master sends the data to all connected slaves by sending a telegram to the multicast group network address.
In this sample we use two logical connections:
Beckhoff to MA RPU (in orange) and MA RPU to Beckhoff (in blue)
The full set up of the sample looks like the following:
On the left side you see the Beckhoff Controller with PLC and Target Visu (including two buttons and a bar graph). On the right side you see the MA Lighting RPU with display. When the attached showfile is loaded to the device, you see two execute buttons on the display.
1. The communication from Beckhoff to MA RPU is shown in orange. The Beckhoff Controller is the master that sends to the Multicast address 239.255.0.1. The MA RPU joins this group (this is done automatically in the showfile). The Beckhoff Controller uses sACN frames with the Universe ID 2 and two channels of user data. The user data is used to change the value of the execute buttons at the MA RPU. The sequence of the necessary bits is generated in the PLC program by the Function Block FB_selector. The buttons of the Target Visu are used to control these sequences. The result: By changing the value from the buttons of the Target Visu on the Beckhoff Controller, the value of the execute buttons at the MA RPU is changed (a remote control of the MA RPU is possible).
2. The communication from MA RPU to Beckhoff is shown in blue. The MA RPU is the master that sends to the address 239.255.0.1. The Beckhoff Controller joins this group as a multicast slave. The MA RPU uses sACN frames with the Universe ID 1 and twelve channels of user data. The user data is used to run two different lighting scenarios. These sequences (scenarios) of data are generated by the MA RPU. The result: A change of the value from the execute buttons results in different output values for the sACN frames send by the MA RPU. The sACN values are displayed at the Target Visu in a bar graph.
A final test can be done by changing the value of the buttons in the Target Visu. The result should be changing data sequences in the bar graph of the Target Visu.
Comment: Both directions use the same multicast group! The differentiation from which communication partner the frame is coming is done by the sACN Universe ID.
The individual function blocks of the example are explained in the programming section. The individual function blocks of the supplement TwinCAT TCP/IP Server are explained here:
http://infosys.beckhoff.com/content/1031/tcpipserver/html/tcplclibtcpip_fb_socketconnect.htm?id=28704
The TwinCAT supplement TwinCAT TCP/IP Server in Verison Version 1.0.64 (or higher) is required for this example. An MA Lighting RPU Hardware Unit is required. Basic knowledge in Network Technology (Multicast groups) is required.