====== Interfacing the ComfilePi with an EtherCAT Device ====== EtherCAT field i/o is expensive, but its performance is better than that of Modbus RTU. (As a result of checking the latency through experimentation, EtherCAT was measured to be about 15~25ms while Modbus RTU was measured to be about 80~100mS) {{ :comfilepi:codesys:ethercatwithcomfilepi.jpg?nolink |}} There is only one Ethernet port in CompilePi, so a WIFI dongle was used to connect to the local network, and the ComfilePi's Ethernet port was connected to the EtherCAT module. A Crevis GN-9386 was chosen for this demonstration, but the procedure is the same for EtherCAT products of other companies. (ex:Beckhoff, Wago..) 1. Download the Creavis GN-8386 the XML file. The Creavis GN-8386 XML configuration file can be downloaded from their website. {{ :comfilepi:codesys:crevisethercat.png?nolink |}} Choose one. {{ :comfilepi:codesys:getxml.png?nolink |}} 2. Go to the Device repository. {{ :comfilepi:codesys:devicereposi.png?nolink |}} Click Install and select the downloaded xml file. {{ :comfilepi:codesys:installxml.png?nolink |}} 3. Add EtherCAT device. In the picture, 2784 and 1238 are next to 9386. Add devices in this order. {{ :comfilepi:codesys:ethercatdevice.jpg?nolink |}} {{ :comfilepi:codesys:adddeviceethercat1.png?nolink |}} 4. Configure the EtherCAT NIC. Click Browse. Then one connected one will float. Choose it and you're done. {{ :comfilepi:codesys:ethercatntcsetting.png?nolink |}} 5. Make an LD program. {{ :comfilepi:codesys:ethercatldcoding.png?nolink |}} Assign a direct address to a variable. {{ :comfilepi:codesys:ethercatdirectadr1.png?nolink |}} {{ :comfilepi:codesys:ethercatdirectadr2.png?nolink |}} 6. Make a Visualization. {{ :comfilepi:codesys:ethercatvisuaddsom.png?nolink |}} Check the result.