How do I import an XML generated by PLC coder into TwinCAT 3 / Visual Studio 2015?

57 views (last 30 days)
I am generating an XML using PLC Coder, and would like to import this XML into Beckhoff TwinCAT 3/Visual Studio 2015 (TwinCAT 3 is an add-on I have installed for Visual Studio, as shown in the image below).
Although I have my own model, I am currently working with a MathWorks example model, "plcdemo_external_symbols". I changed the "PLC Code Generation" configuration parameters of the model to have a Target IDE of "Beckhoff TwinCAT 3". I then generate the XML by right-clicking on the subsystem, and selecting "PLC Code > Generate Code for Subsystem". This generates "plcdemo_external_symbols.xml". When I try to import the XML, I am getting an error message saying it "cannot consume the specified XML. The XML content has no meaning for the tree item...".
How can I import my generated XML file into TwinCAT?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 May 2018
The option being used to import the XML into TwinCat in the above screenshot is not intended for PLC XML. Instead, the generated XML can be imported into TwinCat/Visual Studio using the right-click context menu. In the Visual Studio solution window, right-click on the PLC project for which you want to import the code. Then, the context menu will show an option for "Import PLCopen XML". Select this option, and choose the XML file generated by Simulink in the file open dialog. You can read more about this import method in Beckhoff's online documentation, linked below.
infosys.beckhoff.com/english.php?content=../content/1033/tc3_plc_intro/2526208651.html&i

More Answers (0)

Categories

Find more on Simulink PLC Coder in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!