Not sure how references work with bound labels

Hi, I’m new to ignition and am trying to reverse engineer how the reference tags work on bound labels.
I believe I have a basic understanding of how the refs work - please correct me if I’m wrong:
You would have any tag
<o id = "0"> ..code here.. </o>
and then any call to <ref>0</ref> would essentially copy and paste the contents of that that tag into that spot.

I have the following XML generated from copying one template using label binding.

My questions are:

For the tag on line 4 that goes
<o id = “0” cls…

  1. Does this reference all of the code till the end of this tag? In this case lines 4 through 47? It seems like a ridiculous amount of duplicated code to be referencing?

  2. What happens with the (recursive?) calls to <ref>0</ref> within that tag? Lines 7 and 8 contain a reference to the id=“0” tag within itself. Really have no idea what’s going on with that.

My main goal for the project that I’m working on requires me to first understand exactly what this XML would look like without the references.

I appreciate any insight somebody could offer.

What’s the end goal? You will find yourself in a world of pain if you’re trying to automate creating a screen with bindings! It’s relatively simple to automate adding components to a vision Window, but adding bindings is a huge can of worms, (don’t underestimate it). There are a lot of optimisations being done in a Vision Window’s XML that make reproducing it extremely difficult

1 Like

Yeah, automation with the bindings is the main goal - well it was the main goal. I will now reconsider. I greatly appreciate your input.

For anyone interested, martin.david1995 built an awesome open script to automatically generate lots of labels GitHub - martindavid1995/XMLGenerator: XML Generator

1 Like