<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TIA Portal Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/tag/tia-portal/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Thu, 09 Jul 2026 19:36:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>

<image>
	<url>https://static.dmcinfo.com/wp-content/uploads/2025/04/site-icon-150x150.png</url>
	<title>TIA Portal Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Restoring an Older Version of a Siemens Multiuser Project</title>
		<link>https://static.dmcinfo.com/blog/19725/restoring-an-older-version-of-a-siemens-multiuser-project/</link>
		
		<dc:creator><![CDATA[Jack Haskell]]></dc:creator>
		<pubDate>Wed, 30 Sep 2020 13:17:39 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Multiuser Commissioning]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/19725/restoring-an-older-version-of-a-siemens-multiuser-project/</guid>

					<description><![CDATA[<p>Since the creation of TIA Portal Version V14,&#160; users have the option of using Siemens Multiuser to collaborate with their peers in a shared project. When one user makes a change to an existing Multiuser project in their local copy of the project, they then &#8220;Check-in&#8221; that change into the server which pushes the Server [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/19725/restoring-an-older-version-of-a-siemens-multiuser-project/">Restoring an Older Version of a Siemens Multiuser Project</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Since the creation of TIA Portal Version V14,&nbsp; users have the option of using Siemens Multiuser to <a href="https://static.dmcinfo.com/latest-thinking/blog/id/10094/advantages-of-siemens-multiuser-commissioning-mode">collaborate with their peers in a shared project</a>. When one user makes a change to an existing Multiuser project in their local copy of the project, they then &ldquo;Check-in&rdquo; that change into the server which pushes the Server copy of the project to later be pulled onto the local copies of all of the other collaborators. However, what are you supposed to do when you accidentally check in something you weren&rsquo;t supposed to into the Server, or if someone else working on the project checks something in that messes up the project? Fortunately, Siemens provides a tool to rollback the Server copy to previous versions to recover any lost or modified features of your project.</p>

<p class="wp-block-paragraph">For example, say&nbsp;I have a local copy of a project that is hosted on a Multiuser Server called <strong>RestoreExample</strong>. One day while I&rsquo;m working on the project, I delete a data block called <strong>dbImportant</strong> thinking its something that the project doesn&rsquo;t need, and then I check that deletion back into the server.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/1-dbimportant-database.jpg" /></figure>

<h2 class="wp-block-heading">Restoring the Data Block</h2>

<p class="wp-block-paragraph">Later that day, I realize that <strong>dbImportant </strong>was necessary for some features of the project and that nothing will work right without it. Now, I have to somehow get <strong>dbImportant </strong>back into the server copy of the project.</p>

<p class="wp-block-paragraph">If you open the TIA Portal Project Server V16 &ndash; Administration program and log into your multiuser server, you can access the history of your project and all of the changes that it has gone through.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/2-MUS-history-for-project.jpg"  /></figure>

<p class="wp-block-paragraph">In this History window, you can see information on all the revisions of the Server project from each time someone checked in a change to the server. From here you can see when the change was made, who made the change, and any comments they might have made.</p>

<p class="wp-block-paragraph">If you click on the <strong>&ldquo;Show Details&rdquo; </strong>button in the upper right-hand side of the window you can see a list of all the changes that were checked in for that revision. As you can see in<strong>&nbsp;Revision 13,</strong> the details window shows that <strong>dbImportant </strong>was deleted in that revision.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/3-deleting-dbimportant-datablock.png" /></figure>

<p class="wp-block-paragraph">Now if I click on Revision 12 and press the <strong>&ldquo;Rollback to the selected revision&rdquo;</strong> button, a new revision of the server will automatically be created with the comment &ldquo;Rollback to Revision 12.&quot;</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/4-rollback-revisions-for-mus-project.png"  /></figure>

<p class="wp-block-paragraph">If you look at the details for the newly created Revision 14, you can see the block <strong>dbImportant </strong>was re-created.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/5-create-new-dbimportant-datablock.png"  /></figure>

<p class="wp-block-paragraph">Now, if I go back to my local copy of the project, you can see that a change has been made to the server and that I need to refresh my local copy to get everything up to date.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/6-sync-and-restore-example-datablock.png" /></figure>

<p class="wp-block-paragraph">After refreshing,&nbsp;<strong>dbImportant </strong>has been added back into my local session with all of its contents still intact.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/7-after-refresh-of-datablock.jpg"  /></figure>

<p class="wp-block-paragraph">By default, the Multiuser Server only stores the 10 most recent versions of the project so if the revision that you wish to restore is an older revision that you&rsquo;re out of luck, but if you anticipate needing to access old revisions of your project you can edit the number of revisions stored using the TIA Portal Project Server V16 &ndash; Configuration Tool to set the number of saved revisions to 1, 10, 100, 1000 or unlimited.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/8-TIA-portal-revision-creation.png" /></figure>

<p class="wp-block-paragraph">Also, if you want to keep a single revision of the project for an extended period of time you can press the <strong>&ldquo;Export selected revision&rdquo;</strong> button to save that revision somewhere on your computer to use as a reference later.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/9-export-selected-revisions.jpg"  /></figure>

<p class="wp-block-paragraph">While Multiuser&rsquo;s revision history is by no means a replacement for a more robust version control program, it can be very helpful for short-term version control in cases where it would be too cumbersome to be constantly updating a repo for every small change that is made to a project.</p>

<p class="wp-block-paragraph">Learn more about <a href="https://static.dmcinfo.com/latest-thinking/blog/id/10031/siemens-multiuser-tips-and-tricks">Siemens Multiuser Tips and Tricks</a> and DMC&apos;s <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming">Siemens expertise</a>. <a href="/contact">Contact us</a> with any questions.&nbsp;</p>
<p>The post <a href="https://static.dmcinfo.com/blog/19725/restoring-an-older-version-of-a-siemens-multiuser-project/">Restoring an Older Version of a Siemens Multiuser Project</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using SIMATIC Automation Tool to Download a Project without TIA Portal</title>
		<link>https://static.dmcinfo.com/blog/20034/using-simatic-automation-tool-to-download-a-project-without-tia-portal/</link>
		
		<dc:creator><![CDATA[Nikhil Holay]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 11:09:01 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Remote Support]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/20034/using-simatic-automation-tool-to-download-a-project-without-tia-portal/</guid>

					<description><![CDATA[<p>If you have a trusted integrator make program changes remotely, you don&#8217;t necessarily need to have the full TIA Portal software suite to download the changes to your machine. SIMATIC Automation Tool can give users a method of downloading PLC, HMI and Safety changes to their Siemens 1200 and 1500 PLCs. DMC uses SIMATIC Automation [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/20034/using-simatic-automation-tool-to-download-a-project-without-tia-portal/">Using SIMATIC Automation Tool to Download a Project without TIA Portal</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If you have a trusted integrator make program changes remotely, you don&#8217;t necessarily need to have the full <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Portal</a> software suite to download the changes to your machine. SIMATIC Automation Tool can give users a method of downloading PLC, HMI and Safety changes to their Siemens 1200 and 1500 PLCs.</p>



<p class="wp-block-paragraph">DMC uses SIMATIC Automation Tool to support clients remotely nationwide.</p>



<h2 class="wp-block-heading" id="h-simatic-nbsp-automation-tool-v3-1">SIMATIC&nbsp;Automation Tool V3.1</h2>



<p class="wp-block-paragraph">Denver Engineer Jay LaFave wrote a great blog detailing <a href="/latest-thinking/blog/id/9402/how-to-update-a-siemens-plc-without-tia-portal-using-the-simatic-automation-tool">how to get started with SIMATIC Automation Tool</a>. Start there if you&#8217;re new to using it!</p>



<p class="wp-block-paragraph">SIMATIC Automation Tool V3.1 brings many new features to an already useful tool. Below, you&#8217;ll see how you can use the tool to download safety programs and HMIs.&nbsp;</p>



<ul class="wp-block-list">
<li style="margin-bottom:10px"><strong>UI Updates:</strong> the tab has changed to &quot;program update&quot; in order to pick a program.<br />
 <img decoding="async" alt="ui updates" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/1-UI-updates.png"  /></li>



<li><strong>Safety Download Features:</strong>
 
 
<ul class="wp-block-list">
<li style="margin-bottom:10px">The program is now highlighted in yellow to signify safety.<br />
  <img decoding="async" alt="safety updates" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/2-signify-safety.png"  /></li>



<li style="margin-bottom:10px">Notifies the user if the safety program is getting downloaded for the first time.<br />
  <img decoding="async" alt="safety download" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/3-safety-downloads.png"  /></li>



<li style="margin-bottom:10px">Replace the safety program with a standard program.<br />
  <img decoding="async" alt="safety program" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/4-safety-update.png"  /></li>



<li style="margin-bottom:10px">One thing to be aware of is that&nbsp;if you have an existing safety program with a password, and download the new safety program without a password, you will not be required to enter the old program password prior to downloading. If you want to make sure you have a password on the project, make sure there is a password on the new program.</li>



<li style="margin-bottom:10px">Access protection forces you to put your password in CPU.<br />
  <img decoding="async" alt="protection" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/5-protection.png"  /></li>
</ul>
</li>



<li style="margin-bottom:10px"><strong>DB Reinitialization:</strong> for those of you that have critical real-time data stored in DB (and not set as retentive), be aware that you will not be warned about datablock initialization.&nbsp;</li>



<li style="margin-bottom:10px"><strong>HMI Updates:</strong> Once a backup is created, the HMI can also be downloaded from SIMATIC Automation Tool.<br />
 <img decoding="async" alt="folder structure" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/6-browse-folder.png"  />
 

<ul class="wp-block-list">
  

<li style="margin-bottom:10px">To create a backup file, right-click on <strong>HMI</strong>, click <strong>HMI Maintenance</strong>, and click <strong>&quot;Pack &amp; Go&quot;</strong>.<br />
  <img decoding="async" alt="hmi maintenance" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/7-hmi-maintenance.png"  /></li>


 </ul>


 </li>



<li style="margin-bottom:10px"><strong>Additional notes from Siemens</strong> from the <a href="https://cache.industry.siemens.com/dl/files/152/109751152/att_931622/v1/simatic_automationtooluserguide_V3_1_201710_en-US_en-US.pdf" target="_blank">SIMATIC Automation Tool User Guide</a>:<br />
 <img decoding="async" alt="siemens notes" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/8-Siemens-Notes.png"  /></li>
</ul>



<p class="wp-block-paragraph">Overall, SIMATIC Automation Tool is a great method that we&#8217;ve used to support our clients remotely. Clients and end-users often do not have the development software, and this allows them to download changes without needing a programmer onsite.</p>



<p class="wp-block-paragraph">Learn more about how we <a href="https://static.dmcinfo.com/blog/20081/remote-support-for-industrial-automation/">support all of our clients remotely</a> and about our <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming">Siemens expertise</a>.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/20034/using-simatic-automation-tool-to-download-a-project-without-tia-portal/">Using SIMATIC Automation Tool to Download a Project without TIA Portal</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Advantages of Siemens Multiuser Commissioning Mode</title>
		<link>https://static.dmcinfo.com/blog/20120/advantages-of-siemens-multiuser-commissioning-mode/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Tue, 10 Mar 2020 07:29:18 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Multiuser Commissioning]]></category>
		<category><![CDATA[PLC Programming]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/20120/advantages-of-siemens-multiuser-commissioning-mode/</guid>

					<description><![CDATA[<p>In this blog, we will discuss the numerous advantages of using Siemens Multiuser Commissioning Mode. Siemens Multiuser is a powerful tool allowing for multiple engineers to edit a single program in tandem. Check out my blog on Siemens Multiuser Tips and Tricks for some additional information as well. What? Multi-User Server (MUS) Commissioning Mode is [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/20120/advantages-of-siemens-multiuser-commissioning-mode/">Advantages of Siemens Multiuser Commissioning Mode</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this blog, we will discuss the numerous advantages of using Siemens Multiuser Commissioning Mode. Siemens Multiuser is a powerful tool allowing for multiple engineers to edit a single program in tandem. Check out my blog on <a href="https://static.dmcinfo.com/blog/20542/siemens-multiuser-tips-and-tricks/">Siemens Multiuser Tips and Tricks</a> for some additional information as well.</p>



<h2 class="wp-block-heading" id="h-what">What?</h2>



<p class="wp-block-paragraph">Multi-User Server (MUS) Commissioning Mode is a TIA Portal tool used to ease the commissioning process when multiple engineers are making online changes and downloading concurrently.</p>



<h2 class="wp-block-heading" id="h-why">Why?</h2>



<p class="wp-block-paragraph">The main advantage of using Commissioning Mode is the ability to ensure consistency between the server project and the PLC while multiple users are downloading to the PLC. This feature will also alleviate the headache of having to coordinate download efforts and ensure a consistent program between many local sessions or even single-user sessions.</p>



<p class="wp-block-paragraph">One common theme of using MUS while commissioning is the potential to see offline/online differences with the PLC when they aren’t really there. Timestamp differences are not handled automatically, so if someone performs a download to the PLC that comes with a timestamp, other engineers (even after refreshing from the server copy) will see differences between their project and the project downloaded to the PLC.</p>



<p class="wp-block-paragraph"><span style="font-size:110%;"><u><strong>Without Commissioning Mode</strong></u></span></p>



<p class="wp-block-paragraph">After downloading to the PLC from the Session B project, it shows offline/online consistency, but Session A now shows conflicts. This typically happens when the order of <strong>Download/Check-in/Refresh</strong> is not done in the correct order and is usually a result of a timestamp difference between the projects. When downloading from Session A at this point, Session B (even when up to date with the server copy) will still show online/offline differences.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/1-local-sessions-a-b.png" alt="LOCAL SESSIONS"/></figure>



<p class="wp-block-paragraph">If you complete a comparison in Project A for what’s different, it will show consistency between the online and offline projects. This can be attributed to timestamp differences that pop up depending on the order of operations mentioned above.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/2-local-session-A.png" alt="local session A"/></figure>



<p class="wp-block-paragraph"><span style="font-size:110%;"><u><strong>Commissioning Mode Enabled</strong></u></span></p>



<p class="wp-block-paragraph">To incorporate changes made when commissioning mode is turned on, simply download the changes to the server. This will also check the changes into the server copy to ensure consistency. This process will also make time stamps consistent across projects, eliminating mystery offline/online discrepancies.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/3-local-session-B.png" alt="local session b"/></figure>



<p class="wp-block-paragraph">When Commissioning mode is active, downloading the program will show the need to refresh the server in other local sessions.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/4-local-refresh-A.png" alt="local refresh"/></figure>



<h2 class="wp-block-heading" id="h-how">How?</h2>



<p class="wp-block-paragraph">You can turn on Commissioning Mode with a single click in MUS Administration, provided you meet certain conditions. Siemens lists these conditions as:</p>



<ul class="wp-block-list">
<li>All local session changes checked in and updated (current with server copy)</li>



<li>No selections (flags) are made in the local sessions</li>



<li>The PLC is downloaded with the most recent version of the server project</li>
</ul>



<p class="wp-block-paragraph">When you have met these conditions, and you click the Multiuser Commissioning, you’ll see the <span style="color:orange">operating mode</span> change to ‘Commissioning Mode.’ Siemens recommends leaving the <span style="color:red">‘Check for different data…’</span> option checked (which it is by default) and should only be deactivated if using an S7-300/400 CPU.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/5-operation-mode.png" alt="operation mode"/></figure>



<h2 class="wp-block-heading" id="h-caveats">Caveats?</h2>



<p class="wp-block-paragraph">This feature is available for TIA Portal V15.1 and will not be available for older versions of Portal. Multiuser server features go back a few versions, but this is new as of 15.1.</p>



<p class="wp-block-paragraph">Learn more about our <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming">Siemens Expertise</a> and <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Portal Development Services</a>. <a href="/contact">Contact us</a> with any project inquiries.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/20120/advantages-of-siemens-multiuser-commissioning-mode/">Advantages of Siemens Multiuser Commissioning Mode</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Getting Started with Siemens Multiuser Commissioning</title>
		<link>https://static.dmcinfo.com/blog/20739/getting-started-with-siemens-multiuser-commissioning/</link>
		
		<dc:creator><![CDATA[Nikhil Holay]]></dc:creator>
		<pubDate>Thu, 17 Oct 2019 11:38:39 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Multiuser Commissioning]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/20739/getting-started-with-siemens-multiuser-commissioning/</guid>

					<description><![CDATA[<p>Here at DMC, we love using the Multiuser server for offline projects with multiple developers. However, in the past, we’ve found that using multiuser for onsite projects leaves…something to be desired. To help alleviate this issue, Siemens released a multiuser commissioning tool in V15.1. How Did We Do This Before? Using Multiuser Commissioning How do [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/20739/getting-started-with-siemens-multiuser-commissioning/">Getting Started with Siemens Multiuser Commissioning</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Here at DMC, we love using the Multiuser server for <a href="https://static.dmcinfo.com/blog/23572/leveraging-siemens-multiuser-engineering-for-tia-portal/">offline projects with multiple developers</a>. However, in the past, we’ve found that using multiuser for onsite projects leaves…something to be desired. To help alleviate this issue, Siemens released a multiuser commissioning tool in V15.1.</p>



<h2 class="wp-block-heading" id="h-how-did-we-do-this-before">How Did We Do This Before?</h2>



<ul class="wp-block-list">
<li>Before downloading to the PLC, upload the latest code from the PLC.
 
 
<ul class="wp-block-list">
<li><strong>Main issues:&nbsp;</strong>uploading can pull your blocks out of your folder structure. More importantly, if someone forgets to upload, someone’s code can be overwritten.</li>
</ul>
</li>



<li>Work off a single shared project.
 
 
<ul class="wp-block-list">
<li><strong>Main issues:</strong> it can be very difficult to develop quickly and efficiently if everyone needs to work off the same project file.</li>
</ul>
</li>
</ul>



<h2 class="wp-block-heading" id="h-using-multiuser-commissioning">Using Multiuser Commissioning</h2>



<h3 class="wp-block-heading" id="h-how-do-i-turn-it-on">How do I turn it on?</h3>



<p class="wp-block-paragraph">Open the Multiuser Server Administration application from your desktop. You will then select the specific project needed.</p>



<p class="wp-block-paragraph">To learn more about the whole process of setting up a multiuser project, <a href="https://static.dmcinfo.com/blog/23572/leveraging-siemens-multiuser-engineering-for-tia-portal/">read this blog</a> for more information or <a href="https://static.dmcinfo.com/blog/21578/siemens-multiuser-server-local-host-setup-quick-start-guide/">this blog</a> for more information the Multiuser server local host set up.&nbsp;</p>



<p class="wp-block-paragraph"><br>
<strong>Note:</strong> this button in the project <strong>will not</strong> turn on multiuser commissioning. However, it leads nicely into the next section.&nbsp;</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/turning-mu-on-2.png" alt="turn MU on 2"/></figure>



<h3 class="wp-block-heading" id="h-how-do-i-know-that-it-s-on">How do I know that it&#8217;s on?</h3>



<p class="wp-block-paragraph">Remember the Multiuser Commissioning button from before? You’ll see the multiuser commissioning symbol highlighted orange when multiuser commissioning is enabled, as shown below.&nbsp;</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/mu-button-on.png" alt="mu button"/></figure>



<h2 class="wp-block-heading" id="h-what-is-the-back-end-download-process">What is the back-end download process?</h2>



<ol class="wp-block-list">
<li>The local session makes changes to the server project.</li>



<li>The server will compile.
 
 
<ul class="wp-block-list">
<li>If the compile fails, the server project will open.</li>
</ul>
</li>



<li>If the compilation is successful, the server project will download it to the device.</li>



<li>If the download is successful, the server project is saved.</li>



<li>If changes are saved to the server, your local copy will be refreshed with the latest program from the server project.&nbsp;</li>
</ol>



<h3 class="wp-block-heading" id="h-what-does-this-mean">What does this mean?</h3>



<p class="wp-block-paragraph">After downloading, your server copy will always match your actual device copy.</p>



<h3 class="wp-block-heading" id="h-what-are-the-major-benefits">What are the major benefits?</h3>



<ul class="wp-block-list">
<li>Works well when multiple people are working on the same PLC, as all tags and blocks will be synchronized without uploading from PLC</li>



<li>Improves consistency across the project</li>



<li>Decreases commissioning time</li>



<li>Improves accessibility for new engineers</li>



<li>No more uploading!</li>



<li>No more single projects!</li>
</ul>



<h3 class="wp-block-heading" id="h-should-i-use-it">Should I use it?</h3>



<p class="wp-block-paragraph">Definitely!</p>



<p class="wp-block-paragraph">Overall, we&#8217;ve used multiuser commissioning to vastly improve our onsite commissioning process. Its quick setup and shared codebase have taken many of the pain points out of multi-person commissioning.&nbsp;</p>



<p class="wp-block-paragraph"><strong>Learn more about our <a href="/services/manufacturing-automation-and-intelligence/plc-programming">PLC Programming Services</a> and our <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming">Siemens Expertise</a>.&nbsp;</strong></p>
<p>The post <a href="https://static.dmcinfo.com/blog/20739/getting-started-with-siemens-multiuser-commissioning/">Getting Started with Siemens Multiuser Commissioning</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Finite and (Almost-) Infinite State Machines</title>
		<link>https://static.dmcinfo.com/blog/21062/finite-and-almost-infinite-state-machines/</link>
		
		<dc:creator><![CDATA[Joshua Zimmerle]]></dc:creator>
		<pubDate>Mon, 26 Aug 2019 14:21:42 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[State Machines]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21062/finite-and-almost-infinite-state-machines/</guid>

					<description><![CDATA[<p>What is a state machine, and why should I use one? State machines are a way of organizing code into situations, or states, and transitions so that the code is easier to follow and read. A state represents what the code and/or physical machine is currently doing, and transitions represent ways for the system to [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21062/finite-and-almost-infinite-state-machines/">Finite and (Almost-) Infinite State Machines</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">What is a state machine, and why should I use one? <strong>State machines</strong> are a way of organizing code into situations, or states, and transitions so that the code is easier to follow and read. A state represents what the code and/or physical machine is currently doing, and transitions represent ways for the system to move between states. In this overview, I’ll cover some of the basics of using state machines to control industrial machines.</p>



<h2 class="wp-block-heading" id="h-states">States</h2>



<p class="wp-block-paragraph">First, we should contrast the two most common types of state machines, <strong>Moore and Mealy</strong>. Moore state machines set outputs based on only the current state. By contrast, Mealy state machines set outputs according to the current state and current inputs into the system. The most significant difference is where decision logic is located within the state machine. Moore state machines place the decision logic in the transitions while Mealy state machines place the logic in the states.</p>



<p class="wp-block-paragraph">Functionally both Moore and Mealy state machines can both accomplish the same tasks, the only difference is how readable the state machine will be. We&#8217;ll focus on&nbsp;Moore state machines here, because I find them to generally be more readable in most situations.&nbsp;</p>



<p class="wp-block-paragraph">For machine control, the controller dictates a system’s state. It’s often essential to have the controller verify that the state it’s in matches the physical system, particularly when recovering from power cycles or manual operation. Some systems do this exclusively with sensors, while others rely on the assistance of human inspection. For example, robotic arms typically have sensors that ensure the area is locked off for safety and then ask the operator to confirm that the area is clear before moving.&nbsp;</p>



<p class="wp-block-paragraph">Another special case worth mentioning is when states have internal properties. These setpoints allow a single step to count or output a user-defined value. These properties are very useful for a system that needs to count the number of times something has happened or want to use a user-defined set point.</p>



<h2 class="wp-block-heading" id="h-transitions">Transitions</h2>



<p class="wp-block-paragraph">Transitions connect states. Each transition has a direction and set of conditions that have the be met to transition into the next state. Once a transition&#8217;s conditions are met, the state machine transitions states and begins setting outputs for the new state. Individual states can also have multiple leaving transitions, each with different conditions.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/transitions.png" alt="transition state"/></figure>



<h2 class="wp-block-heading" id="h-sequencers">Sequencers</h2>



<p class="wp-block-paragraph">Sequencers are a subset of state machines that consist of states that each have only one transition. This means that sequencers do not have any logic to pick from multiple states and always execute the same states in the same order. Sequencers are some of the simplest state machines and are often used to help organize larger state machines, compressing multiple steps into a single step.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/sequencers.png" alt="sequencer state"/></figure>



<h2 class="wp-block-heading" id="h-finite-state-machines">Finite State Machines</h2>



<p class="wp-block-paragraph">More complex state machines have branching transitions that allow the system to transition to different states depending on situational conditions. State machines are far from the only method of doing this but are one of the most structured and readable methods. This fact is a valuable and often overlooked aspect of programming. Readable code with clearly organized structure is easier and faster to commission and debug, as well as easier to add to latter logic if more functionality is needed.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/finite-state-machine.png" alt="finite state machines"/></figure>



<h2 class="wp-block-heading" id="h-near-infinite-state-machines">Near Infinite State Machines</h2>



<p class="wp-block-paragraph">More complex state machines may allow the operator to order individual steps to form more complicated processes. These state machines use an intermediate step that selects the next step based on the operator’s selection and can have near limitless configurations. The ability to define new sequences of steps on the fly and pass differing parameters to steps make these state machines, and the machines they control as versatile as possible.</p>



<p class="wp-block-paragraph">Each step in the process is treated as a single state, even if functionally, it has many individual steps within it. Each step is treated as a single date because these states have only one or two possible outcomes: successful completion and/or unsuccessful completion. When a step is completed successfully, the systems will execute the next step, and so on until all the defined steps are complete. If a step fails, the system will transition to a fault handling state, pausing the machine and communicating the error to the operator.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/near-infinitie-state-machine.png" alt="near infinite state machines"/></figure>



<p class="wp-block-paragraph">The difficulty in designing this type of state machine and still making it easy to use lies in structuring each step so that it can follow any other step. Special care must be taken to disable or prevent potentially dangerous actions from executing when they could cause damage to the machine or operator.</p>



<p class="wp-block-paragraph">Hopefully, this information helps you understand a little more about how state machines and the systems they control work. Developing a proper state machine early on can save a lot of time and effort, as well as preventing a costly bug in the program. Also if you’re programming in <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">Siemens’ TIA Portal</a>, check out the Sequencer block in the <a href="https://openplclibrary.com/" target="_blank" rel="noreferrer noopener">Siemens Open Library</a>, it’s great for designing sequences and state machines.</p>



<p class="wp-block-paragraph"><strong>Learn more about our <a href="/services/manufacturing-automation-and-intelligence/plc-programming">PLC Programming expertise</a>. <a href="/contact">Contact us</a> for any project inquiries.&nbsp;</strong></p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://static.dmcinfo.com/blog/21062/finite-and-almost-infinite-state-machines/">Finite and (Almost-) Infinite State Machines</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Sending Emails with a Siemens 1500 PLC</title>
		<link>https://static.dmcinfo.com/blog/21143/sending-emails-with-a-siemens-1500-plc/</link>
		
		<dc:creator><![CDATA[Blake Strebel]]></dc:creator>
		<pubDate>Tue, 13 Aug 2019 13:25:13 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Function Blocks]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21143/sending-emails-with-a-siemens-1500-plc/</guid>

					<description><![CDATA[<p>Out of the box, Siemens 1500 PLCs can send emails through a third-party email service provider. This interface supplies a mechanism for alerting relevant personal of faults, warnings, and other status information. The following guide outlines the steps required for establishing a secure connection to an email server and using the TMAIL_C function block to [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21143/sending-emails-with-a-siemens-1500-plc/">Sending Emails with a Siemens 1500 PLC</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Out of the box, <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming">Siemens 1500 PLCs</a> can send emails through a third-party email service provider. This interface supplies a mechanism for alerting relevant personal of faults, warnings, and other status information.</p>



<p class="wp-block-paragraph">The following guide outlines the steps required for establishing a secure connection to an email server and using the <strong>TMAIL_C function block</strong> to send messages.</p>



<p class="wp-block-paragraph">This configuration requires a 1500 PLC with minimum firmware V2.0. If you are using a PLC which does not meet these requirements, you may need an additional communication module to establish a connection to the server. These steps also assume that your PLC is connected to the internet via a router.</p>



<p class="wp-block-paragraph">The basic tasks are outlined below:</p>



<ul class="wp-block-list">
<li>Configure email server</li>



<li>Obtain encryption certificate</li>



<li>Import certificate into TIA Portal</li>



<li>Update the PLC hardware configuration</li>



<li>Configure the TMAIL_C function block</li>



<li>Use the TMAIL_C function block</li>
</ul>



<p class="wp-block-paragraph">I used TIA Portal V15.1 for this walkthrough. The procedure may differ slightly for different versions.</p>



<h2 class="wp-block-heading" id="h-configuring-email-server">Configuring Email Server</h2>



<p class="wp-block-paragraph">For this example, we created a dedicated Gmail account to act as an email server. This server communicates with the PLC via <strong>Simple Mail Transfer Protocol</strong> (SMTP) and transmits emails to the final recipient. For most providers, the default settings will need to be changed to enable the sending of messages via an external program. If you&#8217;re using a Gmail account, turn off two-step verification and enable less secure app access in your account settings. Without this access, the PLC connection to the server will be rejected.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/configuring-email-server.png" alt="configure email server"/></figure>



<h2 class="wp-block-heading" id="h-obtaining-encryption-certificate">Obtaining Encryption Certificate</h2>



<p class="wp-block-paragraph">The Transport Layer Security (TLS) protocol is used to encrypt the SMTP communications between the PLC client and the email server to ensure a secure connection. Consequently, the PLC needs the certificate associated with the email service provider to sign and encrypt messages.</p>



<p class="wp-block-paragraph">In Internet Explorer, the name of the relevant certificate can be obtained by navigating to your service providers webpage and opening the security report. When I created this walkthrough, Gmail used the Google Trusted Services – GlobalSign Root CA-R2 certificate.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/encryption-certificate.png" alt="plc encryption certificate"/></figure>



<p class="wp-block-paragraph">After determining the correct name, locate the certificate in your computer&#8217;s certificate manager and export it as a <strong>*.cer file</strong> in the DER encoded binary format. In the next step, we will import this certificate into <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Portal</a> before adding it to the PLC hardware configuration. This allows the PLC to communicate with the email server using the additional security provided by the TLS protocol.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/export-tasks.png" alt="exporting tasks"/></figure>



<h2 class="wp-block-heading" id="h-importing-certificate-into-tia-portal">Importing Certificate into TIA Portal</h2>



<p class="wp-block-paragraph">After configuring the email server and obtaining the correct certification file, the remaining configuration is performed in TIA Portal. First, a project administrator must be specified, providing access to the additional security features of the project. These features allow us to add a third&nbsp;party certificate to the project.</p>



<p class="wp-block-paragraph">To create an administrator, navigate to the security settings for the project and define the necessary credentials. Note, these credentials will be required to access the project in the future.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/project-administrator.png" alt="project admin"/></figure>



<p class="wp-block-paragraph">After defining a security administrator, the security settings of the project should include additional security features, including the certificate manager. To import the certificate file, navigate to the certificate authority, and right-click to import the file. After importing, the certificate containing the public key required for the SMTP connection should appear in the manager.</p>



<p class="wp-block-paragraph">Note the expiration date of the certificate, as it may need updating in the future. Furthermore, ensure that the PLC time is set correctly, as the factory default may fall outside of the certificate’s valid range.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/import-certificate.png" alt="importing certificcate"/></figure>



<h2 class="wp-block-heading" id="h-updating-plc-hardware-configuration">Updating PLC Hardware Configuration</h2>



<p class="wp-block-paragraph">After importing the certificate into the project, the hardware configuration of the PLC must be updated to establish a connection to the email server. This process involves adding the certificate to the device and configuring the DNS server settings.</p>



<p class="wp-block-paragraph">First, navigate to the <strong>certificate manager</strong> in the Protection &amp; Security settings of the device configuration. Enable the use of the global security settings to provide full functionality. Then, add the certificate as a partner device. Note that if the certificate manager settings tab does not appear, then your hardware likely does not support this configuration. In this case, you may need to use an external communication module to use the TMAIL_C function block.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/certificate-manager.png" alt="certificate manager"/></figure>



<p class="wp-block-paragraph">After adding the certificate to the hardware configuration, we need to verify the DNS server settings of the PLC. A <strong>Domain Name System</strong> (DNS) server is required to associate domain names with the IP addresses needed for routing information between the PLC and the email server.</p>



<p class="wp-block-paragraph">For this application, the router connecting the PLC to the internet will act as the DNS server. Consequently, the router address must match the DNS server address in the hardware configuration. After verifying the router address in the PLC’s PROFINET interface, navigate to the DNS configuration and add it to the list of DNS server addresses.</p>



<p class="wp-block-paragraph">If you are unsure the proper address, you can use the<strong> ipconfig </strong>command on a PC networked to the PLC to determine the default gateway of your local network.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="h-configuring-the-tmail-c-function-block">Configuring the TMAIL_C Function Block</h2>



<p class="wp-block-paragraph">After the hardware configuration for the PLC is complete, the final task involves setting up the TMAIL_C function block to send messages. This block can be found under <strong>Communication</strong> in the <strong>Instruction Window</strong>.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/tmail-c.png" alt="tmail_C"/></figure>



<p class="wp-block-paragraph">The <strong>MAIL_ADDR_PARAM</strong> input is used to define the connection details. For an S7-1500 CPU, the TMail_V4_SEC system data type should be used to establish a secure connection using <strong>IPv4</strong>. Note, Siemens provides several additional data types for communicating with a server using different protocols.</p>



<p class="wp-block-paragraph">The parameters of the TMail_V4_SEC data type need to be defined as follows:</p>



<ul class="wp-block-list">
<li style="margin-bottom:20px;"><strong>InterfaceId:</strong> The hardware identifier of the PROFINET interface being used to communicate with the email server. This value is found in the system constants list located in the device configuration.<br />
 

<figure class="wp-block-image"><img decoding="async" alt="local profinet interface" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/local-profinet-interface.png"  /></figure>

</li>



<li style="margin-bottom:20px;"><strong>ID:</strong> The connection identifier. This value should likely be 1.</li>



<li style="margin-bottom:20px;"><strong>ConnectionType:</strong> Defines the connection type. Use 16#20 for IPv4.</li>



<li style="margin-bottom:20px;"><strong>ActiveEstablished:</strong> Defines if connections are actively or passively established. Since the PLC is acting as the SMTP client, it must actively establish a connection to communicate with the server. Therefore, this value must be true.</li>



<li style="margin-bottom:20px;"><strong>WatchDogTime:</strong> The duration before a communication timeout occurs</li>



<li style="margin-bottom:20px;"><strong>MailServerAddress: </strong>The IP address of the configured email server. Pinging the SMTP server from any PC determines this value.<br />
 

<figure class="wp-block-image"><img decoding="async" alt="mail server addresses" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/mail-server-address.png"  /></figure>

</li>



<li style="margin-bottom:20px;"><strong>UserName:</strong> The username for your email server account</li>



<li style="margin-bottom:20px;"><strong>PassWord:</strong> The password for your email server account. Note, the PLC instance memory will store this password in plain text.</li>



<li style="margin-bottom:20px;"><strong>From:</strong>
 

<ul class="wp-block-list">
  

<li style="margin-bottom:20px;"><strong>LocalPartPlusAt: </strong>The local part of your email address plus the &quot;@&quot; symbol. For a Gmail account, this will be your username followed by &quot;@.&quot;</li>


  

<li style="margin-bottom:20px;"><strong>FullQualifiedDomainName: </strong>The domain name of your email service provider. For example, &quot;gmail.com.&quot;</li>


 </ul>


 </li>



<li style="margin-bottom:20px;"><strong>Remote Port: </strong>This is the remote TCP port used for the connection. The default port for SMTP communications is 587. Some legacy systems may use alternative ports, but they are generally less secure and not recommended.</li>



<li style="margin-bottom:20px;"><strong>ActivateSecureConn:</strong> This value should be true to activate the security functionality of the connection. If it is false, a non-secure connection will be established which may be rejected by the server.</li>



<li style="margin-bottom:20px;"><strong>ExtTLSCapabilities:</strong> Allows for extended capabilities of the TLS handshaking protocol. This is not required for this configuration.</li>



<li style="margin-bottom:20px;"><strong>TLSServerCertRef:</strong> Reference to the encryption certificate of the email server. Use the integer ID of the imported certificate.</li>
</ul>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/address-parameters.png" alt="address parameters"/></figure>



<h2 class="wp-block-heading" id="h-using-the-tmail-c-function-block">Using the TMAIL_C Function Block</h2>



<p class="wp-block-paragraph">After configuring the address parameters, using the TMAIL_C block is relatively straightforward. A message&#8217;s recipient, subject, and body are defined using the FBs respective inputs. Optionally, an attachment can be defined, allowing arrays of data to be included as an attachment to the email.</p>



<p class="wp-block-paragraph">A message request is triggered on the rising edge of the REQ input. The block executes asynchronously over several cycles, during which the BUSY output will remain high. If the email is sent successfully, the DONE output will pulse for a single scan. If it fails, the ERROR output will pulse, and the STATUS will update with the relevant error code.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/email-function-block.png" alt="function block for sending email"/></figure>



<p class="wp-block-paragraph">There you have it! These steps provide the basic outlining for setting up an SMTP client on a Siemens 1500 PLC. For additional information, see the related <a href="https://support.industry.siemens.com/cs/document/46817803/sending-emails-to-smtp-servers-with-an-s7-cpu?dti=0&amp;lc=en-US" type="link" id="https://support.industry.siemens.com/cs/document/46817803/sending-emails-to-smtp-servers-with-an-s7-cpu?dti=0&amp;lc=en-US">Siemens application example</a> in addition to the help files associated with the TMAIL_C connect block.</p>



<p class="wp-block-paragraph">Feel free to <a href="/contact">contact DMC</a> with any questions or project inquiries and learn more about our <a href="/services/manufacturing-automation-and-intelligence/plc-programming">PLC Programming services</a>&nbsp;and our <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming">Siemens expertise</a>.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21143/sending-emails-with-a-siemens-1500-plc/">Sending Emails with a Siemens 1500 PLC</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using XML Templates in TIA Openness</title>
		<link>https://static.dmcinfo.com/blog/21173/using-xml-templates-in-tia-openness/</link>
		
		<dc:creator><![CDATA[Patrick Smith]]></dc:creator>
		<pubDate>Thu, 01 Aug 2019 09:35:26 +0000</pubDate>
				<category><![CDATA[HMI and SCADA]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Function Blocks]]></category>
		<category><![CDATA[Openness]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<category><![CDATA[XML]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21173/using-xml-templates-in-tia-openness/</guid>

					<description><![CDATA[<p>In my previous post, we looked at how Openness formats the XML files that it uses to create objects in TIA Portal. After reviewing some examples, we concluded that creating code in XML can be very complicated and that it is best to use existing blocks to generate XML using Openness. On the surface, that [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21173/using-xml-templates-in-tia-openness/">Using XML Templates in TIA Openness</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><a href="/latest-thinking/blog/id/9908/how-to-read-an-openness-xml-file">In my previous post</a>, we looked at how Openness formats the XML files that it uses to create objects in TIA Portal. After reviewing some examples, we concluded that creating code in XML can be very complicated and that it is best to use existing blocks to generate XML using Openness.</p>



<p class="wp-block-paragraph">On the surface, that doesn’t seem very useful, since writing code requires you to have already written code. However, another way to look at it is that by writing your desired code once, you can use Openness to automatically generate the code as much as needed. By creating XML templates, your Openness application can be used to quickly generate new code from an existing codebase.</p>



<h2 class="wp-block-heading" id="h-what-is-a-template-for">What is a Template For?</h2>



<p class="wp-block-paragraph">Let’s take a step back and consider when generating code from a template using Openness is more useful than creating the necessary code yourself in TIA Portal. Imagine you are in charge of maintaining the PLC code for your company’s line of modular conveyor systems. When a customer wants to order a conveyor system, they choose from the dozens of available modules and arrange them in the configuration that suits their needs. Since you’re a smart programmer, you’ve created a set of function blocks that can control each module.</p>



<p class="wp-block-paragraph">When it comes time to develop the final PLC program, you have to copy in your existing modules, link them to the appropriate inputs and outputs, create the handshakes for passing data between each module, collect each module’s fault codes and send them to the master controller, and the list can go on and on. For large systems, this can become very tedious and time-consuming. However, you can take your modules, export them to XML, and with a little tweaking, allow Openness to automatically insert the relevant data and create the code for you.</p>



<h2 class="wp-block-heading" id="h-creating-a-template">Creating a Template</h2>



<p class="wp-block-paragraph">The first step of automating your code generation is to create your template files. We’ll start by using Openness to create the XML file, and then we’ll add some modifications that will allow our Openness application to fill in data for us.</p>



<p class="wp-block-paragraph">To keep things simple, we’ll assume we have 3 modules that have been packaged into function blocks called <strong>fbModule1</strong>,<strong> fbModule2</strong>, and <strong>fbModule3</strong>. Each module has the same block interface. There’s an input for the motor feedback, an interlock signal from the upstream module, a module ID that the block uses for fault messaging, an output to turn on the motor, and an interlock sent to the downstream module.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Module-example.png" alt="fb module example"/></figure>



<p class="wp-block-paragraph">Since the modules are completely self-contained blocks, in this case, there’s no need to create templates for them. As long as they are part of the final TIA Portal project, we just need a template for creating the block calls and assigning the tags. We’ll also need a template for the instance data blocks, a template for creating the I/O tags, and a template for the global data block that will contain the handshake bits.</p>



<p class="wp-block-paragraph">Let’s start with the I/O tags. I’ve created a tag table called IO and added one input and one output.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;Document>
&lt;SW.Tags.PlcTagTable ID="0">
    &lt;AttributeList>
      &lt;Name>IO&lt;/Name>
    &lt;/AttributeList>
    &lt;ObjectList>
      &lt;SW.Tags.PlcTag ID="1" CompositionName="Tags">
        &lt;AttributeList>
          &lt;DataTypeName>Bool&lt;/DataTypeName>
          &lt;ExternalAccessible>true&lt;/ExternalAccessible>
          &lt;ExternalVisible>true&lt;/ExternalVisible>
          &lt;ExternalWritable>true&lt;/ExternalWritable>
          &lt;LogicalAddress>%I0.0&lt;/LogicalAddress>
          &lt;Name>I_Section1Running&lt;/Name>
        &lt;/AttributeList>
        &lt;ObjectList>
          &lt;MultilingualText ID="2" CompositionName="Comment">
            &lt;ObjectList>
              &lt;MultilingualTextItem ID="3" CompositionName="Items">
                &lt;AttributeList>
                  &lt;Culture>en-US&lt;/Culture>
                  &lt;Text>Section 1 motor running&lt;/Text>
                &lt;/AttributeList>
              &lt;/MultilingualTextItem>
            &lt;/ObjectList>
          &lt;/MultilingualText>
        &lt;/ObjectList>
      &lt;/SW.Tags.PlcTag>
	  &lt;SW.Tags.PlcTag ID="10" CompositionName="Tags">
        &lt;AttributeList>
          &lt;DataTypeName>Bool&lt;/DataTypeName>
          &lt;ExternalAccessible>true&lt;/ExternalAccessible>
          &lt;ExternalVisible>true&lt;/ExternalVisible>
          &lt;ExternalWritable>true&lt;/ExternalWritable>
          &lt;LogicalAddress>%Q0.0&lt;/LogicalAddress>
          &lt;Name>Q_Section1Run&lt;/Name>
        &lt;/AttributeList>
        &lt;ObjectList>
          &lt;MultilingualText ID="11" CompositionName="Comment">
            &lt;ObjectList>
              &lt;MultilingualTextItem ID="12" CompositionName="Items">
                &lt;AttributeList>
                  &lt;Culture>en-US&lt;/Culture>
                  &lt;Text>Run section 1 motor&lt;/Text>
                &lt;/AttributeList>
              &lt;/MultilingualTextItem>
            &lt;/ObjectList>
          &lt;/MultilingualText>
        &lt;/ObjectList>
      &lt;/SW.Tags.PlcTag>
	 &lt;/Document></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Tags.PlcTagTable</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;0&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">IO</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Tags.PlcTag</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;1&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Tags&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">DataTypeName</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Bool</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">DataTypeName</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalAccessible</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalAccessible</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalVisible</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalVisible</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalWritable</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalWritable</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">LogicalAddress</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">%I0.0</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">LogicalAddress</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">I_Section1Running</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;2&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Comment&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;3&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Section 1 motor running</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Tags.PlcTag</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Tags.PlcTag</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;10&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Tags&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">DataTypeName</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Bool</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">DataTypeName</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalAccessible</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalAccessible</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalVisible</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalVisible</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalWritable</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalWritable</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">LogicalAddress</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">%Q0.0</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">LogicalAddress</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Q_Section1Run</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;11&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Comment&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;12&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Run section 1 motor</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Tags.PlcTag</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	 </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">This XML needs to be broken into 2 parts: the XML for the tag table, where we will add tags, and the XML for a tag, which we will fill in with the relevant data. To create these templates, delete the data that we will replicate, and add a placeholder that your application will use to perform the replacement. I like the syntax <strong>{Placeholder_Name}</strong>.</p>



<p class="wp-block-paragraph">Here are my templates for the tag table and tags.</p>



<p class="wp-block-paragraph"><strong>Tag Table Template:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;Document>
  &lt;SW.Tags.PlcTagTable ID="0">
    &lt;AttributeList>
      &lt;Name>IO&lt;/Name>
    &lt;/AttributeList>
    &lt;ObjectList>
		{Tags}
	&lt;/ObjectList>
   &lt;/SW.Tags.PlcTagTable>
 &lt;/Document></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Tags.PlcTagTable</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;0&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">IO</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">		{Tags}</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Tags.PlcTagTable</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4"> </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph"><strong>Tag Template:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;SW.Tags.PlcTag ID="{Iterate}" CompositionName="Tags">
&lt;AttributeList>
       &lt;DataTypeName>Bool&lt;/DataTypeName>
       &lt;ExternalAccessible>true&lt;/ExternalAccessible>
       &lt;ExternalVisible>true&lt;/ExternalVisible>
       &lt;ExternalWritable>true&lt;/ExternalWritable>
	   &lt;LogicalAddress>{Address}&lt;/LogicalAddress>
	   &lt;Name>{TagName}&lt;/Name>
&lt;/AttributeList>
		&lt;ObjectList>
          &lt;MultilingualText ID="{Iterate}" CompositionName="Comment">
            &lt;ObjectList>
              &lt;MultilingualTextItem ID="{Iterate}" CompositionName="Items">
                &lt;AttributeList>
                  &lt;Culture>en-US&lt;/Culture>
                  &lt;Text>{Tag Comment}&lt;/Text>
                &lt;/AttributeList>
              &lt;/MultilingualTextItem>
            &lt;/ObjectList>
          &lt;/MultilingualText>
        &lt;/ObjectList>
&lt;/SW.Tags.PlcTag></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Tags.PlcTag</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Tags&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">       </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">DataTypeName</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Bool</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">DataTypeName</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">       </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalAccessible</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalAccessible</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">       </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalVisible</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalVisible</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">       </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ExternalWritable</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ExternalWritable</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	   </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">LogicalAddress</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{Address}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">LogicalAddress</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	   </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{TagName}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Comment&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{Tag Comment}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Tags.PlcTag</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">In the Openness application, for each module, we would use the tag template to fill in<strong> {Address}</strong>, <strong>{TagName}</strong>, <strong>{TagComment}</strong>, and <strong>{Iterate}</strong>. These tags would then be grouped together and inserted into the tag template at the <strong>{Tags}</strong> placeholder. How you get this data is up to you. An easy solution is to read in a user-created Excel table, such as the following.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Excel-Data.png" alt="Excel data"/></figure>



<p class="wp-block-paragraph">The application would create the input and output tags for each module and could be set up to give specific tag names depending on the section and module. For example, the tags for Section 1 could be named “I_Section1MotorRunning” and “Q_RunSection1Motor”. The final XML file would contain all the I/O tags, ready to be imported into the project.</p>



<p class="wp-block-paragraph">A similar process could be done for the<strong> global data block.</strong> The format is similar to that of the tag table. The resulting templates would look something like the code below.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;Document>
  &lt;SW.Blocks.GlobalDB ID="0">
    &lt;AttributeList>
      &lt;AutoNumber>true&lt;/AutoNumber>
      &lt;HeaderAuthor />
      &lt;HeaderFamily />
      &lt;HeaderName />
      &lt;HeaderVersion>0.1&lt;/HeaderVersion>
      &lt;Interface>
		 &lt;Sections xmlns="http://www.siemens.com/automation/Openness/SW/Interface/v2">
  			&lt;Section Name="Static">
			{Tags}
			&lt;/Section>
		&lt;/Sections>
	 &lt;IsOnlyStoredInLoadMemory>false&lt;/IsOnlyStoredInLoadMemory>
      &lt;IsRetainMemResEnabled>false&lt;/IsRetainMemResEnabled>
      &lt;IsWriteProtectedInAS>false&lt;/IsWriteProtectedInAS>
      &lt;MemoryLayout>Optimized&lt;/MemoryLayout>
      &lt;MemoryReserve>100&lt;/MemoryReserve>
      &lt;Name>dbHandshakes&lt;/Name>
      &lt;Number>6&lt;/Number>
      &lt;ProgrammingLanguage>DB&lt;/ProgrammingLanguage>
    &lt;/AttributeList>
    &lt;ObjectList>
      &lt;MultilingualText ID="1" CompositionName="Comment">
        &lt;ObjectList>
          &lt;MultilingualTextItem ID="2" CompositionName="Items">
            &lt;AttributeList>
              &lt;Culture>en-US&lt;/Culture>
              &lt;Text />
            &lt;/AttributeList>
          &lt;/MultilingualTextItem>
        &lt;/ObjectList>
      &lt;/MultilingualText>
      &lt;MultilingualText ID="3" CompositionName="Title">
        &lt;ObjectList>
          &lt;MultilingualTextItem ID="4" CompositionName="Items">
            &lt;AttributeList>
              &lt;Culture>en-US&lt;/Culture>
              &lt;Text />
            &lt;/AttributeList>
          &lt;/MultilingualTextItem>
        &lt;/ObjectList>
      &lt;/MultilingualText>
    &lt;/ObjectList>
  &lt;/SW.Blocks.GlobalDB>
&lt;/Document></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Blocks.GlobalDB</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;0&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AutoNumber</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AutoNumber</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderAuthor</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderFamily</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderName</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderVersion</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">0.1</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">HeaderVersion</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Interface</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">		 </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Sections</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">xmlns</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;http://www.siemens.com/automation/Openness/SW/Interface/v2&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  			</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Section</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Static&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">			{Tags}</span></span>
<span class="line"><span style="color: #D4D4D4">			</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Section</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Sections</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	 </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">IsOnlyStoredInLoadMemory</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">IsOnlyStoredInLoadMemory</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">IsRetainMemResEnabled</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">IsRetainMemResEnabled</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">IsWriteProtectedInAS</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">IsWriteProtectedInAS</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MemoryLayout</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Optimized</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MemoryLayout</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MemoryReserve</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">100</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MemoryReserve</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">dbHandshakes</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Number</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">6</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Number</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">DB</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;1&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Comment&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;2&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;3&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Title&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;4&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Blocks.GlobalDB</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">The data block tags would use the tag template, and the {TagName} and {TagComment} fields would be filled in. The created tags would be used in the {Tags} placeholder in the data block template. Creating the instance data block template is very simple since each data block can be in a separate XML file. All that needs to be filled in is the function block name, the data block name, and the datablock number.</p>



<p class="wp-block-paragraph">This assumes that each module has the same block interface. If any module was different, it would need its own instance data block template. Note that I’ve hidden the Interface section in the below template to make it easier to read.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;Document>
&lt;SW.Blocks.InstanceDB ID="0">
    &lt;AttributeList>
      &lt;AutoNumber>false&lt;/AutoNumber>
      &lt;HeaderAuthor />
      &lt;HeaderFamily />
      &lt;HeaderName />
      &lt;HeaderVersion>0.1&lt;/HeaderVersion>
	  &lt;InstanceOfName>{FunctionBlockName}&lt;/InstanceOfName>
      &lt;Interface>
	&lt;MemoryLayout>Optimized&lt;/MemoryLayout>
      &lt;Name>{BlockName}&lt;/Name>
      &lt;Number>{BlockNumber}&lt;/Number>
      &lt;ProgrammingLanguage>DB&lt;/ProgrammingLanguage>
    &lt;/AttributeList>
	&lt;ObjectList>
      &lt;MultilingualText ID="1" CompositionName="Comment">
        &lt;ObjectList>
          &lt;MultilingualTextItem ID="2" CompositionName="Items">
            &lt;AttributeList>
              &lt;Culture>en-US&lt;/Culture>
              &lt;Text />
            &lt;/AttributeList>
          &lt;/MultilingualTextItem>
        &lt;/ObjectList>
      &lt;/MultilingualText>
      &lt;MultilingualText ID="3" CompositionName="Title">
        &lt;ObjectList>
          &lt;MultilingualTextItem ID="4" CompositionName="Items">
            &lt;AttributeList>
              &lt;Culture>en-US&lt;/Culture>
              &lt;Text />
            &lt;/AttributeList>
          &lt;/MultilingualTextItem>
        &lt;/ObjectList>
      &lt;/MultilingualText>
    &lt;/ObjectList>
  &lt;/SW.Blocks.InstanceDB>
&lt;/Document></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Blocks.InstanceDB</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;0&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AutoNumber</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AutoNumber</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderAuthor</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderFamily</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderName</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderVersion</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">0.1</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">HeaderVersion</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">InstanceOfName</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{FunctionBlockName}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">InstanceOfName</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Interface</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MemoryLayout</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Optimized</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MemoryLayout</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{BlockName}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Name</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Number</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{BlockNumber}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Number</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">DB</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;1&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Comment&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;2&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;3&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Title&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;4&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Blocks.InstanceDB</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Finally, we can create our template for the block calls. In this case, I’ll call all the modules from our PLC’s OB1. We will need 2 templates again; one for the network, and one for the constant that will be linked to the iInModuleID parameter. I’ve hidden a few sections for readability.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;Member Name="{Name}" Datatype="Int" Accessibility="Public">
	&lt;Comment>
	  &lt;MultiLanguageText Lang="en-US">{Comment}&lt;/MultiLanguageText>
	&lt;/Comment>
	  &lt;StartValue>{Value}&lt;/StartValue>
&lt;/Member></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">Member</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Name}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Datatype</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Int&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Accessibility</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Public&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Comment</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultiLanguageText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Lang</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;en-US&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{Comment}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultiLanguageText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Comment</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">StartValue</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">{Value}</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">StartValue</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Member</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;SW.Blocks.CompileUnit ID="{Iterate}" CompositionName="CompileUnits">
      &lt;AttributeList>
        &lt;NetworkSource>
		&lt;FlgNet xmlns="http://www.siemens.com/automation/Openness/SW/NetworkSource/FlgNet/v1">
  &lt;Parts>
    &lt;Access Scope="GlobalVariable" UId="{Iterate}">
      &lt;Symbol>
        &lt;Component Name="{MotorRunningTag}" />
      &lt;/Symbol>
    &lt;/Access>
    &lt;Access Scope="GlobalVariable" UId="{Iterate}">
      &lt;Symbol>
        &lt;Component Name="dbHandshakes" />
        &lt;Component Name="{InterlockInputTag}" />
      &lt;/Symbol>
    &lt;/Access>
    &lt;Access Scope="LocalConstant" UId="{Iterate}">
      &lt;Constant Name="{ModuleIDTag}" />
    &lt;/Access>
    &lt;Access Scope="GlobalVariable" UId="{Iterate}">
      &lt;Symbol>
        &lt;Component Name="{MotorRunTag}" />
      &lt;/Symbol>
    &lt;/Access>
    &lt;Access Scope="GlobalVariable" UId="{Iterate}">
      &lt;Symbol>
        &lt;Component Name="dbHandshakes" />
        &lt;Component Name="bSection1OK" />
      &lt;/Symbol>
    &lt;/Access>
    &lt;Call UId="26">
      &lt;CallInfo Name="fbModule3" BlockType="FB">
        &lt;Instance UId="27" Scope="GlobalVariable">
          &lt;Component Name="dbIns_Section1" />
        &lt;/Instance>
        &lt;Parameter Name="bInMotorRunning" Section="Input" Type="Bool" />
        &lt;Parameter Name="bInOkToRun" Section="Input" Type="Bool" />
        &lt;Parameter Name="iInModuleID" Section="Input" Type="Int" />
        &lt;Parameter Name="bOutRunMotor" Section="Output" Type="Bool" />
        &lt;Parameter Name="bOutModuleOK" Section="Output" Type="Bool" />
      &lt;/CallInfo>
    &lt;/Call>
  &lt;/Parts>
  &lt;Wires>
  &lt;/FigNet>
  &lt;/NetworkSource>
  &lt;ProgrammingLanguage>LAD&lt;/ProgrammingLanguage>
 &lt;/AttributeList>
	&lt;ObjectList>
&lt;/SW.Blocks.CompileUnit></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Blocks.CompileUnit</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;CompileUnits&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">NetworkSource</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">FlgNet</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">xmlns</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;http://www.siemens.com/automation/Openness/SW/NetworkSource/FlgNet/v1&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Parts</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Access</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;GlobalVariable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{MotorRunningTag}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Access</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Access</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;GlobalVariable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;dbHandshakes&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{InterlockInputTag}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Access</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Access</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;LocalConstant&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Constant</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{ModuleIDTag}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Access</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Access</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;GlobalVariable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{MotorRunTag}&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Access</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Access</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;GlobalVariable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;{Iterate}&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;dbHandshakes&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bSection1OK&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Access</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Call</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;26&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">CallInfo</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;fbModule3&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">BlockType</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;FB&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Instance</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;27&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;GlobalVariable&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;dbIns_Section1&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Instance</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Parameter</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bInMotorRunning&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Section</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Input&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Type</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Bool&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Parameter</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bInOkToRun&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Section</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Input&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Type</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Bool&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Parameter</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;iInModuleID&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Section</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Input&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Type</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Int&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Parameter</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bOutRunMotor&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Section</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Output&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Type</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Bool&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Parameter</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bOutModuleOK&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Section</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Output&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Type</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Bool&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">CallInfo</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Call</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Parts</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Wires</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">FigNet</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">NetworkSource</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">LAD</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4"> </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Blocks.CompileUnit</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">The application will use the {Name}, {Comment}, and {Value} placeholders to create the constant tags. The block calls will require filling in all the input and output parameters, as well as the function block and instance data block. Once all the code elements have been generated from templates, they can be imported into the project. If all goes well, your project is now ready to run the system!</p>



<p class="wp-block-paragraph">While setting up these templates is a difficult and time-consuming process, it can have a lot of benefits in the long run. Once the templates are created, any future projects can be created with a few lines in Excel and the click of a button. It also makes code updates easy. Any changes to a template will be reflected in all projects that are then generated from the template.</p>



<p class="wp-block-paragraph">By letting Openness handle the low-level, repetitive details of your code, you can quickly layout a project architecture that makes use of clean, reusable code.</p>



<p class="wp-block-paragraph">Learn more about our <a href="/services/manufacturing-automation-and-intelligence/plc-programming">PLC Programming</a> and <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Development</a> Services. <a href="/contact">Contact us</a> for more information.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21173/using-xml-templates-in-tia-openness/">Using XML Templates in TIA Openness</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Read an Openness XML File</title>
		<link>https://static.dmcinfo.com/blog/21358/how-to-read-an-openness-xml-file/</link>
		
		<dc:creator><![CDATA[Patrick Smith]]></dc:creator>
		<pubDate>Thu, 27 Jun 2019 08:36:02 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Function Blocks]]></category>
		<category><![CDATA[Openness]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<category><![CDATA[XML]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21358/how-to-read-an-openness-xml-file/</guid>

					<description><![CDATA[<p>In my previous post, I explained what TIA Openness is and how using it can streamline your development process. Since Openness uses XML files as the basis for its import and export functions, knowing how to understand these XML files is vital for creating and modifying code with Openness. Becoming fluent in the XML structure [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21358/how-to-read-an-openness-xml-file/">How to Read an Openness XML File</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In <a href="/latest-thinking/blog/id/9877/advantages-disadvantages-of-siemens-tia-openness">my previous post</a>, I explained what <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Openness</a> is and how using it can streamline your development process. Since Openness uses XML files as the basis for its import and export functions, knowing how to understand these XML files is vital for creating and modifying code with Openness.</p>



<p class="wp-block-paragraph">Becoming fluent in the XML structure of Openness is not a quick and easy process; it takes time and a lot of experience. However, with the basics I’ll cover in this post, you’ll have the tools and background you need to take your first steps.</p>



<h2 class="wp-block-heading" id="h-reading-an-xml-file">Reading an XML File</h2>



<p class="wp-block-paragraph">XML stands for <strong>eXtensible Markup Language</strong> and is a language used for storing data. Like HTML, it is a markup language, and is meant to be self-descriptive. XML is great for storing complex data structures since it encodes them in a hierarchical tag structure. Let’s take a look at a simple piece of XML.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;email>
	&lt;to>Alice&lt;/to>
	&lt;from>Bob&lt;/from>
	&lt;subject>XML&lt;/subject>
	&lt;message>Isn't XML the best?&lt;/message>
&lt;/email></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">email</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">to</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Alice</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">to</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">from</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Bob</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">from</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">subject</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">XML</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">subject</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">message</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Isn&apos;t XML the best?</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">message</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #808080">&lt;/</span><span style="color: #569CD6">email</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">This code represents an email. You can see that within the Email object, it contains information for To, From, Subject, and Message. These elements are children of the Email parent. Unlike HTML, XML has no predefined tags. Having no predefined tags allows the creator of XML to make those tags as descriptive as possible. XML also relies on other programs to read and write it; it does not do anything by itself. For the sample code above, someone must have created a program to store emails. In order to do something with those stored emails, there needs to be a program that converts the XML to a more human-friendly format.</p>



<p class="wp-block-paragraph">This is all that Openness does; it takes XML files that contain all the information needed for, say, a function block, reads them, and processes that information to make a new function block. When Openness exports a function block (or other piece of code), it converts all that data to an XML format. This means that when you open an Openness XML document, it will contain many tags that have been defined by Siemens. These tags are descriptive but can be hard to understand at first glance. Here’s a snippet of a function block in XML.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;Document>
  &lt;SW.Blocks.FB ID="0">
    &lt;AttributeList>
      &lt;AutoNumber>true&lt;/AutoNumber>
      &lt;HeaderAuthor />
      &lt;HeaderFamily />
      &lt;HeaderName />
      &lt;HeaderVersion>0.1&lt;/HeaderVersion>
      &lt;Interface>
		  &lt;Sections xmlns="http://www.siemens.com/automation/Openness/SW/Interface/v2">
  			&lt;Section Name="Input">
    			&lt;Member Name="bInCondition" Datatype="Bool" Remanence="NonRetain" Accessibility="Public">
					&lt;AttributeList>
						&lt;BooleanAttribute Name="ExternalAccessible" SystemDefined="true">false&lt;/BooleanAttribute>
						&lt;BooleanAttribute Name="ExternalVisible" SystemDefined="true">false&lt;/BooleanAttribute>
						&lt;BooleanAttribute Name="ExternalWritable" SystemDefined="true">false&lt;/BooleanAttribute>
					&lt;/AttributeList>
					&lt;Comment>
						&lt;MultiLanguageText Lang="en-US">Input condition&lt;/MultiLanguageText>
					&lt;/Comment>
				&lt;/Member>
  			&lt;/Section>
 			&lt;Section Name="Output">
    			&lt;Member Name="bOutDoSomething" Datatype="Bool" Remanence="NonRetain" Accessibility="Public">
					&lt;AttributeList>
						&lt;BooleanAttribute Name="ExternalAccessible" SystemDefined="true">false&lt;/BooleanAttribute>
						&lt;BooleanAttribute Name="ExternalVisible" SystemDefined="true">false&lt;/BooleanAttribute>
						&lt;BooleanAttribute Name="ExternalWritable" SystemDefined="true">false&lt;/BooleanAttribute>
					&lt;/AttributeList>
					&lt;Comment>
						&lt;MultiLanguageText Lang="en-US">Output action&lt;/MultiLanguageText>
					&lt;/Comment>
				&lt;/Member>
  			&lt;/Section></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">Document</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Blocks.FB</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;0&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AutoNumber</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">true</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AutoNumber</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderAuthor</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderFamily</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderName</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">HeaderVersion</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">0.1</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">HeaderVersion</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Interface</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">		  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Sections</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">xmlns</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;http://www.siemens.com/automation/Openness/SW/Interface/v2&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  			</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Section</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Input&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    			</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Member</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bInCondition&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Datatype</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Bool&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Remanence</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;NonRetain&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Accessibility</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Public&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;ExternalAccessible&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">SystemDefined</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;true&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;ExternalVisible&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">SystemDefined</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;true&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;ExternalWritable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">SystemDefined</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;true&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Comment</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultiLanguageText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Lang</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;en-US&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Input condition</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultiLanguageText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Comment</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Member</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  			</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Section</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4"> 			</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Section</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Output&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    			</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Member</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bOutDoSomething&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Datatype</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Bool&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Remanence</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;NonRetain&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Accessibility</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Public&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;ExternalAccessible&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">SystemDefined</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;true&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;ExternalVisible&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">SystemDefined</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;true&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;ExternalWritable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">SystemDefined</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;true&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">false</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">BooleanAttribute</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Comment</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultiLanguageText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Lang</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;en-US&quot;</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Output action</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultiLanguageText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">					</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Comment</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Member</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  			</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Section</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">This is part of the block interface of a function block. Let’s start at the top and work our way down.</p>



<p class="wp-block-paragraph"><strong>The Document Tag</strong><br>
The first element is the ‘Document’ tag. This tag is just used to delineate the start and end of the XML file. Each XML file you create for Openness should only contain one “Document” tag. Next, we have ‘SW.Blocks.FB ID=”0”’.</p>



<p class="wp-block-paragraph"><strong>SW.Blocks.FB</strong><br>
The ‘SW.Blocks.FB’ tells Openness that we are defining a function block. In a similar fashion, we could use ‘SW.Blocks.DB’ to define a data block. The ‘ID=”0”’ part is an internal ID used by Openness. This ID is only used to identify the different data within the XML file. If you have multiple blocks defined inside one ‘Document’ tag, each block will need to have a unique ID, or the import process will fail. In the event of an error, Openness will use these ID numbers to specify where the error occurred.</p>



<p class="wp-block-paragraph">Every function block has certain attributes, which are encapsulated in the ‘AttributeList’ tag. A lot of these attributes will look similar to ones you see when you go to the properties of the function block in Portal. For example, we have a value for ‘AutoNumber’ that tells us if the function block number is set automatically or manually. The ‘HeaderAuthor’, ‘HeaderFamily’, ‘HeaderName’, and ‘HeaderVersion’ attributes can be found in the properties of the block as well. The ‘Interface’ tag is used to define the block interface of the function block.</p>



<p class="wp-block-paragraph"><strong>Sections</strong><br>
The interface contains a set of ‘Sections’. A ‘Section’ is one of the different types of data that a function block can contain. In this example, we have a section named ‘Input’ and a section named ‘Output’. These correspond to the input and output parameters of the block, respectively. To define an input parameter, we create a ‘Member’ in the ‘Input’ section. In the above image, we have an input parameter called ‘bInCondition’. A member has its own set of attributes.</p>



<p class="wp-block-paragraph"><strong>Members</strong><br>
In the ‘Member’ definition, there are ‘Name’, ‘Datatype’, ‘Remanence’, and ‘Accessibility’ attributes. These correspond to the name of the variable, its datatype, whether or not it is retentive, and who can access the variable. Additional attributes are defined in the enclosed ‘AttributeList’. These three attributes, ‘ExternalAccessible’, ‘ExternalVisible’, and ‘ExternalWritable’ correspond to the checkboxes you see in Portal: ‘Accessible from HMI’, ‘Writable from HMI’, and ‘Visible in HMI engineering’.</p>



<p class="wp-block-paragraph"><strong>The Comment Attribute</strong><br>
Finally, the ‘Member’ contains a ‘Comment’ attribute. The comment contains a ‘MultiLanguageText’ attribute that contains the actual comment value. If you are programming in multiple languages, additional ‘MultiLanguageText’ attributes would be defined, and would allow the comment to appear in multiple languages. By setting the values of these attributes, you can fully define the variable. So the XML code above translates into the following block definition.</p>



<p class="wp-block-paragraph"><strong><strong></strong></strong></p>



<p class="wp-block-paragraph"><seems a="" get="" like="" lot="" of="" simple="" so="" something="" text="" to=""> </seems></p>



<h2 class="wp-block-heading" id="h-creating-code-from-xml">Creating Code from XML</h2>



<p class="wp-block-paragraph">Let’s start by looking at a few examples. Here’s a network in our existing function block.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/fb-network-1.png" alt="FB network"/></figure>



<p class="wp-block-paragraph">And here’s the associated XML.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">XML</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;SW.Blocks.CompileUnit ID="3" CompositionName="CompileUnits">
        &lt;AttributeList>
          &lt;NetworkSource>
			  &lt;FlgNet xmlns="http://www.siemens.com/automation/Openness/SW/NetworkSource/FlgNet/v1">
 				&lt;Parts>
    				&lt;Access Scope="LocalVariable" UId="21">
      					&lt;Symbol>
        						&lt;Component Name="bInCondition" />
      					&lt;/Symbol>
    				&lt;/Access>
    				&lt;Access Scope="LocalVariable" UId="22">
      					&lt;Symbol>
        						&lt;Component Name="bOutDoSomething" />
     					&lt;/Symbol>
   					&lt;/Access>
    				&lt;Part Name="Contact" UId="23" />
    				&lt;Part Name="Coil" UId="24" />
  				&lt;/Parts>
  				&lt;Wires>
    				&lt;Wire UId="25">
      					&lt;Powerrail />
      					&lt;NameCon UId="23" Name="in" />
    				&lt;/Wire>
    				&lt;Wire UId="26">
      					&lt;IdentCon UId="21" />
      					&lt;NameCon UId="23" Name="operand" />
    				&lt;/Wire>
    				&lt;Wire UId="27">
     					&lt;NameCon UId="23" Name="out" />
      					&lt;NameCon UId="24" Name="in" />
    				&lt;/Wire>
    				&lt;Wire UId="28">
      					&lt;IdentCon UId="22" />
      					&lt;NameCon UId="24" Name="operand" />
    				&lt;/Wire>
  				&lt;/Wires>
			&lt;/FlgNet>
		&lt;/NetworkSource>
        &lt;ProgrammingLanguage>LAD&lt;/ProgrammingLanguage>
      &lt;/AttributeList>
        &lt;ObjectList>
          &lt;MultilingualText ID="4" CompositionName="Comment">
            &lt;ObjectList>
              &lt;MultilingualTextItem ID="5" CompositionName="Items">
                &lt;AttributeList>
                  &lt;Culture>en-US&lt;/Culture>
                  &lt;Text>This network uses an input condition to activate an output action&lt;/Text>
                &lt;/AttributeList>
              &lt;/MultilingualTextItem>
            &lt;/ObjectList>
          &lt;/MultilingualText>
          &lt;MultilingualText ID="6" CompositionName="Title">
            &lt;ObjectList>
              &lt;MultilingualTextItem ID="7" CompositionName="Items">
                &lt;AttributeList>
                  &lt;Culture>en-US&lt;/Culture>
                  &lt;Text>Simple contact/coil network&lt;/Text>
                &lt;/AttributeList>
              &lt;/MultilingualTextItem>
            &lt;/ObjectList>
          &lt;/MultilingualText>
        &lt;/ObjectList>
      &lt;/SW.Blocks.CompileUnit></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #808080">&lt;</span><span style="color: #569CD6">SW.Blocks.CompileUnit</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;3&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;CompileUnits&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">NetworkSource</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">			  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">FlgNet</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">xmlns</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;http://www.siemens.com/automation/Openness/SW/NetworkSource/FlgNet/v1&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4"> 				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Parts</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Access</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;LocalVariable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;21&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bInCondition&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Access</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Access</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Scope</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;LocalVariable&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;22&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        						</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Component</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;bOutDoSomething&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">     					</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Symbol</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">   					</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Access</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Part</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Contact&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;23&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Part</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Coil&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;24&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Parts</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Wires</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Wire</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;25&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Powerrail</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">NameCon</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;23&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;in&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Wire</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Wire</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;26&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">IdentCon</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;21&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">NameCon</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;23&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;operand&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Wire</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Wire</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;27&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">     					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">NameCon</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;23&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;out&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">NameCon</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;24&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;in&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Wire</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Wire</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;28&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">IdentCon</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;22&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      					</span><span style="color: #808080">&lt;</span><span style="color: #569CD6">NameCon</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">UId</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;24&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Name</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;operand&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #808080">/&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">    				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Wire</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">  				</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Wires</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">			</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">FlgNet</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">NetworkSource</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">LAD</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ProgrammingLanguage</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;4&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Comment&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;5&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">This network uses an input condition to activate an output action</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualText</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;6&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Title&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">ID</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;7&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">CompositionName</span><span style="color: #D4D4D4">=</span><span style="color: #CE9178">&quot;Items&quot;</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">en-US</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Culture</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                  </span><span style="color: #808080">&lt;</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span><span style="color: #D4D4D4">Simple contact/coil network</span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">Text</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">AttributeList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">              </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualTextItem</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">          </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">MultilingualText</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">ObjectList</span><span style="color: #808080">&gt;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #808080">&lt;/</span><span style="color: #569CD6">SW.Blocks.CompileUnit</span><span style="color: #808080">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">The XML, while more complicated than the ladder logic view, is still relatively readable. There are attributes of the network, a section for declaring all used variables, a section that defines the ladder elements used, and a section that creates the connections between the variables and the separate ladder elements. However, while the sections stay the same, adding more complex elements quickly makes this XML extremely difficult to parse.</p>



<p class="wp-block-paragraph">Here’s an example of creating an instance of the <strong>Open Library fb_ValveSolenoid</strong> function block.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/fb-network-3.png" alt="fb network 3"/></figure>



<p class="wp-block-paragraph">While still a relatively simple network, the XML to encapsulate this network is 187 lines long (I won’t post it here to save space). Every part of the XML has to be accurately defined, or you will end up with import errors. In addition, learning the various pieces that Openness uses to define function blocks takes a lot of practice.</p>



<p class="wp-block-paragraph">For these reasons, it very rarely makes sense to start from scratch to create an XML version of a function block. You can add functions to your Openness application to export existing blocks to XML. Then, you can create your blocks in Portal, and have Openness generate the associated XML automatically. When editing these XML documents, I would recommend using a text editor that has support for proper XML formatting, such as Notepad++ or Visual Studio Code.</p>



<p class="wp-block-paragraph">While being at least somewhat familiar with Openness’ XML format is very useful for debugging purposes, we’ve seen that it can be overwhelming when trying to write code. Using Openness to generate the XML code is easy, but requires creating the desired object in Portal anyway.</p>



<p class="wp-block-paragraph">What then, you might ask, is the point of creating objects in XML? In the next post, I’ll cover how you can use Openness to automate the creation of code using XML templates.</p>



<p class="wp-block-paragraph">Learn more about <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">DMC&#8217;s TIA Portal Development</a> and <a href="/contact">contact us</a> for more information.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21358/how-to-read-an-openness-xml-file/">How to Read an Openness XML File</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Advantages &#038; Disadvantages of Siemens&#8217; TIA Openness</title>
		<link>https://static.dmcinfo.com/blog/21661/advantages-disadvantages-of-siemens-tia-openness/</link>
		
		<dc:creator><![CDATA[Patrick Smith]]></dc:creator>
		<pubDate>Tue, 07 May 2019 14:04:06 +0000</pubDate>
				<category><![CDATA[HMI and SCADA]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Openness]]></category>
		<category><![CDATA[PROFINET]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21661/advantages-disadvantages-of-siemens-tia-openness/</guid>

					<description><![CDATA[<p>Siemens’ TIA Openness is an API that allows you to interact with TIA Portal using a custom application. Although it is included with TIA Portal, Openness has not seen wide usage, as many programmers don’t see the use of learning a new programming language (C# .NET) on top of knowing PLC programming. However, Openness offers [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21661/advantages-disadvantages-of-siemens-tia-openness/">Advantages &#038; Disadvantages of Siemens&#8217; TIA Openness</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Siemens’ TIA Openness is an API that allows you to interact with <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Portal</a> using a custom application. Although it is included with TIA Portal, Openness has not seen wide usage, as many programmers don’t see the use of learning a new programming language (<a href="/services/application-development/pc-application-development/c-net">C# .NET</a>) on top of knowing <a href="/services/manufacturing-automation-and-intelligence/plc-programming">PLC programming</a>.</p>



<p class="wp-block-paragraph">However, Openness offers many advantages that can lead to more efficient code creation. One of the best uses of Openness is for creating modular code that can be used across many devices, with application-specific changes being made automatically. By defining some base templates, you can allow users to generate entire projects without any knowledge of PLC and <a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming">HMI programming</a>.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Openness-Demo-R.png" alt="TIA Openness"/></figure>



<h2 class="wp-block-heading" id="h-how-does-openness-work-nbsp">How does Openness Work?&nbsp;</h2>



<p class="wp-block-paragraph">There are <strong>two main parts</strong> of any Openness project:</p>



<ol class="wp-block-list">
<li>The C# .NET application that provides the interface to TIA Portal</li>



<li>The XML files that are used to create code in TIA Portal</li>
</ol>



<p class="wp-block-paragraph">I’ll cover the details of the XML files in a later blog post; for now, we’ll focus on the C# .NET application. All you need to get started is to add the two <strong>.dll files</strong> that Siemens provides as references to your C# .NET project. These files provide the variable types and methods needed to work with TIA Portal.</p>



<p class="wp-block-paragraph">The API provides a wide range of functions; from simple actions like compiling a project to creating and configuring technology objects on a PLC. While there are some functions that cannot be done through Openness, most common operations are available, and more are added with every new release.</p>



<p class="wp-block-paragraph">In order to see what functions are available and how to use them, open up the <strong>Help Viewer</strong> (shown below) within TIA Portal, and find the section titled <strong>“Automating projects with scripts”</strong>. This section contains documentation on the various methods available. Each entry also includes simple code examples. The <strong>“Public API” </strong>and <strong>“Export/Import” </strong>sections are where the majority of these examples are located.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Siemens-Help-R_1.png" alt="Openness Siemens"/></figure>



<h2 class="wp-block-heading" id="h-advantages-of-openness">Advantages of Openness</h2>



<p class="wp-block-paragraph">At this point, you might be thinking “That sounds pretty nice, but how is this more useful than just programming in TIA Portal?” The main answer is <strong>scalability</strong>. Using Openness allows a user to automate time-consuming and tedious processes when working on a project. For example, your company may require a standardized code architecture for PLC projects. If that standard is replicated in Openness, one click could create the project, set up the architecture, add standard blocks from custom libraries, and add all the necessary GSD files.</p>



<p class="wp-block-paragraph">If a project is being created for multiple, mostly identical machines, Openness can simplify creating each specific project. Openness can create a&nbsp;base project, and then only the individual differences need to be implemented. If the differences between the machines are well defined, Openness can further simplify development. A custom application can provide the user with a list of different modules that are assigned to a specific machine. Openness would then be able to create the base project and add in any extra modules that have been defined. With this custom application, any changes to the code are only made in one place and can be easily redeployed.</p>



<h2 class="wp-block-heading" id="h-disadvantages-of-openness">Disadvantages of Openness</h2>



<p class="wp-block-paragraph">Openness is a very powerful tool and opens up many possibilities for custom applications. However, there are some cases where it does not make sense to use Openness. Since Openness uses XML files to generate objects and code, it requires becoming familiar with the Openness XML tags and structures.</p>



<p class="wp-block-paragraph">As we will discuss later, these XML files quickly become very large and complicated and require extensive expertise to be able to create and read them. Creating the XML from scratch is a long and difficult process, so it is generally preferred to create your necessary elements in TIA Portal, export them to XML, and use that as a starting point.</p>



<h2 class="wp-block-heading" id="h-conclusion">Conclusion</h2>



<p class="wp-block-paragraph">As I explained, Openness is a great tool for creating scalable and module code for TIA Portal. While it has a steeper learning curve than working exclusively in TIA Portal, it offers a large amount of flexibility and customization. If you find yourself creating similar projects on a regular basis, it is worth taking a look at how Openness can help you automate your process. In my next blog post, we’ll look at how to make sense of Openness’s XML files.</p>



<p class="wp-block-paragraph">Learn more about DMC&#8217;s <a href="/services/manufacturing-automation-and-intelligence/plc-programming">PLC Programming Services</a> and <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Portal Development Services</a>. <a href="/contact">Contact</a> us for help with your next project. </p>
<p>The post <a href="https://static.dmcinfo.com/blog/21661/advantages-disadvantages-of-siemens-tia-openness/">Advantages &#038; Disadvantages of Siemens&#8217; TIA Openness</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Make a Dynamically Linking Faceplate in Siemens&#8217; TIA Portal</title>
		<link>https://static.dmcinfo.com/blog/21684/how-to-make-a-dynamically-linking-faceplate-in-siemens-tia-portal/</link>
		
		<dc:creator><![CDATA[Joshua Zimmerle]]></dc:creator>
		<pubDate>Wed, 01 May 2019 07:56:59 +0000</pubDate>
				<category><![CDATA[HMI and SCADA]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[TIA Portal]]></category>
		<category><![CDATA[Visual Basic Scripting]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21684/how-to-make-a-dynamically-linking-faceplate-in-siemens-tia-portal/</guid>

					<description><![CDATA[<p>Thanks to TIA Portals development environment, laying out and linking a few objects on an HMI screen doesn’t take very much time. Though, this process starts to become tedious when there are many objects with many individual tag connections for visibility, location, and process values. Organizing HMI objects into faceplates simplifies and organizes the process [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21684/how-to-make-a-dynamically-linking-faceplate-in-siemens-tia-portal/">How to Make a Dynamically Linking Faceplate in Siemens&#8217; TIA Portal</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Thanks to <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">TIA Portals</a> development environment, laying out and linking a few objects on an HMI screen doesn’t take very much time. Though, this process starts to become tedious when there are many objects with many individual tag connections for visibility, location, and process values.</p>



<p class="wp-block-paragraph">Organizing HMI objects into faceplates simplifies and organizes the process but doesn’t help reduce the amount of PLC side logic or tag connections needed, for complex animations. This situation led me to use one of TIA Portal’s most powerful features,&nbsp;scripts,&nbsp;to take faceplates one step further and create a faceplate that can dynamically relink tags to HMI objects.</p>



<h2 class="wp-block-heading" id="h-why-faceplates">Why Faceplates?</h2>



<p class="wp-block-paragraph">First, allow me to describe the situation that led to the need for a completely dynamic faceplate. A client gave DMC a project that needed an HMI interface that allowed operators to add, remove and edit steps in a user-defined sequence. Each step in the sequence had a type and several Boolean, integer, and floating-point values that the operator alters to change setpoints for that step. Because only some of the settings were used in each step type, and there were a lot of settings, we decided that it would be simplest if the HMI displayed only the parameters relevant to the selected step type.</p>



<p class="wp-block-paragraph">The <strong>solution</strong> was to create a faceplate that interpreted a step’s mode dynamically, thus reducing the need for PLC side logic and linking countless individual tags to the ten steps we displayed on the screen.</p>



<h2 class="wp-block-heading" id="h-hmi-structure">HMI Structure</h2>



<p class="wp-block-paragraph">At a high level, think of the dynamic faceplate as a junction box that connects the HMI objects to different PLC tags, depending on the step type. The faceplate contains 21 objects, seven switches, seven drop-down menus, and seven IO fields, that are all linked to tags internal to the faceplate. The faceplate also has 15 interface connections, four Boolean, three Integer and eight Real, that can connect to PLC tags.</p>



<p class="wp-block-paragraph">When the faceplate receives a new mode, it pulls the values from the PLC tags and places those values in the corresponding HMI objects. When the value in an HMI object is changed, the faceplate pushes that value to the PLC’s corresponding tag.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Image-1-R-4.png" alt="TIA portal faceplates"/></figure>



<p class="wp-block-paragraph">The <strong>step type is a 32bit integer</strong> (it uses the lower 28 bits) that the faceplate interprets as seven, four bit, nibs. Each nib contains a number from 0-15 that corresponds to either a blank space or one of the 15 interface connections.</p>



<p class="wp-block-paragraph">So, for each zero&nbsp;the face plate receives it will display a blank space, and each number greater than zero it will display an HMI object corresponding that interface’s data type, IO fields for reals, dropdowns for integers, and switches for Booleans.</p>



<p class="wp-block-paragraph">The abbreviated code snippet below controls the visibility of the screen objects and passes the data from the screen object to the connection tag.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">VBScript</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>Sub SortField7()

Dim place 
place = SmartTags("diPlace8")
Dim bVBSwitch, bSwitch, bVBTitle, sTitle
Dim bVBDropDown, iDropDown, bVBIOField, rIOField

Select Case place: ' Switch1, DropDown1, IOField1
	Case 1:	'Bool 1
		bVBSwitch = 1 								'Show Switch 1
		bSwitch = SmartTags("Properties\bBool1")		'Move Switch 1 to Bool 1
		bVBTitle = 1									'Show Title 1
		sTitle = SmartTags("Properties\sBoolTitle1")	'Move Bool Title 1 to Title 1
		
	Case 2: 'Bool 2
		bVBSwitch = 1 
		bSwitch = SmartTags("Properties\bBool2") 		'Move Switch 1 to Bool 2
		bVBTitle = 1									'Show Title 1
		sTitle = SmartTags("Properties\sBoolTitle2")	'Move Bool Title 2 to Title 1
		
	'case3-4 Bool
		
	Case 5: 'Int 1
		bVBDropDown = 1
		iDropDown = SmartTags("Properties\iInt1")			' Move DrowDown 1 to Int 1
		bVBTitle = 1										'Show Title 1
		sTitle = SmartTags("Properties\sDropDownTitle1")	'Move Int Title 1 to Title 1
		
	'case6-7 Int
		
	Case 8: 'Real 1
		bVBIOField = 1
		rIOField =  SmartTags("Properties\rReal1")		' Move IOField 1 to Real 1
		bVBTitle = 1										'Show Title 1
		sTitle = SmartTags("Properties\sIOFieldTitle1")	'Move Real Title 1 to Title 1
		
	'case9-11 Real

End Select

SmartTags("bVBSwitch7") = CBool(bVBSwitch)
SmartTags("bSwitch7") = CBool(bSwitch)
SmartTags("bVBDropDown7") = CBool(bVBDropDown)
SmartTags("iDropDown7") = CInt(iDropDown)
SmartTags("bVBIOField7") = CBool(bVBIOField)
SmartTags("rIOfield7") = CDbl(rIOField)
SmartTags("bVBTitle7") = CBool(bVBTitle)
SmartTags("sTitle7") = CStr(sTitle)

End Sub</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #569CD6">Sub</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">SortField7</span><span style="color: #D4D4D4">()</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">Dim</span><span style="color: #9CDCFE"> place </span></span>
<span class="line"><span style="color: #9CDCFE">place</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;diPlace8&quot;</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #569CD6">Dim</span><span style="color: #9CDCFE"> bVBSwitch, bSwitch</span><span style="color: #D4D4D4">,</span><span style="color: #9CDCFE"> bVBTitle</span><span style="color: #D4D4D4">,</span><span style="color: #9CDCFE"> sTitle</span></span>
<span class="line"><span style="color: #569CD6">Dim</span><span style="color: #9CDCFE"> bVBDropDown, iDropDown</span><span style="color: #D4D4D4">,</span><span style="color: #9CDCFE"> bVBIOField</span><span style="color: #D4D4D4">,</span><span style="color: #9CDCFE"> rIOField</span></span>
<span class="line"></span>
<span class="line"><span style="color: #C586C0">Select</span><span style="color: #D4D4D4"> </span><span style="color: #C586C0">Case</span><span style="color: #D4D4D4"> place: </span><span style="color: #6A9955">&apos; Switch1, DropDown1, IOField1</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #C586C0">Case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">:	</span><span style="color: #6A9955">&apos;Bool 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBSwitch</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> 								</span><span style="color: #6A9955">&apos;Show Switch 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bSwitch</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\bBool1&quot;</span><span style="color: #D4D4D4">)		</span><span style="color: #6A9955">&apos;Move Switch 1 to Bool 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">									</span><span style="color: #6A9955">&apos;Show Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">sTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\sBoolTitle1&quot;</span><span style="color: #D4D4D4">)	</span><span style="color: #6A9955">&apos;Move Bool Title 1 to Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #C586C0">Case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">: </span><span style="color: #6A9955">&apos;Bool 2</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBSwitch</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bSwitch</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\bBool2&quot;</span><span style="color: #D4D4D4">) 		</span><span style="color: #6A9955">&apos;Move Switch 1 to Bool 2</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">									</span><span style="color: #6A9955">&apos;Show Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">sTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\sBoolTitle2&quot;</span><span style="color: #D4D4D4">)	</span><span style="color: #6A9955">&apos;Move Bool Title 2 to Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #6A9955">&apos;case3-4 Bool</span></span>
<span class="line"><span style="color: #D4D4D4">		</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #C586C0">Case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">5</span><span style="color: #D4D4D4">: </span><span style="color: #6A9955">&apos;Int 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBDropDown</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">iDropDown</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\iInt1&quot;</span><span style="color: #D4D4D4">)			</span><span style="color: #6A9955">&apos; Move DrowDown 1 to Int 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">										</span><span style="color: #6A9955">&apos;Show Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">sTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\sDropDownTitle1&quot;</span><span style="color: #D4D4D4">)	</span><span style="color: #6A9955">&apos;Move Int Title 1 to Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #6A9955">&apos;case6-7 Int</span></span>
<span class="line"><span style="color: #D4D4D4">		</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #C586C0">Case</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">8</span><span style="color: #D4D4D4">: </span><span style="color: #6A9955">&apos;Real 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBIOField</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">rIOField</span><span style="color: #D4D4D4"> =  </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\rReal1&quot;</span><span style="color: #D4D4D4">)		</span><span style="color: #6A9955">&apos; Move IOField 1 to Real 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">bVBTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">										</span><span style="color: #6A9955">&apos;Show Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #9CDCFE">sTitle</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;Properties\sIOFieldTitle1&quot;</span><span style="color: #D4D4D4">)	</span><span style="color: #6A9955">&apos;Move Real Title 1 to Title 1</span></span>
<span class="line"><span style="color: #D4D4D4">		</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #6A9955">&apos;case9-11 Real</span></span>
<span class="line"></span>
<span class="line"><span style="color: #C586C0">End Select</span></span>
<span class="line"></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;bVBSwitch7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CBool</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">bVBSwitch</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;bSwitch7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CBool</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">bSwitch</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;bVBDropDown7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CBool</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">bVBDropDown</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;iDropDown7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CInt</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">iDropDown</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;bVBIOField7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CBool</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">bVBIOField</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;rIOfield7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CDbl</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">rIOField</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;bVBTitle7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CBool</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">bVBTitle</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;sTitle7&quot;</span><span style="color: #D4D4D4">) = </span><span style="color: #DCDCAA">CStr</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">sTitle</span><span style="color: #D4D4D4">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">End Sub</span></span></code></pre></div>



<h2 class="wp-block-heading" id="h-visual-basic-scripts">Visual Basic Scripts</h2>



<p class="wp-block-paragraph">The faceplate uses <strong>two event-driven</strong>&nbsp;Visual Basic scripts. The first script, shown above, runs when the current step type changes and the second script runs when any of the HMI objects values&#8217; change. It’s important to note that the drop-down used to store the step type must be tied to a tag in the faceplate, not the interface tag tied to the PLC’s tag. If it’s tied to an interface tag, and the Visual Basic script uses the interface tag, then when a change event runs the script, the connection tag will have the old value from before the change.</p>



<p class="wp-block-paragraph"><strong>The key </strong>is to tie the HMI object’s Process Value to an interface tag for connection to the PLC as well as to a tag in the faceplate for uses in the faceplate.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/HMI-objects-TIA.png" alt="plc to hmi objects in tia portal"/></figure>



<p class="wp-block-paragraph">As mentioned, the first Visual Basic script runs when the step types&#8217; tag changes. It masks and shifts each nib to the left giving seven location modes each ranging from 0 to 15. Each location value is then passed into a switch case structure that hides the unused HMI objects, shows the used object (assuming there is one) and moves the current interface value into the HMI object’s process value.</p>



<p class="wp-block-paragraph">The second Visual Basic script, run when any of the HMI objects’ tags change, move the HMI objects’ process values into the interface tags, updating the PLC tags.</p>



<h2 class="wp-block-heading" id="h-uses">Uses</h2>



<p class="wp-block-paragraph">Because each of the seven locations on the HMI can be linked to any one of 15 different tags or left blank, there are a lot of possible modes, 268,435,456 in fact. Finding the desired modes and copying those into a project is not a trivial task.</p>



<p class="wp-block-paragraph">To simplify the process, I generated a spreadsheet, seen below,&nbsp;that can convert layouts into and back from step type numbers. To create a list of step types you have to fill in each row with the tags you want to appear on the HMI, and then copy the list of types and names into an HMI text list.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/image-4-R-4.png" alt="tags"/></figure>



<h2 class="wp-block-heading" id="h-conclusion">Conclusion</h2>



<p class="wp-block-paragraph">This dynamic faceplate demonstrates how using Visual Basic scripts within faceplates can further increase faceplates versatility and capability, reducing project-specific complexity and needed PLC logic. With this tutorial, you should have all the ideas and information you need to make your own dynamically linked faceplate for specific or general applications speeding up complex HMI development.</p>



<p class="wp-block-paragraph"><a href="/contact">Contact</a> DMC for more information on our <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming/">Siemens TIA Portal</a> Expertise.</p>



<p class="wp-block-paragraph">Learn more about our <a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming">HMI &amp; SCADA Services</a>.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21684/how-to-make-a-dynamically-linking-faceplate-in-siemens-tia-portal/">How to Make a Dynamically Linking Faceplate in Siemens&#8217; TIA Portal</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
