02-19-2025 03:03 AM
Hi everyone,
I am trying to control siemens drives through a labview project, over etherCAT. I have in my possession a CU320 equipped with the S120 Robox card, to interface with etherCAT comms. I have worked with Siemens people on it, it should work but it doesn't.
I have found the xml ESI file describing the S120 on their website. I have opened it in TwinCAT software to modify it, as explained here https://support.industry.siemens.com/forum/fr/en/posts/exporting-ethercat-xml-file-config-from-start... , and exported the way it is explained there, to make it readable on the NI side.
I am able to import the new EtherCAT slave device in my LabVIEW project, on the host PC and on the target. I can see the defined communications as global EtherCAT variables. EtherCAT master and slave parameters get deployed without error when connected to the target. But I am then unable to switch the Scan Engine mode to Active.
I get the following error message when trying to get it to Active Mode: NI Industrial Com. for EtherCAT : telegram is timeout. (cf attached picture)
I am also unable to see info on the online state of the slave device, the page says "Cannot display selected Category page".
This happened when connected physically to the S120 card. The ethernet card used on the PXI is defined as EtherCAT in NI MAX (that's my EtherCAT Master).
I was working with Siemens people and they had configured the S120 card to be used in etherCAT communications through their STARTER software. It seems to us that a first communications has passed, kind of a configuration of the I/O declared in the xml file and so in the device profile used in lb, and those I/O have been transmitted and declared on the STARTER side. But nothing else and the eth cable seems to have no life.
I have some ideas to check to try to understand what is going wrong : sync parameters on master and on slave sides.
Bad configuration of the XML file, maybe bad identification of the device ? I attached it to this message as a txt file (couldnt join an xml) for what its worth.
But if you have any other ideas on what I am not understanding or doing wrong, let me know. Thanks.
Using LabVIEW 2022Q3 with NI Ind Com for EtherCAT 2023Q3, PXIe 8881.
Solved! Go to Solution.
02-21-2025 07:55 AM
I made some progress,
It seems that no custom xml file is needed but just the original one, unlike mentioned in the question I linked.
Using the general XML file, the etherCAT master is able to "recognize" and import the connected slave device.
But there is a mismatch between what's imported and created under the master in the labview project and what was configured on the siemens software side.
Working on it
08-07-2025 01:09 PM
Were you ever able to advance past recognizing the slave device? My team is preparing to embark on this same journey and I would love to give them a headstart.
08-08-2025 02:36 AM
Hello Matt,
Yes, we made it work, I forgot to update and complete this topic.
First of all, to be able to add an EtherCAT device to your labview project you need to have an EtherCAT master on your PXI RT Target.
You need to define one ethernet card of the PXI as EtherCAT, this is done in NI MAX.
Then in your project, you can right click your target and add an existing EtherCAT master : the card you just defined.
Your second step is wanting to add your EtherCAT devices under your newly added EtherCAT master. For each device you are gonna need an XML file describing the device on the EtherCAT network.
In our case, Siemens provide a generic XML file for the CU320 coupled with the S120 Robox Card on their website. It contains every possible module, we tried to use this file as provided, but it didn't work for our configuration.
To create a working file, we used TwinCAT, as detailed in the link provided in the first message. You need to put the generic XML file in TwinCAT/3.1/Config/Io/EtherCAT. Then create a blank project, add an etherCAT master and then add an etherCAT slave, corresponding to the file you just imported.
In the slave tabs, you can configure it as you want to fit your project. Lets say you have 3 drives to control, in velocity mode. In the "Slots" tab, you have to add three CSV module to the first three objects, and add the Synchro and CU for the two last objects.
In the TwinCAT project you also need to create the same number of axes than drives, and link them.
For all those TwinCAT steps, I suggest following this documentation : https://support.industry.siemens.com/cs/attachments/109757300/109757300_EtherCAT_Interface_SINAMICS_...
I suggest to rename every IO of every declared module, so that LabVIEW will have no problem differenciating them.
To export the XML file when you are done setting up the EtherCAT device in TwinCAT, go to CoE online, Advanced, uncheck SCI-file, change the file name to somehing.xml, and Create. The file will be created under TwinCAT/3.1/Config/Io/EtherCAT.
Now you have a XML file describing your slave device to be used with LabVIEW. You are halfway there.
The CU320 also needs to be configured, through STARTER, the siemens software. For our project we had two communications, EtherCAT to LabView and EthernetIP to a PLC. If I am not mistaken the EtherCAT as to be set on the IF1 tab. I also suugest following the documentation linked above.
Our main problem was from the STARTER side, there's quite a lot to set up and we lost ourselves on the way 😄
N.B : in the expert list on STARTER pay good attention to the p8858 parameter, it has to match what you delcared in TwinCAT or it won't work.
Here is an other useful documentation on the Robox Card https://support.industry.siemens.com/cs/attachments/109757414/MAN18004_03_E0321.zip
When the CU is correcty set up, and the labview project ready, you can try to switch your scan engine mode to active in LabVIEW, you'll see if you get an error.
N.B. : you can press the ADV button on the Robox Card and extract the microSD card from it to read the log file, it can be very useful for troubleshooting.
I hope those instructions will help your team, do not hesitate to write here again if you have questions. I may have forgotten some steps or tips to answer problems your team might encounter.