<?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>Libraries Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/tag/libraries/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Mon, 15 Jun 2026 16:01:54 +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>Libraries Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Setting Up Symbolic Links for Shared Project Libraries Across Ignition 8.3 Gateways</title>
		<link>https://static.dmcinfo.com/blog/44390/symbolic-links-shared-ignition-project-libraries/</link>
		
		<dc:creator><![CDATA[Wenjing Deng]]></dc:creator>
		<pubDate>Fri, 15 May 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Ignition]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[GIT]]></category>
		<category><![CDATA[ignition]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Workflows]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/?p=44390</guid>

					<description><![CDATA[<p>Ignition 8.3’s file-based project structure makes it practical to treat gateway resources as standard source-controlled assets, allowing teams to track changes in Git, review diffs, and modify certain files directly outside of the Designer when needed. This level of transparency and control significantly improves the development workflow. In a recent Ignition 8.3 project, we had [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/44390/symbolic-links-shared-ignition-project-libraries/">Setting Up Symbolic Links for Shared Project Libraries Across Ignition 8.3 Gateways</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Ignition 8.3’s file-based project structure makes it practical to treat gateway resources as standard source-controlled assets, allowing teams to track changes in Git, review diffs, and modify certain files directly outside of the Designer when needed. This level of transparency and control significantly improves the development workflow.</p>



<p class="wp-block-paragraph">In a recent Ignition 8.3 project, we had two gateways in a single Git repository that needed to share library elements. While 8.3 enables a more Git-centric workflow, it does not provide a built-in mechanism to keep shared resources synchronized across multiple gateways. Without an automatic way to manage this, shared libraries can quickly drift and become difficult to maintain.</p>



<p class="wp-block-paragraph">We addressed this by creating symbolic links from each gateway’s library folders to a shared “source of truth” directory. A <strong>symbolic link</strong> (symlink) is a special file that points to another file or folder—like a shortcut at the filesystem level. When you access it, the system transparently redirects you to the target location. This approach allows both gateways to reference the same underlying files while still fitting cleanly into a Git-based workflow, making it a simple, low-friction way to keep shared resources consistent.</p>



<p class="wp-block-paragraph">This blog walks through how to set up shared libraries between two Ignition gateways in a single Git repository using symlinks on Windows, helping you avoid duplication and keep shared code synchronized in one place.</p>



<p class="wp-block-paragraph">With this setup, any time a symlinked file is modified in a Designer and saved, it’s immediately overwritten in the shared “source of truth” location. After changes are made and tested in one gateway project’s Designer, the files can be committed and pushed to the repo as usual.</p>



<p class="wp-block-paragraph">We’ll walk through setting up a shared script library folder as an example. You can use the same pattern to share views, styles, and additional files as needed for your project.</p>



<h2 class="wp-block-heading" id="h-what-are-symbolic-links">What are Symbolic Links?</h2>



<p class="wp-block-paragraph">A symbolic link, often referred to as a <strong>symlink</strong>, is a reference point in a filesystem that points one file or folder to another location. Instead of duplicating the files, a symlink acts as a pointer. When an application accesses the symlinked path, the operating system (OS) redirects it to the target destination.</p>



<p class="wp-block-paragraph">In Ignition 8.3, a symlinked folder behaves exactly like a project directory. Associated scripts, views, and resources load as one would expect; however, the actual files live somewhere else in the filesystem.</p>



<h2 class="wp-block-heading" id="h-sample-repository-structure">Sample Repository Structure</h2>



<p class="wp-block-paragraph">Here is a visual representation of what the structure would look like after the symlinks are set up. The file structure for <strong>gateway1</strong> and <strong>gateway2</strong> down to script-python is default to ignition. You will have to create the “shared” folder location and structure manually in your repo, and you can organize it anyway you want.</p>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)"><strong>repo/<br>└── gateways/<br>&nbsp; &nbsp;├── shared/<br>&nbsp; &nbsp;│ &nbsp; └── script-python/<br>&nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; └── library/ (real files live here for this example)<br>&nbsp; &nbsp;│<br>&nbsp; &nbsp;├── gateway1/<br>&nbsp; &nbsp;│ &nbsp; └── projects/<br>&nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; └── project1/<br>&nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; └── ignition/<br>&nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; └── script-python/<br>&nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; └── library/ -&gt; symlink to ../../../../../shared/script-python/library<br>&nbsp; &nbsp;│<br>&nbsp; &nbsp;└── gateway2/<br>&nbsp; &nbsp; &nbsp; &nbsp;└── projects/<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── project2/<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── ignition/<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── script-python/<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── library/ -&gt; symlink to ../../../../../shared/script-python/library</strong></p>



<h2 class="wp-block-heading" id="h-setup-steps-for-windows">Setup Steps for Windows</h2>



<p class="wp-block-paragraph">Before creating any symbolic links, complete the following one-time setup steps. <strong>Every developer working with this repository must perform these steps on their local machine</strong>. Skipping them can result in broken links when the repo is cloned or checked out.</p>



<h3 class="wp-block-heading" id="h-prerequisites">Prerequisites</h3>



<p class="wp-block-paragraph"><strong>1. Enable Git symlink support</strong></p>



<p class="wp-block-paragraph">By default, Git on Windows may treat symlinks as plain text files. This setting ensures symlinks are created and checked out correctly.</p>



<p class="wp-block-paragraph">Run the following command in <strong>Git Bash</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(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">C</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>git config --global core.symlinks true</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: #D4D4D4">git config --global core.symlinks </span><span style="color: #569CD6">true</span></span></code></pre></div>



<figure class="wp-block-image aligncenter size-full has-custom-border"><img fetchpriority="high" decoding="async" width="1082" height="209" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-1.png" alt="Open command window with Git command to enable the use of symbolic links across all repositories on a machine." class="wp-image-44460" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-1.png 1082w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-1-300x58.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-1-1024x198.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-1-768x148.png 768w" sizes="(max-width: 1082px) 100vw, 1082px" /></figure>



<p class="wp-block-paragraph"><strong>2. Enable Windows Developer Mode</strong></p>



<p class="wp-block-paragraph">Developer Mode<strong> </strong>allows non-admin users to create symbolic links without permission-related issues.</p>



<p class="wp-block-paragraph"><strong>Settings &gt; Privacy &amp; Security &gt; For Developers &gt; Developer Mode</strong></p>



<p class="wp-block-paragraph">Turn Developer Mode <strong>on</strong>.</p>



<p class="wp-block-paragraph"><strong>3. Restart your computer</strong></p>



<p class="wp-block-paragraph">Restarting your computer ensures Developer Mode is fully applied before creating symlinks.</p>



<figure class="wp-block-image aligncenter size-full is-resized has-custom-border"><img decoding="async" width="624" height="387" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-2.png" alt="Advanced system settings in Windows, specifically highlighting options for developers and terminal management." class="wp-image-44414" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px;aspect-ratio:1.6124476361460203;width:624px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-2.png 624w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-2-300x186.png 300w" sizes="(max-width: 624px) 100vw, 624px" /></figure>



<h2 class="wp-block-heading" id="h-initial-creation-of-symbolic-links">Initial Creation of Symbolic Links</h2>



<p class="wp-block-paragraph">Follow the steps below to set up the initial symlinks for the <code>script-python</code> library folder in our example. The same approach can be used for other shared resources.</p>



<h3 class="wp-block-heading" id="h-gateway-1"><strong>Gateway 1:</strong></h3>



<p class="wp-block-paragraph"><strong>1. Open Command Prompt as an Administrator</strong></p>



<p class="wp-block-paragraph"><strong>2. Navigate to the target directory for your symbolic links</strong></p>



<p class="wp-block-paragraph" style="padding-top:0;padding-bottom:var(--wp--preset--spacing--40)">Move to the directory where the symlink will live in <strong>Gateway 1</strong>: <em><strong>cd gateways\gateway1\projects\project1\ignition\script-python</strong></em></p>



<figure class="wp-block-image aligncenter size-large is-resized has-custom-border" style="margin-top:0;margin-bottom:var(--wp--preset--spacing--60)"><img decoding="async" width="1024" height="129" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-3-1024x129.png" alt="Administrator: Command Prompt window active in a specific directory path." class="wp-image-44417" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px;aspect-ratio:7.9392168322618355;object-fit:cover;width:691px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-3-1024x129.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-3-300x38.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-3-768x97.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-3.png 1444w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph" style="padding-top:0;padding-bottom:var(--wp--preset--spacing--40)"><strong>3. Move any existing library files:</strong></p>



<p class="wp-block-paragraph" style="padding-top:0;padding-bottom:var(--wp--preset--spacing--40)">If you already have files in the library folder and/or the library folder exists, move the entire library folder to the shared directory<span style="box-sizing: border-box; margin: 0px; padding: 0px;">&nbsp;at&nbsp;<em><strong>gateways/shared/script-python</strong></em></span>. If not, skip this step.</p>



<p class="wp-block-paragraph" style="padding-top:0;padding-bottom:var(--wp--preset--spacing--40)">If you leave the library folder here: <em><strong>\gateways\gateway1\projects\project1\ignition\script-python</strong>. </em>The following error will occur because Windows cannot create a link where a directory already exists:</p>



<figure class="wp-block-image aligncenter size-full has-custom-border" style="margin-top:0;margin-bottom:var(--wp--preset--spacing--60)"><img decoding="async" width="2306" height="161" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-4.png" alt="The error message &quot;Cannot create a file when that file already exists&quot; indicates that a symbolic link or file named library already exists in the destination directory." class="wp-image-44419" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px;aspect-ratio:14.424507658643327" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-4.png 2306w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-4-300x21.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-4-1024x71.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-4-768x54.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-4-1536x107.png 1536w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-4-2048x143.png 2048w" sizes="(max-width: 2306px) 100vw, 2306px" /></figure>



<p class="wp-block-paragraph" style="padding-top:0;padding-bottom:var(--wp--preset--spacing--40)"><strong>4. Create the symbolic link</strong></p>



<p class="wp-block-paragraph" style="padding-top:0;padding-bottom:0">Run the command below to create the symlink linked to the actual files in the shared location:</p>



<p class="wp-block-paragraph"><em><strong>mklink /D library &#8230;&#8230;&#8230;.\shared\script-python\library</strong></em></p>



<figure class="wp-block-image aligncenter size-full has-custom-border" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--60)"><img decoding="async" width="2325" height="293" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-5.png" alt="GIT command used to successfully create a symbolic link to a folder." class="wp-image-44421" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-5.png 2325w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-5-300x38.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-5-1024x129.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-5-768x97.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-5-1536x194.png 1536w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-5-2048x258.png 2048w" sizes="(max-width: 2325px) 100vw, 2325px" /></figure>



<p class="wp-block-paragraph"><strong>5. Verify the symlink was created successfully</strong></p>



<p class="wp-block-paragraph">Verify the link has been created by running the command <em>dir</em> at the symlink location in the command prompt. If the symlink was created correctly, then you should see it in your output.</p>



<figure class="wp-block-image aligncenter size-full has-custom-border" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--60)"><img decoding="async" width="1950" height="499" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-6-1-e1778267616906.png" alt="A [dir] command output shows a directory listing in a Windows Command Prompt, highlighting a symbolic link." class="wp-image-44422" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-6-1-e1778267616906.png 1950w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-6-1-e1778267616906-300x77.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-6-1-e1778267616906-1024x262.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-6-1-e1778267616906-768x197.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-6-1-e1778267616906-1536x393.png 1536w" sizes="(max-width: 1950px) 100vw, 1950px" /></figure>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--40)">In addition, you can visually verify that the folder was created correctly in File Explorer by looking for the arrow icon in the bottom left. When you double-click into this symlinked folder, it will take you to the location it is linked to.</p>



<figure class="wp-block-image aligncenter size-full has-custom-border" style="margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--60)"><img decoding="async" width="650" height="271" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/Picture12.png" alt="Windows 11 File Explorer window for a directory named script-python." class="wp-image-44431" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/Picture12.png 650w, https://static.dmcinfo.com/wp-content/uploads/2026/05/Picture12-300x125.png 300w" sizes="(max-width: 650px) 100vw, 650px" /></figure>



<h3 class="wp-block-heading" id="h-gateway-2">Gateway 2</h3>



<p class="wp-block-paragraph">Repeat the same steps for <strong>Gateway 2</strong>, adjusting the path as needed:</p>



<p class="wp-block-paragraph"><em><strong>cd gateways\gateway2\projects\project2\ignition\script-python</strong></em></p>



<p class="wp-block-paragraph">Create the symlink pointing to the same library location.</p>



<p class="wp-block-paragraph">Once both gateways are linked, the shared library folder is ready for use. Any changes made through one gateway’s <strong>Ignition Designer</strong> will be written directly to the shared directory and can be committed to Git as usual.</p>



<h2 class="wp-block-heading" id="h-ignition-designer-gateway-refresh-and-test">Ignition Designer/Gateway Refresh and Test</h2>



<p class="wp-block-paragraph">After creating the symbolic links, the final step is to confirm that Ignition detects and uses the shared files properly. Because Ignition doesn’t automatically reload filesystem changes, users must manually initiate file and project scans to update each gateway.</p>



<p class="wp-block-paragraph"><strong>1. Close all open Ignition Designer sessions</strong></p>



<p class="wp-block-paragraph">Closing active sessions of Designer resolves any potential validation interference caused by cached projects.</p>



<p class="wp-block-paragraph"><strong>2. Trigger file and project scans on both Gateways</strong></p>



<p class="wp-block-paragraph">On each gateway, run the following:</p>



<ul class="wp-block-list">
<li>Platform → Overview →<strong> Scan File System</strong></li>



<li>Platform → System → Projects → <strong>Scan Projects</strong></li>
</ul>



<p class="wp-block-paragraph"><strong>3. Open Ignition Designer for Gateway 1</strong></p>



<ul class="wp-block-list">
<li>Create a new script or modify an existing script in the share library.</li>



<li>Save the changes.</li>
</ul>



<p class="wp-block-paragraph"><strong>4. Refresh Gateway 2</strong></p>



<ul class="wp-block-list">
<li style="padding-bottom:var(--wp--preset--spacing--40)">From the <strong>Gateway 2</strong> web UI, trigger both the file system scan and project scan again.</li>
</ul>



<p class="wp-block-paragraph"><strong>5. Open Ignition Developer for Gateway 2</strong></p>



<ul class="wp-block-list">
<li style="padding-bottom:var(--wp--preset--spacing--40)">Open Ignition Developer for the second Gateway and verify that the adjustments are present.</li>
</ul>



<figure class="wp-block-image aligncenter size-full is-resized has-custom-border"><img decoding="async" width="1124" height="218" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-8.png" alt="Platform File Scan button in Ignition 8.3" class="has-border-color has-custom-light-gray-neutral-2-border-color wp-image-44424" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px;width:1200px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-8.png 1124w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-8-300x58.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-8-1024x199.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-8-768x149.png 768w" sizes="(max-width: 1124px) 100vw, 1124px" /><figcaption class="wp-element-caption">Platform File Scan Button</figcaption></figure>



<figure class="wp-block-image aligncenter size-full is-resized has-custom-border"><img decoding="async" width="1128" height="265" src="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-9.png" alt="Project File Scan button in Ignition 8.3" class="has-border-color has-custom-light-gray-neutral-2-border-color wp-image-44426" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px;width:1200px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-9.png 1128w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-9-300x70.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-9-1024x241.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/05/ignition-8.3-symlinks-image-9-768x180.png 768w" sizes="(max-width: 1128px) 100vw, 1128px" /><figcaption class="wp-element-caption">Project File Scan Button</figcaption></figure>



<p class="wp-block-paragraph">Now the library symlinks are set up and ready for use. If the changes appear as expected, the symbolic link configuration is working correctly, and both gateways are pulling from the same shared source of truth. Once validated, follow your project&#8217;s specific git workflow to push these changes to your repository.</p>



<h2 class="wp-block-heading" id="h-final-thoughts-and-best-practices">Final Thoughts and Best Practices</h2>



<p class="wp-block-paragraph">It&#8217;s important to keep in mind that whenever a file in the gateway filesystem is changed, the gateway doesn’t automatically update to reflect those changes. You will need to perform two file scans for the latest changes to be reflected. The screenshots below show where to trigger these scans.</p>



<p class="wp-block-paragraph">At some point during testing, you may need to view/test a library file in both gateways. In this scenario, it is important to regularly perform the above file and project scans, as changes are being made and saved. Below is an example of a possible order of operations:</p>



<ol class="wp-block-list">
<li>Make changes to library file in <strong>Gateway 1</strong> project designer.</li>



<li>Save changes to library file in <strong>Gateway 1</strong> project designer.</li>



<li>Open <strong>Gateway 2</strong> webpage UI.</li>



<li>Press <strong>Scan File System</strong> on both <strong>Platform</strong> <strong>&gt; Overview</strong> page and <strong>Platform &gt; System &gt; Projects</strong> page for <strong>Gateway 2</strong>.</li>



<li>Open a fresh designer session of <strong>Gateway 2’s</strong> project to view latest changes.</li>
</ol>



<p class="wp-block-paragraph">Keep in mind that if changes are made in both gateways to the same library object, the last place it was saved will be the effective, latest state of the file. In the above example, if a change is made in <strong>Gateway 2’s</strong> project designer session and saved there, <strong>Gateway 1</strong> would have stale library files internally, requiring file scans to refresh them.</p>



<p class="wp-block-paragraph">To avoid accidentally overwriting changes, the best practice is to separate work into separate commits and modify a given shared file from only one gateway at a time.</p>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--40)">Finally, make sure the other developers run through the setup steps on their machines to avoid accidentally breaking any symbolic links during initial setup.</p>



