Reputation: 11
So Im working on automating the development of PLC code that is expressed in XML, and to do so I have exported FB block and its networks to see what the code looks like so I could get an Idea of the XML tree But there is a tag called <SW.Blocks.CompileUnit ID="DD" CompositionName="CompileUnits"> and I could not figure Out how does the compiler assigns the value I tryied looking if it was HEX but I dont see the relation. The next assigened value is <SW.Blocks.CompileUnit ID="E6" CompositionName="CompileUnits"> Help on this matter would be very much apprecciated.
Upvotes: 1
Views: 1259
Reputation: 423
The compiler assigns the CompileUnit IDs according to the wisdom of its own internal logic, which is not of consequence in the only application worth considering - generating blocks to import, as IchEben has correctly pointed out.
CompileUnit ID must be numeric (hex or dec), unique and possibly incremental, as per this xslt definition in the Siemens example C# project "OpennessExcelSwGenerator", SIOS ID 109770550 (comments translated using DeepL):
<!--Variable "pos" counts the number of networks to get a consecutive unique ID for each network within this document-->
<xsl:variable name="pos" select="position()"/>
<!--Variable "pos" used as ID-->
<SW.Blocks.CompileUnit ID="{$pos}" CompositionName="CompileUnits">
...
Other than that, documentation is scant - I've searched for this myself a couple of times. You could try looking through SIOS in case I missed something: Siemens Industry Support Online
If you must know how the TIA compiler generates those IDs, you can raise a support request on SIOS. I guess they'll elevate the question to the dev team, but you risk annoying them for something they certainly won't think you need to know.
Upvotes: 0
Reputation: 35
Don’t worry too much about the IDs! All the IDs in this XML-Files has to be unique. They don’t have to be in order or something. So, when you generate code use a simple counter for the IDs to make sure they are unique and that’s it.
Upvotes: 1