Siemens: How to indirectly address tags in WinCC in TIA Portal

AWC’s application engineering team recently developed a method to indirectly address HMI tags in WinCC in TIA Portal using VBScript.  Typically, TIA Portal does not allow the user to build an address with the CONCAT instruction and use SmartTags to dereference it. Since TIA Portal creates the tag links during the project compilation process, a tag cannot be dereferenced without a SmartTags call.  If those tags are already referenced somewhere with SmartTags, then the built tag will work; however, these will now all count as tags for the purposes of WinCC Advanced or WinCC Professional Runtime licenses.  

An alternative approach is to create a separate VBscript with all the tags that will need to be referenced, and then use CONCAT and a loop to reference these tags indirectly.  Once the TIA Portal project is compiled, the dummy VBscript in which the SmartTags are declared can be removed.  TIA Portal will allow the tags to be dereferenced because the links were built during the compilation process. As long as the project is not recompiled again, they will continue to work. This VBscript can be copied over to the Master Copies folder of the Project Library, added back to the TIA Portal project if another recompilation of the project is needed, and deleted once the compilation is complete.

This process allows the programming of tags without adding to the overall tag count, and any tag that you can indirectly address any tag that you can build the name for. Since a recompilation of the entire project will break the VBscript, the AWC application engineering team recommends adding a large comment at the beginning of the VBscript that states how the script works and how to recompile all if another programmer plans on contributing to the project.  

Additional Contributions

  • Julyann Tu – AWC, Inc.
Matt Paulissen is the engineering manager for the Texas Gulf Coast region for AWC, Inc. in the Houston, TX office.

Matt Paulissen

App Engineer/Tech Support

Matt Paulissen

App Engineer/Tech Support

Matt Paulissen is the engineering manager for the Texas Gulf Coast region for AWC, Inc. in the Houston, TX office.
Leave a Reply

Your email address will not be published.