<div class="wp-block-group alignwide has-custom-light-blue-background-color has-background is-layout-flow wp-container-core-group-is-layout-dbd34961 wp-block-group-is-layout-flow" style="border-radius:20px;margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50);padding-top:var(--wp--preset--spacing--50);padding-right:0;padding-bottom:var(--wp--preset--spacing--50);padding-left:0">
<div class="wp-block-columns alignwide are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-43efaee5 wp-block-columns-is-layout-flex" style="padding-right:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--60)">
<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:85%">
<h3 class="wp-block-heading has-text-align-left" id="h-have-an-upcoming-project-dmc-can-help-you-take-the-next-step">Planning your next automation project? DMC can help you take the next step.</h3>



<p class="has-text-align-left wp-block-paragraph" id="h-need-help-turning-ideas-into-outcomes-automation-project-to-the-next-level-contact-us-today-to-learn-more-about-our-solutions-and-how-we-can-help-you-achieve-your-goals">Get expert <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/">Automation</a> engineering and <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/ignition-programming/">Ignition Programming</a> solutions from DMC. Talk with an Ignition expert today.</p>
</div>



<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:15%">
<div class="wp-block-buttons is-horizontal is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-2236275c wp-block-buttons-is-layout-flex">
<div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-base-contrast-color has-text-color has-link-color wp-element-button" href="https://static.dmcinfo.com/contact/">Contact Us</a></div>
</div>
</div>
</div>
</div>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://static.dmcinfo.com/blog/44390/symbolic-links-shared-ignition-project-libraries/">Setting Up Symbolic Links for Shared Project Libraries Across Ignition 8.3 Gateways</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Getting Started with WinCC OA: Part 8 &#8211; Libraries</title>
		<link>https://static.dmcinfo.com/blog/20658/getting-started-with-wincc-oa-part-8-libraries/</link>
		
		<dc:creator><![CDATA[Nick Leisle]]></dc:creator>
		<pubDate>Wed, 23 Oct 2019 11:47:40 +0000</pubDate>
				<category><![CDATA[HMI and SCADA]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[WinCC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/20658/getting-started-with-wincc-oa-part-8-libraries/</guid>

					<description><![CDATA[<p>Welcome back to “Getting Started with WinCC OA”! If you aren’t familiar with the series’ previous topics, I recommend that you read the respective installments before proceeding: Now that we have a basic understanding of scripting and how to interact with datapoints, we’re ready to move beyond panel scripting environments and create globally accessible code. [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/20658/getting-started-with-wincc-oa-part-8-libraries/">Getting Started with WinCC OA: Part 8 &#8211; Libraries</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Welcome back to “Getting Started with WinCC OA”! If you aren’t familiar with the series’ previous topics, I recommend that you read the respective installments before proceeding:</p>



<ul class="wp-block-list">
<li><a href="/latest-thinking/blog/id/9870/getting-started-with-wincc-oa-part-1--creating-opening-a-project">Part 1: Creating and Opening a Project</a></li>



<li><a href="/latest-thinking/blog/id/9871/getting-started-with-wincc-oa-part-2--folder-structure-gedi-layout">Part 2: Folder Structure and Gedi Layout</a></li>



<li><a href="/latest-thinking/blog/id/9884/getting-started-with-wincc-oa-part-3--panels-the-basics">Part 3: Panels | The Basics</a></li>



<li><a href="/latest-thinking/blog/id/9893/getting-started-with-wincc-oa-part-4--panel-scripting-environments-and-quicktest">Part 4: Panel Scripting Environments and QuickTest</a></li>



<li><a href="/latest-thinking/blog/id/9906/getting-started-with-wincc-oa-part-5--scripting-syntax">Part 5: Scripting Syntax</a></li>



<li><a href="/latest-thinking/blog/id/9921/getting-started-with-wincc-oa-part-6--para-overview-and-datapoint-creation">Part 6: Para Overview and Datapoint Creation</a></li>



<li><a href="/latest-thinking/blog/id/9944/getting-started-with-wincc-oa-part-7--interacting-with-datapoints-via-scripting">Part 7: Interacting with Datapoints via Scripting</a></li>
</ul>



<p class="wp-block-paragraph">Now that we have a basic understanding of scripting and how to interact with datapoints, we’re ready to move beyond panel scripting environments and create globally accessible code. In Part 8 of “Getting Started with WinCC OA,” we’ll explore how we can use libraries to create globally accessible functions, enumerations, constants, etc.</p>



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



<p class="wp-block-paragraph">Control libraries are files that hold code that may be accessed by other scripts within a project. Simply put, they hold globally usable code. One may ask, “Why would we want to use libraries?”</p>



<p class="wp-block-paragraph">Libraries prevent developers from having to rewrite or copy/paste existing code, allow changes to be made quickly and efficiently, and ensure consistency within a project. Let’s jump back quickly to the example used in “Part 7: Interacting with Datapoints via Scripting.” Say we used the same enumeration “StatusType” in several panels in addition to the one we created.</p>



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



<p class="wp-block-paragraph">Without libraries, we’d need to copy and paste this enumeration in all of our panels’ ScopeLibs for further use. If we wanted to alter the enumeration to:</p>



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



<p class="wp-block-paragraph">We’d need to remember every instance of where this function was used, go back in the code, and modify StatusType appropriately. When the number of places we use StatusType increases, the more re-work would be needed to make the change.</p>



<h2 class="wp-block-heading" id="h-how-are-libraries-made">How are Libraries Made?</h2>



<p class="wp-block-paragraph">To create a control library, simply right click “Libraries” in the project view tree and select “Add New CTRL Library.”</p>



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



<p class="wp-block-paragraph">Anything created in the resulting .ctl file can be appropriately referenced throughout the program. To continue from Part 7&#8217;s example, we’ll generate two .ctl files: one for a global<strong> StatusType</strong> and another for <strong>device colors.</strong></p>



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



<p class="wp-block-paragraph"><strong>StatusType.ctl should contain:</strong></p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/statustype-ctl.png" alt="status type stl"/></figure>



<p class="wp-block-paragraph"><strong>ColorConst.ctl should have:</strong></p>



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



<p class="wp-block-paragraph">None of these libraries do anything, however, if they’re not implemented within a program.</p>



<h2 class="wp-block-heading" id="h-how-is-library-content-implemented">How is Library Content Implemented?</h2>



<p class="wp-block-paragraph">Libraries are not initially accessible from a program’s script. The control library file must first be loaded into a project for it to be usable. To do so, you must implement the following line:</p>



<pre class="wp-block-code"><code>
	#uses &lt;.ctl file&gt;
</code></pre>



<p class="wp-block-paragraph">Once a control file is specified, a script may use any and all items within said .ctl file. To implement our control libraries within our example, we’ll modify our ScopeLib’s code as follows:</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">Python</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>#uses "StatusType"
#uses "ColorConst"

//=============================== Panel initialization =========================================
initializePanel()
{
  //Whenever rSpeed or rMaxSpeed changes, call the function "onSpeedChange"
  dpConnect("onSpeedChange", "myMotor.rSpeed", "myMotor.rMaxSpeed");

  //Whenever iStatus changes, call the function "onStatusChange"
  dpConnect("onStatusChange", "myMotor.iStatus");
}


//=============================== Text Field Command =========================================
//Textbox is selected and user keys "Enter"
void textboxCmd()
{
  //Assign the textbox's text value to rMaxSpeed
  dpSet("myMotor.rMaxSpeed", maxSpeedTextbox.text);
}


//=============================== On Speed / Max Speed Value Change =================================
void onSpeedChange(string speedDp, float speedValue, string maxSpeedDp, float maxSpeedValue)
{
  //Define the variable whose value will be assigned to iStatus
  int iStatusValue;

  //Determine what value to assign iStatusValue (and subsequently "myMotor.iStatus")
  switch (speedValue)
  {
    //If "myMotor.rSpeed" is 0, set iStatusValue to 0
    case 0:
      iStatusValue = (int)StatusType::Stopped;
      break;

    //Otherwise, if "myMotor.rSpeed" > "myMotor.rMaxSpeed", set iStatusValue to Estop status int
    //           if not, set iStatusValue to Forward status int
    default:
      iStatusValue = (speedValue >= maxSpeedValue) ? (int)StatusType::Estop : (int)StatusType::Forward;
      break;
  }

  //Assign iStatusValue's value to "myMotor.iStatus"
  dpSet("myMotor.iStatus", iStatusValue);

  //Set the maxSpeedTextbox and speedTextbox's test to their respective values
  //NOTE: dpValToString ensures the units we assigned earlier in the series are displayed.
  //      Simply using &lt;Textbox>.text = &lt;speedValue> will work, but will not display appropriate units
  maxSpeedTextbox.text = dpValToString("myMotor.rMaxSpeed", maxSpeedValue, true);
  speedTextbox.text = dpValToString("myMotor.rSpeed", speedValue, true);
}

//=============================== On Status Change =========================================
void onStatusChange(string statusDp, int statusValue)
{
  //Define the variable whose value will be assigned to the rectangle's color property
  string rectangleColor;

  //Determine color to assign to rectangle based off iStatus
  if (statusValue == (int)StatusType::Stopped)
  {
    rectangleColor = STOPPED_COLOR;
  }

  if (statusValue == (int)StatusType::Estop)
  {
    rectangleColor = ESTOPPED_COLOR;
  }

  if (statusValue == (int)StatusType::Forward)
  {
    rectangleColor = FORWARD_COLOR;
  }

  //Assign selected color to rectangle
  setValue("rectangle", "backCol", rectangleColor);
}</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: #6A9955">#uses &quot;StatusType&quot;</span></span>
<span class="line"><span style="color: #6A9955">#uses &quot;ColorConst&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">//=============================== Panel initialization =========================================</span></span>
<span class="line"><span style="color: #D4D4D4">initializePanel()</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  //Whenever rSpeed </span><span style="color: #569CD6">or</span><span style="color: #D4D4D4"> rMaxSpeed changes, call the function </span><span style="color: #CE9178">&quot;onSpeedChange&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">  dpConnect(</span><span style="color: #CE9178">&quot;onSpeedChange&quot;</span><span style="color: #D4D4D4">, </span><span style="color: #CE9178">&quot;myMotor.rSpeed&quot;</span><span style="color: #D4D4D4">, </span><span style="color: #CE9178">&quot;myMotor.rMaxSpeed&quot;</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  //Whenever iStatus changes, call the function </span><span style="color: #CE9178">&quot;onStatusChange&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">  dpConnect(</span><span style="color: #CE9178">&quot;onStatusChange&quot;</span><span style="color: #D4D4D4">, </span><span style="color: #CE9178">&quot;myMotor.iStatus&quot;</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">//=============================== Text Field Command =========================================</span></span>
<span class="line"><span style="color: #D4D4D4">//Textbox </span><span style="color: #569CD6">is</span><span style="color: #D4D4D4"> selected </span><span style="color: #569CD6">and</span><span style="color: #D4D4D4"> user keys </span><span style="color: #CE9178">&quot;Enter&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">void textboxCmd()</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  //Assign the textbox</span><span style="color: #CE9178">&apos;s text value to rMaxSpeed</span></span>
<span class="line"><span style="color: #D4D4D4">  dpSet(</span><span style="color: #CE9178">&quot;myMotor.rMaxSpeed&quot;</span><span style="color: #D4D4D4">, maxSpeedTextbox.text);</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">//=============================== On Speed / Max Speed Value Change =================================</span></span>
<span class="line"><span style="color: #D4D4D4">void onSpeedChange(string speedDp, </span><span style="color: #4EC9B0">float</span><span style="color: #D4D4D4"> speedValue, string maxSpeedDp, </span><span style="color: #4EC9B0">float</span><span style="color: #D4D4D4"> maxSpeedValue)</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  //Define the variable whose value will be assigned to iStatus</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4"> iStatusValue;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  //Determine what value to assign iStatusValue (</span><span style="color: #C586C0">and</span><span style="color: #D4D4D4"> subsequently </span><span style="color: #CE9178">&quot;myMotor.iStatus&quot;</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">  switch (speedValue)</span></span>
<span class="line"><span style="color: #D4D4D4">  {</span></span>
<span class="line"><span style="color: #D4D4D4">    //If </span><span style="color: #CE9178">&quot;myMotor.rSpeed&quot;</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">is</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">, </span><span style="color: #4EC9B0">set</span><span style="color: #D4D4D4"> iStatusValue to </span><span style="color: #B5CEA8">0</span></span>
<span class="line"><span style="color: #D4D4D4">    case </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">      iStatusValue = (</span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4">)StatusType::Stopped;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    //Otherwise, </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;myMotor.rSpeed&quot;</span><span style="color: #D4D4D4"> &gt; </span><span style="color: #CE9178">&quot;myMotor.rMaxSpeed&quot;</span><span style="color: #D4D4D4">, </span><span style="color: #4EC9B0">set</span><span style="color: #D4D4D4"> iStatusValue to Estop status </span><span style="color: #4EC9B0">int</span></span>
<span class="line"><span style="color: #D4D4D4">    //           </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">not</span><span style="color: #D4D4D4">, </span><span style="color: #4EC9B0">set</span><span style="color: #D4D4D4"> iStatusValue to Forward status </span><span style="color: #4EC9B0">int</span></span>
<span class="line"><span style="color: #D4D4D4">    default:</span></span>
<span class="line"><span style="color: #D4D4D4">      iStatusValue = (speedValue &gt;= maxSpeedValue) </span><span style="color: #F44747">?</span><span style="color: #D4D4D4"> (</span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4">)StatusType::Estop : (</span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4">)StatusType::Forward;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #C586C0">break</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  //Assign iStatusValue</span><span style="color: #CE9178">&apos;s value to &quot;myMotor.iStatus&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">  dpSet(</span><span style="color: #CE9178">&quot;myMotor.iStatus&quot;</span><span style="color: #D4D4D4">, iStatusValue);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  //Set the maxSpeedTextbox </span><span style="color: #569CD6">and</span><span style="color: #D4D4D4"> speedTextbox</span><span style="color: #CE9178">&apos;s test to their respective values</span></span>
<span class="line"><span style="color: #D4D4D4">  //NOTE: dpValToString ensures the units we assigned earlier </span><span style="color: #569CD6">in</span><span style="color: #D4D4D4"> the series are displayed.</span></span>
<span class="line"><span style="color: #D4D4D4">  //      Simply using &lt;Textbox&gt;.text = &lt;speedValue&gt; will work, but will </span><span style="color: #569CD6">not</span><span style="color: #D4D4D4"> display appropriate units</span></span>
<span class="line"><span style="color: #D4D4D4">  maxSpeedTextbox.text = dpValToString(</span><span style="color: #CE9178">&quot;myMotor.rMaxSpeed&quot;</span><span style="color: #D4D4D4">, maxSpeedValue, true);</span></span>
<span class="line"><span style="color: #D4D4D4">  speedTextbox.text = dpValToString(</span><span style="color: #CE9178">&quot;myMotor.rSpeed&quot;</span><span style="color: #D4D4D4">, speedValue, true);</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">//=============================== On Status Change =========================================</span></span>
<span class="line"><span style="color: #D4D4D4">void onStatusChange(string statusDp, </span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4"> statusValue)</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  //Define the variable whose value will be assigned to the rectangle</span><span style="color: #CE9178">&apos;s color property</span></span>
<span class="line"><span style="color: #D4D4D4">  string rectangleColor;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  //Determine color to assign to rectangle based off iStatus</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (statusValue == (</span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4">)StatusType::Stopped)</span></span>
<span class="line"><span style="color: #D4D4D4">  {</span></span>
<span class="line"><span style="color: #D4D4D4">    rectangleColor = STOPPED_COLOR;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (statusValue == (</span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4">)StatusType::Estop)</span></span>
<span class="line"><span style="color: #D4D4D4">  {</span></span>
<span class="line"><span style="color: #D4D4D4">    rectangleColor = ESTOPPED_COLOR;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (statusValue == (</span><span style="color: #4EC9B0">int</span><span style="color: #D4D4D4">)StatusType::Forward)</span></span>
<span class="line"><span style="color: #D4D4D4">  {</span></span>
<span class="line"><span style="color: #D4D4D4">    rectangleColor = FORWARD_COLOR;</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">  //Assign selected color to rectangle</span></span>
<span class="line"><span style="color: #D4D4D4">  setValue(</span><span style="color: #CE9178">&quot;rectangle&quot;</span><span style="color: #D4D4D4">, </span><span style="color: #CE9178">&quot;backCol&quot;</span><span style="color: #D4D4D4">, rectangleColor);</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



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



<ul class="wp-block-list">
<li>I added the #uses prompts</li>



<li>I removed StatusType enum definition from ScopeLib (since it’s applied via library)</li>



<li>I added color constants (also applied via library)</li>
</ul>



<p class="wp-block-paragraph">With the color constants and StatusType enum defined in libraries, other panels and scripts may use them at will.</p>



<p class="wp-block-paragraph">Now that we have a solid understanding of how to make and implement control libraries, we’ll continue in our OA exploration by investigating color databases and learning how we can use them to create and use custom colors.</p>



<p class="wp-block-paragraph"><strong>Topics to look forward to in this series:&nbsp;</strong></p>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/10093/getting-started-with-wincc-oa-part-9--color-database-and-high-performance-best-practices">Part 9: Color Database &amp; High-Performance Best Practices</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/10138/getting-started-with-wincc-oa-part-10--panel-nesting-and-parameters">Part 10: Panels | Panel Nesting and $-Parameters</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/10184/getting-started-with-wincc-oa-part-11--panels-child-panels-popups">Part 11:&nbsp;Panels | Child Panels (Popups)</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/10313/getting-started-with-wincc-oa-part-12--modules-and-embedded-modules">Part 12: Modules &amp; Embedded Modules</a></li>
</ul>



<p class="wp-block-paragraph"><a href="https://static.dmcinfo.com/contact">Contact</a>&nbsp;DMC to get started on your next WinCC project and learn more about our&nbsp;<a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/siemens-simatic-wincc-programming">Siemens SIMATIC WinCC Programming</a>&nbsp;as well as our&nbsp;<a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/wincc-open-architecture-development">WinCC Open Architecture Development.</a></p>
<p>The post <a href="https://static.dmcinfo.com/blog/20658/getting-started-with-wincc-oa-part-8-libraries/">Getting Started with WinCC OA: Part 8 &#8211; Libraries</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
