<?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>Carter Silvey, Author at DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/author/carters/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Fri, 04 Sep 2026 15:35:12 +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>Carter Silvey, Author at DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Getting Started with Beckhoff TwinCAT Package Manager</title>
		<link>https://static.dmcinfo.com/blog/45335/beckhoff-twincat-package-manager-guide/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Wed, 10 Jun 2026 14:45:49 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[Beckhoff and TwinCAT]]></category>
		<category><![CDATA[TwinCAT 3]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/?p=45335</guid>

					<description><![CDATA[<p>Table of Contents TwinCAT Package Manager is Beckhoff’s new innovative way of managing packages within the TwinCAT environment. Released with their latest build 4026, Package Manager allows for quick and easy downloads of TwinCAT versions and workloads (collections of one or more packages), as well as individual packages. Let’s get started with some of the [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/45335/beckhoff-twincat-package-manager-guide/">Getting Started with Beckhoff TwinCAT Package Manager</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-group alignwide has-custom-light-blue-background-color has-background is-layout-flow wp-container-core-group-is-layout-bcadade0 wp-block-group-is-layout-flow" style="border-radius:20px;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)">
<h4 id="h-table-of-contents" class="wp-block-heading">Table of Contents</h4>



<ol class="wp-block-list">
<li><strong><a href="#twincat-installation">Installation</a></strong></li>



<li><strong><a href="#twincat-configuration">Configuration</a></strong></li>



<li><strong><a href="#twincat-workloads-and-packages">Workloads and Packages</a></strong></li>



<li><strong><a href="#conclusion">Conclusion</a></strong></li>
</ol>
</div>



<p class="wp-block-paragraph">TwinCAT Package Manager is Beckhoff’s new innovative way of managing packages within the TwinCAT environment. Released with their latest build 4026, Package Manager allows for quick and easy downloads of TwinCAT versions and workloads (collections of one or more packages), as well as individual packages. Let’s get started with some of the key features of the TwinCAT Package Manager.</p>



<h2 id="twincat-installation" class="wp-block-heading">Installation</h2>



<p class="wp-block-paragraph">Download the latest version of the TwinCAT Package Manager from the <a href="https://www.beckhoff.com/en-us/support/download-finder/search-result/?download_group=725136885" target="_blank" rel="noreferrer noopener">Beckhoff website</a>. This blog will use the full installation, which includes the UI. If you would prefer the command-line-only install, some common commands are available on <a href="https://infosys.beckhoff.com/content/1033/tc3_installation/15698626059.html?id=5147078465983576506" target="_blank" rel="noreferrer noopener">Beckhoff Infosys</a>.</p>



<figure class="wp-block-image size-full is-resized"><img fetchpriority="high" decoding="async" width="1160" height="299" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-1.png" alt="Screen displaying the TwinCAT Package Manager for version 3.1 Build 4026" class="wp-image-45362" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-1.png 1160w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-1-300x77.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-1-1024x264.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-1-768x198.png 768w" sizes="(max-width: 1160px) 100vw, 1160px" /></figure>



<p class="wp-block-paragraph">Follow the installation procedure to install TwinCAT Package Manager. &nbsp;</p>



<h2 id="twincat-configuration" class="wp-block-heading">Configuration</h2>



<p class="wp-block-paragraph">Once TwinCAT Package Manager is installed successfully, open it. If this is your first time launching Package Manager, you should be greeted with the Introduction screen. If you have previously launched Package Manager, but want to follow along, you can access this screen with the Settings button (gear icon) in the bottom left.</p>



<h3 id="h-introduction" class="wp-block-heading">Introduction</h3>



<p class="wp-block-paragraph">If you’re installing Package Manager on a system with a previous build of TwinCAT already installed, there will be a migration tab instead of a location tab. We will deal with that in a later section. Click Next.</p>



<figure class="wp-block-image size-full is-resized has-custom-border"><img decoding="async" width="1428" height="773" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-2.png" alt="Window displaying the TwinCAT Package Manager setup wizard, used to install, update, and manage Beckhoff software components." class="wp-image-45363" style="border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:0px;border-bottom-right-radius:0px;aspect-ratio:1.8473528492050129;object-fit:cover;width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-2.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-2-300x162.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-2-1024x554.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-2-768x416.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<h3 id="h-feeds" class="wp-block-heading">Feeds</h3>



<p class="wp-block-paragraph">The next section is for configuring the feeds for Package Manager. Click the &#8220;Add new feed&#8221; button to add one of these feeds.</p>



<figure class="wp-block-image size-full is-resized has-custom-border"><img decoding="async" width="1428" height="773" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-3.png" alt="Image showing the TwinCAT Package Manager setup wizard, a tool used to manage software packages for Beckhoff automation systems." class="wp-image-45364" style="border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:0px;border-bottom-right-radius:0px;aspect-ratio:1.8473528492050129;object-fit:cover;width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-3.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-3-300x162.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-3-1024x554.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-3-768x416.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<figure class="wp-block-image size-full is-resized has-custom-border"><img decoding="async" width="856" height="593" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-4.png" alt="Beckhoff TwinCAT Package Manager dialog window used to add new software feeds for installation." class="wp-image-45365" style="border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:0px;border-bottom-right-radius:0px;aspect-ratio:1.4435149171030617;object-fit:cover;width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-4.png 856w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-4-300x208.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-4-768x532.png 768w" sizes="(max-width: 856px) 100vw, 856px" /></figure>



<p class="wp-block-paragraph">By default, Beckhoff provides three feeds: the stable feed, the outdated feed, and the testing feed. The stable feed contains officially released Beckhoff products and is typically the main feed for most workloads and packages. Select the URL that ends with “/stable” to add the stable feed. The feed name should auto-populate, but can be changed. Enter your valid myBeckhoff account credentials and click Save to add the feed. You can <a href="https://www.beckhoff.com/en-en/mybeckhoff-registration/index.aspx" type="link" id="https://www.beckhoff.com/en-en/mybeckhoff-registration/index.aspx" target="_blank" rel="noreferrer noopener">create your own myBeckhoff account</a> if you don’t already one.</p>



<p class="wp-block-paragraph">You’re also able to create your own feed, which you can access here. This would allow you to easily share custom libraries with other developers on your team. We won’t go in depth on how to do that in this blog, but the <a href="https://github.com/Beckhoff-USA-Community/AAG_Custom-TcPkg-And-Workload" target="_blank" rel="noreferrer noopener">Beckhoff community GitHub repo</a> has an example structure.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="856" height="593" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-5.png" alt="TwinCAT Package Manager interface used for configuring software feeds." class="wp-image-45366" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-5.png 856w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-5-300x208.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-5-768x532.png 768w" sizes="(max-width: 856px) 100vw, 856px" /></figure>



<p class="wp-block-paragraph">You should now see the feed added. You’re able to disable, edit, or delete the feed from this view if needed.</p>



<p class="wp-block-paragraph">The outdated feed contains previous TwinCAT builds. If you used TwinCAT prior to build 4026, this is essentially the new version of Remote Manager. The testing feed contains test versions of workloads and packages. It’s most commonly used if you need access to an unreleased feature or are testing packages with Beckhoff engineers.</p>



<p class="wp-block-paragraph">Follow the steps above for the stable feed to add the outdated and testing feeds, making sure to use their respective URLs.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1150" height="679" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-6.png" alt="TwinCAT Package Manager interface used to configure software repositories for Beckhoff products." class="wp-image-45367" style="aspect-ratio:1.6925843647519305;width:1000px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-6.png 1150w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-6-300x177.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-6-1024x605.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-6-768x453.png 768w" sizes="(max-width: 1150px) 100vw, 1150px" /></figure>



<p class="wp-block-paragraph">Once you add the outdated and testing feeds, your Feeds tab should look like the one above. You can reorder the feed priorities using the up and down arrows on the right side. It’s recommended to keep the stable feed as priority 1 since it contains the officially released packages. If you reordered the feeds, click the save button in the top right. If you click next with unsaved changes, you will get this warning.</p>



<figure class="wp-block-image size-full has-custom-border"><img decoding="async" width="760" height="190" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-7.png" alt="Screenshot of a browser alert dialog box informing you that there are unsaved changes to your feed options." class="has-border-color has-custom-black-border-color wp-image-45368" style="border-width:1px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-7.png 760w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-7-300x75.png 300w" sizes="(max-width: 760px) 100vw, 760px" /></figure>



<p class="wp-block-paragraph">If you see this warning, click “Yes” to save changes. Click “Next.”</p>



<h3 class="wp-block-heading">Integration</h3>



<p class="wp-block-paragraph">The next screen asks which versions of TwinCAT XAE to install. Since TwinCAT XAE is built on Visual Studio, it requires the same Visual Studio version (32-bit or 64-bit) to be installed. If you’re working on a project in build 4026 or newer, it’s recommended to use the 64-bit version when possible. If you’re working on a project in a build prior to 4026 or on a 32-bit computer system, the 32-bit version of TwinCAT XAE is the only option. You can always add or remove these XAE versions later, so for now, let’s install both. Click &#8220;Next.&#8221;</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1150" height="679" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-8.png" alt="TwinCAT Package Manager facilitates the integration of TwinCAT Engineering into Visual Studio or a standalone TcXaeShell." class="wp-image-45369" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-8.png 1150w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-8-300x177.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-8-1024x605.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-8-768x453.png 768w" sizes="(max-width: 1150px) 100vw, 1150px" /></figure>



<h3 class="wp-block-heading">Migration</h3>



<p class="wp-block-paragraph">If you had a previous build of TwinCAT, you will be prompted to complete a Migration screen. If you did not have a previous build of TwinCAT, feel free to skip to the <a href="#location">Location </a>section.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="920" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-9.png" alt="TwinCAT Package Manager is prompting you to migrate your current TwinCAT installation to Build 4026." class="wp-image-45370" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-9.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-9-300x193.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-9-1024x660.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-9-768x495.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">The migration tool will attempt to capture existing user settings on previous versions of TwinCAT, uninstall previous versions, install the latest versions, and reapply the user settings. Let’s click &#8220;Start Migration&#8221; to get started.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="920" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-10.png" alt="Screenshot of a prompt from the TwinCAT Package Manager asking to install the TwinCAT.XAE.MigrateCli package." class="wp-image-45373" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-10.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-10-300x193.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-10-1024x660.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-10-768x495.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">When getting to step 2 of the preparation screen, you may see a notification that you need to install the MigrateCli package. Click &#8220;Yes&#8221; to continue.</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" width="1024" height="637" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-11-1024x637.png" alt="Screenshot of TwinCAT Package Manager by Beckhoff Automation, currently displaying the Migration tab." class="wp-image-45375" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-11-1024x637.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-11-300x187.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-11-768x478.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-11.png 1478w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Once the migration tool is installed, click &#8220;Start Simulation.&#8221;</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1511" height="920" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-12.png" alt="Screen displaying the TwinCAT Package Manager migration tool from Beckhoff, which lists specific software workloads to be upgraded." class="wp-image-45376" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-12.png 1511w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-12-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-12-1024x623.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-12-768x468.png 768w" sizes="(max-width: 1511px) 100vw, 1511px" /></figure>



<p class="wp-block-paragraph">Once the migration simulation runs, you should see a list of all existing products in the system and how TwinCAT Package Manager plans to upgrade them to packages and workloads.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1511" height="920" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-13.png" alt="Screenshot of Beckhoff TwinCAT Package Manager software, specifically the migration screen for upgrading existing automation systems." class="wp-image-45377" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-13.png 1511w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-13-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-13-1024x623.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-13-768x468.png 768w" sizes="(max-width: 1511px) 100vw, 1511px" /></figure>



<p class="wp-block-paragraph">Assuming all the products can be upgraded to packages and workloads, we are ready to start the migration. Click Start Migration.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1548" height="920" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-14.png" alt="Image showing a &quot;Reboot required&quot; dialog box from the Beckhoff TwinCAT Package Manager." class="wp-image-45378" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-14.png 1548w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-14-300x178.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-14-1024x609.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-14-768x456.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-14-1536x913.png 1536w" sizes="(max-width: 1548px) 100vw, 1548px" /></figure>



<p class="wp-block-paragraph">Depending on the products you have installed, you may need to reboot your system. Press Ok and the TwinCAT Package Manager should automatically start up after rebooting and continue the migration.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1548" height="920" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-15.png" alt="Screen displaying the Beckhoff TwinCAT Package Manager migrating a system by uninstalling old setups and installing new workloads." class="wp-image-45379" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-15.png 1548w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-15-300x178.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-15-1024x609.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-15-768x456.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-15-1536x913.png 1536w" sizes="(max-width: 1548px) 100vw, 1548px" /></figure>



<p class="wp-block-paragraph">Once the migration is complete, click Finish. You should see all the latest versions of the products you had previously installed on the system.</p>



<h3 id="location" class="wp-block-heading">Location</h3>



<p class="wp-block-paragraph">If you did not have a previous version of TwinCAT installed, the final screen asks where to install TwinCAT. The default location is fine unless you have a reason to install it elsewhere. Click Finish.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1150" height="679" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-16.png" alt="Image of a screen that is part of the TwinCAT Package Manager installation wizard for Beckhoff software." class="wp-image-45380" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-16.png 1150w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-16-300x177.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-16-1024x605.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-16-768x453.png 768w" sizes="(max-width: 1150px) 100vw, 1150px" /></figure>



<h2 id="twincat-workloads-and-packages" class="wp-block-heading">Workloads and Packages</h2>



<p class="wp-block-paragraph">The workload view should be the default view when opening Package Manager for the first time. It can be navigated to by hovering over the package icon with a W in the bottom right and selecting workloads.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="773" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-17.png" alt="Image of a screen showing the TwinCAT Package Manager interface for managing software packages and workloads." class="wp-image-45381" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-17.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-17-300x162.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-17-1024x554.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-17-768x416.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<h3 class="wp-block-heading">Workloads</h3>



<p class="wp-block-paragraph">Workloads are groupings of packages that closely align with Beckhoff&#8217;s licensing structure. For example, if you’re planning on using Beckhoff XTS in your solution, you can search for “XTS” to find the TF5850 | TwinCAT 3 XTS workload. This will install the necessary packages to work with XTS. If you are using XTS in your solution, check out our <a href="https://static.dmcinfo.com/blog/15666/beckhoff-xts-part-1-downloads-and-starter-project/">blog series on XTS</a> to help get started!</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="773" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-18.png" alt="Image shows the Beckhoff TwinCAT Package Manager, which is used for installing, updating, and managing modular TwinCAT 3 software packages." class="wp-image-45382" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-18.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-18-300x162.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-18-1024x554.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-18-768x416.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">The workloads in the general section are the ones we should install first. Let’s start by installing the latest version of TwinCAT Standard Engineering and the latest versions of TwinCAT XAE Shell 32-bit and 64-bit. If you’re installing the latest version, simply click on the blue download button associated with that workload.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="773" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-19.png" alt="Screenshot of TwinCAT Package Manager." class="wp-image-45383" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-19.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-19-300x162.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-19-1024x554.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-19-768x416.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">You’ll see the planned installations added to the right side of Package Manager under selected products. Click Apply Modifications to start the installation.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="856" height="593" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-20.png" alt="Image showing an installation wizard for TwinCAT 3.1, indicating a required update for version 3.16.3 of the TwinCAT.XAR.Base component." class="wp-image-45384" style="width:800px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-20.png 856w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-20-300x208.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-20-768x532.png 768w" sizes="(max-width: 856px) 100vw, 856px" /></figure>



<p class="wp-block-paragraph">Some workloads will require a restart. The TwinCAT Standard installation is one of them. Click Accept to continue.</p>



<p class="wp-block-paragraph">If a pop-up appears asking you to allow the TwinCAT Package Manager to make changes to your device, click “Yes.”</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="856" height="592" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-21.png" alt="Image showing a Beckhoff TwinCAT installer interface managing multiple software packages." class="wp-image-45385" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-21.png 856w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-21-300x207.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-21-768x531.png 768w" sizes="(max-width: 856px) 100vw, 856px" /></figure>



<p class="wp-block-paragraph">The installation may take a few minutes, but Package Manager will give you a download and installation status.</p>



<p class="wp-block-paragraph">Once the installation completes, Package Manager will show a check mark next to the workloads that were successfully installed.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="822" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-22.png" alt="Screenshot of TwinCAT Package Manager." class="wp-image-45386" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-22.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-22-300x173.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-22-1024x589.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-22-768x442.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">We didn’t explicitly install TwinCAT Standard Remote Manager or TE9000 | TwinCAT 3 Safety Editor. Why are they showing as installed? TwinCAT Package Manager will install all dependencies needed to install the selected workloads! These workloads are dependencies for TwinCAT Standard and are automatically installed for us.</p>



<h3 class="wp-block-heading">Workloads (Other Versions)</h3>



<p class="wp-block-paragraph">One of the nice things about TwinCAT Package Managers is the ability to access prior versions of all the workloads. Each workload has an ellipsis on the right side. Clicking on this provides the option to select other versions.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="775" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-23.png" alt="Screenshot of a menu in TwinCAT Package manager allowing users to browse, install, and update different workloads and packages, such as the TwinCAT Standard engineering and runtime environments" class="wp-image-45387" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-23.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-23-300x163.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-23-1024x556.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-23-768x417.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">Click on the other versions option for TwinCAT Standard.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="775" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-24.png" alt="Screenshot of TwinCAT Package Manager with TwinCAT Standard selected." class="wp-image-45388" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-24.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-24-300x163.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-24-1024x556.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-24-768x417.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">We can see that the latest version is currently installed and can be uninstalled here if needed. If we wanted to install a previous version, say 4026.21.2, we could click the icon next to that version. That icon is the downgrade icon. This would uninstall 4026.22.0 and downgrade TwinCAT Standard to 4026.21.2. &nbsp;However, TwinCAT Standard Remote Manager can be used when working on multiple solutions across different versions.</p>



<p class="wp-block-paragraph">Click the triple-dot icon next to TwinCAT Standard Remote Manager, then select other versions.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="775" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-25.png" alt="Screenshot of TwinCAT Package Manager with TwinCAT Standard Remote Manager selected." class="wp-image-45389" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-25.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-25-300x163.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-25-1024x556.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-25-768x417.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">The icons here are install icons instead of downgrade icons, even though we already have the latest version installed. This is because the TwinCAT Standard Remote Manager supports multiple versions, as indicated by the AllowMultiple attribute in the top left. Installing from here will allow both versions to coexist on the same system. To illustrate this, I’ll install version 4026.21.2.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="937" height="86" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-26.png" alt="Image of TwinCAT Standard Remote Manager, allowing users to manage and switch between multiple versions of the TwinCAT 3 development environment (Engineering) on a single PC." class="wp-image-45390" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-26.png 937w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-26-300x28.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-26-768x70.png 768w" sizes="(max-width: 937px) 100vw, 937px" /></figure>



<p class="wp-block-paragraph">The Package Manager workload for TwinCAT Standard Remote Manager now shows a [ + 1 ] to indicate multiple builds are installed.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="175" height="80" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-27.png" alt="Image of a dropdown menu in TwinCAT Package Manager allowing users to select between different versions of TwinCAT software, specifically Build 4026.22 and Build 4026.21." class="wp-image-45391"/></figure>



<p class="wp-block-paragraph">When opening TwinCAT XAE, we now have multiple builds to select from!</p>



<h3 class="wp-block-heading">Installing Pre-4026 Builds</h3>



<p class="wp-block-paragraph">If you haven’t already, make sure you’re connected to the Beckhoff outdated feed. You can configure your feeds by clicking on the settings icon in the bottom left.</p>



<p class="wp-block-paragraph">Once you have the outdated feed configured, hover over the package icon with the database in the bottom right. Select the &#8220;Beckhoff Outdated Feed.&#8221;</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="775" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-28.png" alt="Screenshot of an interface allowing users to select from different feeds, including Stable, Testing, and Outdated feeds, to install, upgrade, or downgrade products." class="wp-image-45392" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-28.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-28-300x163.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-28-1024x556.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-28-768x417.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">The only workload associated with the Beckhoff Outdated Feed is the TwinCAT Standard Remote Manager. From the outdated feed, we can install pre-4026 builds of TwinCAT.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="872" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-29.png" alt="Screenshot of an interface showing TwinCAT Standard Remote Manager with multiple versions available for installation, upgrading, or downgrading." class="wp-image-45393" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-29.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-29-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-29-1024x625.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-29-768x469.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">I’ll install build 4024.75.4 to illustrate.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="176" height="98" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-30.png" alt="Screenshot of a dropdown menu part of the TwinCAT XAE Remote Manager Toolbar, which allows users to select specific TwinCAT 3 versions for loading" class="wp-image-45394"/></figure>



<p class="wp-block-paragraph">After installing build 4024.75.4 on TwinCAT Package Manager, it is now selectable in the build dropdown.</p>



<p class="has-custom-primary-blue-color has-custom-light-blue-background-color has-text-color has-background has-link-color wp-elements-2 wp-block-paragraph" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px;padding-top:var(--wp--preset--spacing--50);padding-right:0;padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--30)"><strong>*NOTE: This is only available in the 32-bit XAE. The 64-bit version of XAE only supports builds 4026 and newer.</strong></p>



<h3 class="wp-block-heading">Packages</h3>



<p class="wp-block-paragraph">So far, we’ve been dealing with Workloads. Workloads are groupings of packages that TwinCAT organizes primarily according to Beckhoff&#8217;s licensing structure. TwinCAT projects reference packages directly. Let’s open a new TwinCAT XAE project to see this.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="143" height="76" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-31.png" alt="Image shows the References section in a Beckhoff TwinCAT 3 engineering environment." class="wp-image-45395"/></figure>



<p class="wp-block-paragraph">In the References folder of a brand new TwinCAT project, there are the Tc2_Standard, Tc2_System, and Tc3_Module packages.</p>



<p class="wp-block-paragraph">Let’s switch back to the package manager. On the left, you should be able to go to the package view menu and select Packages.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="872" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-32.png" alt="Screenshot showing a list of various Packages with different version numbers (e.g., v4.2.0, v22.22.0) available for installation or update." class="wp-image-45396" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-32.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-32-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-32-1024x625.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-32-768x469.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">This will show the individual packages that are available and installed on the system. Let’s search for Tc2_Standard.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="872" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-33.png" alt="Screenshot of TwinCAT Package Manager interface showing &quot;Selected Products&quot; panel on the right displaying actions like Install, Upgrade, or Remove for the packages chosen from the main list." class="wp-image-45397" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-33.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-33-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-33-1024x625.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-33-768x469.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">We can see that Tc2_Standard is installed.</p>



<h3 class="wp-block-heading">How To Deal with a Missing Package</h3>



<p class="wp-block-paragraph">If you have a missing package on a TwinCAT project, you will be greeted with a warning sign that looks something like this:</p>



<figure class="wp-block-image size-full"><img decoding="async" width="145" height="73" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-34.png" alt="Screenshot of a file tree in TwinCAT Package Manager with yellow alert symbols next to folder items." class="wp-image-45398"/></figure>



<p class="wp-block-paragraph">The package with the warning symbol next to it is missing from the project. Double-clicking on the package shows that the library is not available and does not have an effective version listed.</p>



<figure class="wp-block-image size-full is-resized has-custom-border"><img decoding="async" width="635" height="101" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-35-1.png" alt="Image showing a library manager view within TwinCAT 3." class="wp-image-45400" style="border-width:1px;width:700px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-35-1.png 635w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-35-1-300x48.png 300w" sizes="(max-width: 635px) 100vw, 635px" /></figure>



<p class="wp-block-paragraph">Right-click on the missing package and open the properties window. The resolution will show the version of the package that the TwinCAT PLC project is expecting.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="601" height="301" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-36.png" alt="Image displaying the Properties window for a Beckhoff Automation GmbH library, identified as Tc2_System and a resolution version of 3.9.1.0." class="wp-image-45401" style="width:700px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-36.png 601w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-36-300x150.png 300w" sizes="(max-width: 601px) 100vw, 601px" /></figure>



<p class="wp-block-paragraph">If we go back to Package Manager and search for the Tc2_System package, we can see that although it is installed, it is not the same version the PLC project expects.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="962" height="41" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-37.png" alt="Image of a library item for Beckhoff Automation's TwinCAT 3 software suite." class="wp-image-45402" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-37.png 962w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-37-300x13.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-37-768x33.png 768w" sizes="(max-width: 962px) 100vw, 962px" /></figure>



<p class="wp-block-paragraph">Click the ellipses next to the package, then select other versions.</p>



<p class="wp-block-paragraph">Similar to Workloads, Packages have multiple versions that can be installed onto the same system. In this scenario, we have Tc2_System v3.10.1 installed already, but do not have v3.9.1. Tc2_System allows for multiple versions to be installed, indicated by the AllowMultiple tag. Let’s install v3.9.1 and see if that resolves our issue. Click the download button next to v3.9.1 and click &#8220;Apply modifications.&#8221;</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1428" height="872" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-38.png" alt="TwinCAT 3 interface displaying multiple versions." class="wp-image-45403" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-38.png 1428w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-38-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-38-1024x625.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-38-768x469.png 768w" sizes="(max-width: 1428px) 100vw, 1428px" /></figure>



<p class="wp-block-paragraph">If you see a message about “TwinCAT XAE / Visual Studio stop required,” be sure to close all open XAE windows before clicking Accept. Once the package is installed successfully, we can check the previously missing package.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="856" height="672" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-39.png" alt="Screenshot of an installer window indicating that the TwinCAT XAE / Visual Studio application must be stopped before the installation can continue." class="wp-image-45404" style="width:1000px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-39.png 856w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-39-300x236.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-39-768x603.png 768w" sizes="(max-width: 856px) 100vw, 856px" /></figure>



<p class="wp-block-paragraph">The library is now available and has an effective version of v3.9.1. We have installed our missing package through Package Manager!</p>



<figure class="wp-block-image size-full is-resized has-custom-border"><img decoding="async" width="643" height="97" src="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-40-1.png" alt="Image displaying a list of libraries within the Beckhoff TwinCAT 3 engineering environment, specifically showing library names, namespaces, and effective versions." class="has-border-color has-custom-black-border-color wp-image-45406" style="border-width:1px;width:700px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-40-1.png 643w, https://static.dmcinfo.com/wp-content/uploads/2026/06/twincat-package-manager-40-1-300x45.png 300w" sizes="(max-width: 643px) 100vw, 643px" /></figure>



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



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)">The TwinCAT Package Manager is a huge improvement in how engineers can manage the various Packages and Workloads that make up a TwinCAT solution. TwinCAT Package Manager is just the start of the improvements that TwinCAT build 4026 brings to development. A complete list of changes is offered on the <a href="https://www.beckhoff.com/en-us/products/automation/twincat/twincat-3-build-4026/" target="_blank" rel="noreferrer noopener">Beckhoff website</a>. If you’re starting a project in 4026 or upgrading an existing solution to 4026, reach out to DMC and see how we can help! We have extensive experience with upgrading and developing across all TwinCAT builds.</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">Starting a TwintCAT 3 project or upgrading an existing system?</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">DMC&#8217;s <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/">Automation</a> team can help you migrate environments, manage dependencies, and streamline <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/beckhoff-and-twincat-3-programming/">Beckhoff TwinCAT development</a>. Contact DMC to get started.</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>The post <a href="https://static.dmcinfo.com/blog/45335/beckhoff-twincat-package-manager-guide/">Getting Started with Beckhoff TwinCAT Package Manager</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff XTS Part 7: Customizing Logic</title>
		<link>https://static.dmcinfo.com/blog/15346/beckhoff-xts-part-7-customizing-logic/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Thu, 12 Jun 2025 14:55:56 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/15346/beckhoff-xts-part-7-customizing-logic/</guid>

					<description><![CDATA[<p>In previous entries of this blog series, we went over the Mover, Station, and PositionTrigger function blocks. Now that we understand these function blocks better, let&#8217;s use them to write our own Beckhoff XTS custom logic. This blog will continue to use the Beckhoff XTS_Base GitHub and the large XTS starter kit.&#160; Beckhoff XTS Series [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/15346/beckhoff-xts-part-7-customizing-logic/">Beckhoff XTS Part 7: Customizing Logic</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In previous entries of this blog series, we went over the <a href="https://static.dmcinfo.com/blog/15357/beckhoff-xts-part-4-movers/">Mover</a>, <a href="https://static.dmcinfo.com/blog/15354/beckhoff-xts-part-5-stations/">Station</a>, and <a href="https://static.dmcinfo.com/blog/15350/beckhoff-xts-part-6-position-triggers/">PositionTrigger</a> function blocks. Now that we understand these function blocks better, let&#8217;s use them to write our own Beckhoff XTS custom logic.</p>



<p class="wp-block-paragraph">This blog will continue to use the <a href="https://github.com/Beckhoff-USA-Community/XTS_Base/tree/master">Beckhoff XTS_Base GitHub</a> and the large <a href="https://www.beckhoff.com/nl-be/products/motion/xts-linear-product-transport/xts-starter-kits/at2000-1500-0170.html">XTS starter kit</a>.&nbsp;</p>



<h2 id="h-beckhoff-xts-series" class="wp-block-heading">Beckhoff XTS Series</h2>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/blog/15666/beckhoff-xts-part-1-downloads-and-starter-project/">Part 1 &#8211; Downloads and Starter Project</a></li>



<li><a href="https://static.dmcinfo.com/blog/15650/beckhoff-xts-part-2-setting-up-a-physical-xts-system/">Part 2 &#8211;&nbsp;Setting Up a Physical XTS System</a></li>



<li><a href="https://static.dmcinfo.com/blog/15598/beckhoff-xts-part-3-simulation-and-plc-logic/">Part 3 &#8211; Simulation and PLC Logic</a></li>



<li><a href="https://static.dmcinfo.com/blog/15357/beckhoff-xts-part-4-movers/">Part 4 &#8211; Movers</a></li>



<li><a href="https://static.dmcinfo.com/blog/15354/beckhoff-xts-part-5-stations/">Part 5 &#8211; Stations</a></li>



<li><a href="https://static.dmcinfo.com/blog/15350/beckhoff-xts-part-6-position-triggers/">Part 6 &#8211; Position Triggers</a></li>
</ul>



<h2 id="h-customizing-the-logic" class="wp-block-heading">Customizing the Logic</h2>



<p class="wp-block-paragraph">Let’s update this logic to customize our system a bit more. For my system, I’m going to have stations and position triggers at the following places:</p>



<figure class="wp-block-image size-full"><img decoding="async" width="624" height="335" src="https://static.dmcinfo.com/wp-content/uploads/2025/06/customizing-logic-image1.png.webp" alt="customizing logic" class="wp-image-36425" srcset="https://static.dmcinfo.com/wp-content/uploads/2025/06/customizing-logic-image1.png.webp 624w, https://static.dmcinfo.com/wp-content/uploads/2025/06/customizing-logic-image1.png-300x161.webp 300w" sizes="(max-width: 624px) 100vw, 624px" /></figure>



<h3 id="h-update-the-station-and-position-trigger-positions" class="wp-block-heading">Update the Station and Position Trigger Positions</h3>



<p class="wp-block-paragraph">Remove the existing station and position trigger definitions on lines 108-117 and replace it with the following:<br><br>// Initialize station positions<br>Station[0].Position := 5;<br>Station[1].Position := 3200;<br>Station[2].Position := 3300;<br>Station[3].Position := 3400;<br>Station[4].Position := 3500;<br><br>PositionTrigger[0].Position := 1500;<br>PositionTrigger[1].Position := 2000;<br></p>



<p class="wp-block-paragraph">This will define the stations and position triggers as shown above.</p>



<h3 id="h-updating-the-station-and-position-trigger-logic" class="wp-block-heading">Updating the Station and Position Trigger Logic</h3>



<p class="wp-block-paragraph">Next, we need to update the logic of these stations and position triggers to get them to behave as we want. For this application, let’s have the mover run at high velocity across the top rail, then go down to the low velocity around the bend. Once it clears the bend, it can go back up to the medium velocity until it reaches the next station. Once we have a mover in each of the four bottom left stations, send them all back to station 0. Replacing lines 210-265 with the following code will do that:<br><br>// Station 0 Logic<br>IF Station[0].MoverInPosition THEN<br>&nbsp;&nbsp; &nbsp;StationTimer[0](IN := TRUE, PT := T#1000MS);<br>&nbsp;&nbsp; &nbsp;IF StationTimer[0].Q THEN<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Station[0].CurrentMover.MoveVelocity(highVelocity);<br>&nbsp;&nbsp; &nbsp;END_IF<br>ELSE<br>&nbsp;&nbsp; &nbsp;StationTimer[0](IN := FALSE);<br>END_IF<br>&nbsp;&nbsp; &nbsp;// Position Trigger 0 Logic<br>IF PositionTrigger[0].MoverPassedPosition THEN<br>&nbsp;&nbsp; &nbsp;PositionTrigger[0].CurrentMover.SetVelocity(lowVelocity);<br>&nbsp;&nbsp; &nbsp;PositionTrigger[0].MuteCurrent();<br>END_IF<br>&nbsp;&nbsp; &nbsp;// Position Trigger 1 Logic<br>IF PositionTrigger[1].MoverPassedPosition THEN<br>&nbsp;&nbsp; &nbsp;PositionTrigger[1].CurrentMover.SetVelocity(mediumVelocity);<br>&nbsp;&nbsp; &nbsp;PositionTrigger[1].CurrentMover.MoveToStation(Station[nextStation]);<br>&nbsp;&nbsp; &nbsp;nextStation := nextStation &#8211; 1;<br>&nbsp;&nbsp; &nbsp;IF nextStation = 0 THEN<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;nextStation := 4;<br>&nbsp;&nbsp; &nbsp;END_IF<br>&nbsp;&nbsp; &nbsp;PositionTrigger[1].MuteCurrent();<br>END_IF<br><br>// Group of Stations 1, 2, 3, and 4 Logic<br>IF Station[1].MoverInPosition AND Station[2].MoverInPosition AND Station[3].MoverInPosition AND Station[4].MoverInPosition THEN<br>&nbsp;&nbsp; &nbsp;StationTimer[1](IN := TRUE, PT := T#750MS);<br>&nbsp;&nbsp; &nbsp;IF StationTimer[1].Q THEN<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;StationTimer[1](IN := FALSE);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Station[1].CurrentMover.MoveToStation(Station[0]);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Station[2].CurrentMover.MoveToStation(Station[0]);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Station[3].CurrentMover.MoveToStation(Station[0]);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Station[4].CurrentMover.MoveToStation(Station[0]);<br>&nbsp;&nbsp; &nbsp;END_IF<br>END_IF<br></p>



<h3 id="h-execute-the-new-code" class="wp-block-heading">Execute the New Code</h3>



<p class="wp-block-paragraph">Save the new code and activate the configuration. After logging in, you should be able to open the Controls visualization, press the Enable button, and then the Start button to start seeing the movers follow the new logic.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="624" height="234" src="https://static.dmcinfo.com/wp-content/uploads/2025/06/customizing-logic-video1.png.webp" alt="customizing logic executing the new code" class="wp-image-36427" srcset="https://static.dmcinfo.com/wp-content/uploads/2025/06/customizing-logic-video1.png.webp 624w, https://static.dmcinfo.com/wp-content/uploads/2025/06/customizing-logic-video1.png-300x113.webp 300w" sizes="(max-width: 624px) 100vw, 624px" /></figure>



<p class="wp-block-paragraph">This is just an example of the many customizations you can make to your XTS system. There’s even more functionality that comes with this starter project, though. In the next entry in this blog series, we will go over zones and add those to our custom logic.</p>



<p class="wp-block-paragraph">If you’d like help with the next steps for your XTS system, DMC is proud to be a Beckhoff System Integrator and has worked on multiple XTS projects and applications.</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"><strong>Turn complex machine requirements into reliable control solutions with DMC.</strong></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">From custom XTS programming to complete machine automation, DMC delivers <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> solutions designed for your application. Learn more about our partnership with <a href="https://static.dmcinfo.com/about/partners/beckhoff-platinum-solution-provider/" data-type="page" data-id="891">Beckhoff</a>.</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>The post <a href="https://static.dmcinfo.com/blog/15346/beckhoff-xts-part-7-customizing-logic/">Beckhoff XTS Part 7: Customizing Logic</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff XTS Part 6: Position Triggers</title>
		<link>https://static.dmcinfo.com/blog/15350/beckhoff-xts-part-6-position-triggers/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Mon, 02 Jun 2025 10:26:12 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/15350/beckhoff-xts-part-6-position-triggers/</guid>

					<description><![CDATA[<p>The previous entry in this series went over the Station function block. Stations are excellent at holding movers while an operation is performed on their payload. Stations require a mover to stop at the station before continuing along, but what if we wanted to adjust our mover’s behavior while it’s still moving? That’s what position [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/15350/beckhoff-xts-part-6-position-triggers/">Beckhoff XTS Part 6: Position Triggers</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The previous entry in this series went over the Station function block. Stations are excellent at holding movers while an operation is performed on their payload. Stations require a mover to stop at the station before continuing along, but what if we wanted to adjust our mover’s behavior while it’s still moving? That’s what position triggers are for. This blog will go over the PositionTrigger function block that comes with the base starter project. We will see how to configure Beckhoff XTS position triggers properly and what methods we have at our disposal to use with our system.&nbsp;</p>



<p class="wp-block-paragraph">This blog will continue to use the <a href="https://github.com/Beckhoff-USA-Community/XTS_Base/tree/master">Beckhoff XTS_Base GitHub</a> and the <a href="https://www.beckhoff.com/nl-be/products/motion/xts-linear-product-transport/xts-starter-kits/at2000-1500-0170.html">large XTS starter kit</a>.&nbsp;</p>



<h2 id="h-beckhoff-xts-series" class="wp-block-heading">Beckhoff XTS Series</h2>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/blog/15666/beckhoff-xts-part-1-downloads-and-starter-project/">Part 1 &#8211; Downloads and Starter Project</a></li>



<li><a href="https://static.dmcinfo.com/blog/15650/beckhoff-xts-part-2-setting-up-a-physical-xts-system/">Part 2 &#8211;&nbsp;Setting Up a Physical XTS System</a></li>



<li><a href="https://static.dmcinfo.com/blog/15598/beckhoff-xts-part-3-simulation-and-plc-logic/">Part 3 &#8211; Simulation and PLC Logic</a></li>



<li><a href="https://static.dmcinfo.com/blog/15357/beckhoff-xts-part-4-movers/">Part 4 &#8211; Movers</a></li>



<li><a href="https://static.dmcinfo.com/blog/15354/beckhoff-xts-part-5-stations/">Part 5 &#8211; Stations</a></li>



<li><a href="https://static.dmcinfo.com/blog/15346/beckhoff-xts-part-7-customizing-logic/">Part 7 &#8211; Customizing Logic</a></li>
</ul>



<h2 id="h-position-triggers" class="wp-block-heading">Position Triggers</h2>



<p class="wp-block-paragraph">Position triggers are defined positions along the XTS track that know when movers pass by. This can allow for on-the-fly redirections or changes in velocity.</p>



<h2 id="h-declaring-a-position-trigger" class="wp-block-heading">Declaring a Position Trigger</h2>



<p class="wp-block-paragraph">In MAIN, in the variable declaration we already have an array of position triggers defined with the line</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">Structured Text</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>PositionTrigger : ARRAY&#91;0..2&#93; OF PositionTrigger;</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: #C8C8C8">PositionTrigger</span><span style="color: #D4D4D4"> : </span><span style="color: #4FC1FF">ARRAY</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0..2</span><span style="color: #D4D4D4">&#93; </span><span style="color: #4FC1FF">OF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">;</span></span></code></pre></div>



<p class="wp-block-paragraph">This defines 3 position triggers to use. If you want to use more, you can increase the array bounds. It’s also likely worth using a global constant similar to how the stations are defined.</p>



<h2 id="h-configuring-position-triggers" class="wp-block-heading">Configuring Position Triggers</h2>



<p class="wp-block-paragraph">The existing starter project already has 3 position triggers configured, shown below.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="624" height="335" src="https://static.dmcinfo.com/wp-content/uploads/2025/06/configuring-position-triggers.webp" alt="configuring position triggers" class="wp-image-36431" srcset="https://static.dmcinfo.com/wp-content/uploads/2025/06/configuring-position-triggers.webp 624w, https://static.dmcinfo.com/wp-content/uploads/2025/06/configuring-position-triggers-300x161.webp 300w" sizes="(max-width: 624px) 100vw, 624px" /></figure>



<p class="wp-block-paragraph">Similarly to the stations, the position definition for these position triggers is in the MS_INTIIALIZING_OBJECTIVES section of the MAIN state machine, which is at line 115.</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-start:115;--cbp-line-number-width:calc(3 * 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">Structured Text</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>PositionTrigger&#91;0&#93;.Position := 1500;
PositionTrigger&#91;1&#93;.Position := 2000;
PositionTrigger&#91;2&#93;.Position := 3500; </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: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">1500</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">2000</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">3500</span><span style="color: #D4D4D4">; </span></span></code></pre></div>



<p class="wp-block-paragraph">We can see that the position triggers are given positions (in mm) around the track that line up with the picture above. Changing these positions will change where along the track the position triggers exist.</p>



<p class="wp-block-paragraph">These position triggers also have CyclicLogic methods that must be called every scan and are already called for us at line 419.</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-start:419;--cbp-line-number-width:calc(3 * 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">Structured Text</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>PositionTrigger&#91;0&#93;.Cyclic();
PositionTrigger&#91;1&#93;.Cyclic();
PositionTrigger&#91;2&#93;.Cyclic();</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: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Cyclic</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Cyclic</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Cyclic</span><span style="color: #D4D4D4">();</span></span></code></pre></div>



<p class="wp-block-paragraph">If you add more position triggers, make sure to call their CyclicLogic methods as well.</p>



<p class="wp-block-paragraph">The stations also make sure to unregister movers on stopping or disabling. This happens on lines 332 and 367 by calling the UnregisterAll method for each position trigger.</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-start:332;--cbp-line-number-width:calc(3 * 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">Structured Text</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>FOR i := 0 TO SIZEOF(PositionTrigger) / SIZEOF(PositionTrigger&#91;0&#93;) - 1 DO
  PositionTrigger&#91;i&#93;.UnregisterAll();
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">SIZEOF</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">) / </span><span style="color: #DCDCAA">SIZEOF</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;) - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">UnregisterAll</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<h3 id="h-position-trigger-logic" class="wp-block-heading">Position Trigger Logic</h3>



<p class="wp-block-paragraph">The existing starter project already has some position trigger logic. The logic for these position triggers is in the MS_RUN section of the MAIN state machine, which starts at line 250. There’s a few methods and properties about the position triggers that are useful to describe to interpret this code:</p>



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



<p class="wp-block-paragraph">MoverPassedPosition is a property of the position trigger object. It goes TRUE when a mover passed the configured position trigger’s position. This will allow for logic based on the position trigger to affect the mover passing by.</p>



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



<p class="wp-block-paragraph">MuteCurrent is a method of the position trigger object. It will set MoverPassedPosition to FALSE and clear out the mover being tracked by the position trigger. This can be used to indicate the position trigger logic is done and a new mover can be handled.</p>



<p class="wp-block-paragraph">With these properties and methods, let’s see what the current position triggers are doing.</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-start:250;--cbp-line-number-width:calc(3 * 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">Structured Text</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>// Position Trigger 0 Logic
IF PositionTrigger&#91;0&#93;.MoverPassedPosition THEN
  PositionTrigger&#91;0&#93;.CurrentMover.SetVelocity(lowVelocity);
  PositionTrigger&#91;0&#93;.MuteCurrent();
END_IF

// Position Trigger 1 Logic
IF PositionTrigger&#91;1&#93;.MoverPassedPosition THEN
  PositionTrigger&#91;1&#93;.CurrentMover.SetVelocity(highVelocity);
  PositionTrigger&#91;1&#93;.MuteCurrent();
END_IF

// Position Trigger 2 Logic
IF PositionTrigger&#91;2&#93;.MoverPassedPosition THEN
  PositionTrigger&#91;2&#93;.CurrentMover.SetVelocity(lowVelocity);
  PositionTrigger&#91;2&#93;.CurrentMover.MoveToStation(Station&#91;0&#93;);
  PositionTrigger&#91;2&#93;.MuteCurrent();
END_IF</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">// Position Trigger 0 Logic</span></span>
<span class="line"><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverPassedPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">SetVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">lowVelocity</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">MuteCurrent</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_IF</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Position Trigger 1 Logic</span></span>
<span class="line"><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverPassedPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">SetVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">highVelocity</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">MuteCurrent</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_IF</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Position Trigger 2 Logic</span></span>
<span class="line"><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverPassedPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">SetVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">lowVelocity</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">MoveToStation</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">PositionTrigger</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">MuteCurrent</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_IF</span></span></code></pre></div>



<p class="wp-block-paragraph">Position triggers 0 and 1 are doing similar things. They both wait for a mover to pass their position and then change the velocity of the mover. Position trigger 0 changes to low velocity and position trigger 1 changes to high velocity. They then both call the MuteCurrent methods to clear out the mover from the position trigger. Note that neither of these position triggers are sending a command to the mover, just changing its velocity. The mover is still obeying the MoveVelocity command from station 4.</p>



<p class="wp-block-paragraph">Position trigger 2 waits for a mover to pass its position, sets the velocity low, and then commands the mover to move to station 0. This will override the move velocity command from station 4 and so the mover will next stop at station 0. The logic then calls MuteCurrent to signal the position trigger has processed the mover.</p>



<p class="wp-block-paragraph">Now that we’ve reviewed movers, stations, and positions triggers we can not only understand the existing starter project logic but also write our own custom logic. In the next entry in this blog series, we will go over writing some custom logic for our XTS application.</p>



<p class="wp-block-paragraph">If you’d like help with the next steps for your XTS system, DMC is proud to be a Beckhoff System Integrator and has worked on multiple XTS projects and applications.</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"><strong>Looking to maximize the capabilities of your Beckhoff XTS system?</strong></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">From position-triggered events to complete XTS system development, DMC delivers high-performance <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> solutions. Learn more about our <a href="https://static.dmcinfo.com/about/partners/beckhoff-platinum-solution-provider/" data-type="page" data-id="891">Beckhoff</a> Partnership.</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>The post <a href="https://static.dmcinfo.com/blog/15350/beckhoff-xts-part-6-position-triggers/">Beckhoff XTS Part 6: Position Triggers</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff XTS Part 5: Stations</title>
		<link>https://static.dmcinfo.com/blog/15354/beckhoff-xts-part-5-stations/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Fri, 23 May 2025 13:30:41 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/15354/beckhoff-xts-part-5-stations/</guid>

					<description><![CDATA[<p>The previous entry in this series went over the Mover function block. Movers already give us a lot of options for how to control our XTS system, but typically we don’t want to control movers based on which index in the array they are, we want to control them based on where they are along [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/15354/beckhoff-xts-part-5-stations/">Beckhoff XTS Part 5: Stations</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The previous entry in this series went over the Mover function block. Movers already give us a lot of options for how to control our XTS system, but typically we don’t want to control movers based on which index in the array they are, we want to control them based on where they are along the track. That’s what stations are for.</p>



<p class="wp-block-paragraph">This blog will go over the Beckhoff XTS Station block that comes with the base starter project. We will see how to configure the stations properly and what methods we have at our disposal to use with our system. This blog will continue to use the <a href="https://github.com/Beckhoff-USA-Community/XTS_Base/tree/master">Beckhoff XTS_Base GitHub</a> and the large <a href="https://www.beckhoff.com/nl-be/products/motion/xts-linear-product-transport/xts-starter-kits/at2000-1500-0170.html">XTS starter kit</a>.</p>



<h2 id="h-beckhoff-xts-series" class="wp-block-heading">Beckhoff XTS Series</h2>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13704/beckhoff-xts-part-1-downloads-and-starter-project">Part 1 &#8211; Downloads and Starter Project</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13706/beckhoff-xts-part-2-setting-up-a-physical-xts-system">Part 2 &#8211;&nbsp;Setting Up a Physical XTS System</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13712/beckhoff-xts-part-3--simulation-and-plc-logic">Part 3 &#8211; Simulation and PLC Logic</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14734/beckhoff-xts-part-4-movers">Part 4 &#8211; Movers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14736/beckhoff-xts-part-6-position-triggers">Part 6 &#8211; Position Triggers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14737/beckhoff-xts-part-7-customizing-logic">Part 7 &#8211; Customizing Logic</a></li>
</ul>



<h2 id="h-stations" class="wp-block-heading">Stations</h2>



<p class="wp-block-paragraph">Stations are defined positions along the XTS track where movers will stop until commanded to do something else. This allows for a mover to reach the station, have some actions performed on it while stationary, then to be sent elsewhere on the track.</p>



<h3 id="h-declaring-stations" class="wp-block-heading">Declaring Stations</h3>



<p class="wp-block-paragraph">In MAIN, in the variable declaration we already have an array of stations declared with the line</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">Structured Text</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>Station : ARRAY&#91;0..GVL.NUM_STATIONS - 1&#93; OF Station;</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: #C8C8C8">Station</span><span style="color: #D4D4D4"> : </span><span style="color: #4FC1FF">ARRAY</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0.</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_STATIONS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93; </span><span style="color: #4FC1FF">OF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">;</span></span></code></pre></div>



<p class="wp-block-paragraph">If you want to add more stations, you can change the value of <code>NUM_STATIONS</code> in the <code>GVL</code> file. There’s advantages and disadvantages to having your stations in an array. The advantages are that they’re all stored in one place, the name is consistent across various stations, and it’s easy to iterate through all the stations if needed. Additionally, adding stations between two existing stations is as easy as shifting the other stations in the array up an index. The disadvantage is that the station names are not going to be as descriptive as they could be if they were individually named. For this blog, we’re going to continue using the array of stations.</p>



<h3 id="h-configuring-stations" class="wp-block-heading">Configuring Stations</h3>



<p class="wp-block-paragraph">The existing starter project already has 5 stations configured, shown below:</p>



<figure class="wp-block-image size-full"><img decoding="async" width="624" height="336" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/configuring-stations.png-1.webp" alt="configuring stations" class="wp-image-36429" srcset="https://static.dmcinfo.com/wp-content/uploads/2025/05/configuring-stations.png-1.webp 624w, https://static.dmcinfo.com/wp-content/uploads/2025/05/configuring-stations.png-1-300x162.webp 300w" sizes="(max-width: 624px) 100vw, 624px" /></figure>



<p class="wp-block-paragraph">The position definition for these stations is in the MS_INTIIALIZING_OBJECTIVES section of the MAIN state machine, which is at line 109.</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-start:109;--cbp-line-number-width:calc(3 * 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">Structured Text</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>Station&#91;0&#93;.Position := 5;
Station&#91;1&#93;.Position := 750;
Station&#91;2&#93;.Position := 1200;
Station&#91;3&#93;.Position := 1300;
Station&#91;4&#93;.Position := 1400;</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: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">5</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">750</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">1200</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">1300</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Position</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">1400</span><span style="color: #D4D4D4">;</span></span></code></pre></div>



<p class="wp-block-paragraph">We can see that the stations are given positions (in mm) around the track that line up with the picture above. Changing these positions will change where along the track the stations exist.</p>



<p class="wp-block-paragraph">We also need to make sure to call the CyclicLogic method of the station object. This is already done for us in line 414.</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-start:414;--cbp-line-number-width:calc(3 * 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">Structured Text</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>FOR i := 0 TO GVL.NUM_STATIONS - 1 DO
  Station&#91;i&#93;.Cyclic();
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_STATIONS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Cyclic</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">One other thing these stations are already configured to do is to unregister movers on stopping or disabling. This will make sure that no movers are “trapped” at stations when the system starts back up. This is done in lines 327 and 362 by calling the UnregisterAll method for each station.</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-start:327;--cbp-line-number-width:calc(3 * 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">Structured Text</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>FOR i := 0 TO GVL.NUM_STATIONS - 1 DO
  Station&#91;i&#93;.UnregisterAll();
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_STATIONS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">UnregisterAll</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<h3 id="h-station-logic" class="wp-block-heading">Station Logic</h3>



<p class="wp-block-paragraph">The existing starter project already has some stations logic. The logic for these stations is in the MS_RUN section of the MAIN state machine, which starts at line 212. There’s a couple methods and properties about the station objects that are useful to describe to interpret this code.</p>



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



<p class="wp-block-paragraph">MoverInPosition is a property of the station object. This property is true if a mover has arrived at the station. This is important to check before trying to do anything with a station’s mover because if there is no mover in the station, the code will try to command an invalid mover reference.</p>



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



<p class="wp-block-paragraph">CurrentMover is a property of the station object. This property is a reference to the mover that is currently at the station. This allows commands to the movers to go through the stations so logic can be configured on a station level rather than on a mover level.</p>



<p class="wp-block-paragraph">With these methods and properties, we can better understand what the existing stations are doing.</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-start:212;--cbp-line-number-width:calc(3 * 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">Structured Text</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>// Station 0 Logic
IF Station&#91;0&#93;.MoverInPosition THEN
  StationTimer&#91;0&#93;(IN := TRUE, PT := T#1000MS);
  IF StationTimer&#91;0&#93;.Q THEN
    Station&#91;0&#93;.CurrentMover.SetVelocity(mediumVelocity);
    Station&#91;0&#93;.CurrentMover.MoveToStation(Station&#91;1&#93;);
  END_IF
ELSE
  StationTimer&#91;0&#93;(IN := FALSE);
END_IF</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">// Station 0 Logic</span></span>
<span class="line"><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverInPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;(</span><span style="color: #4FC1FF">IN</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">TRUE</span><span style="color: #D4D4D4">, </span><span style="color: #4FC1FF">PT</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">T</span><span style="color: #D4D4D4">#1000</span><span style="color: #4FC1FF">MS</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #4FC1FF">Q</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">SetVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">mediumVelocity</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">MoveToStation</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">END_IF</span></span>
<span class="line"><span style="color: #4FC1FF">ELSE</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">&#93;(</span><span style="color: #4FC1FF">IN</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">FALSE</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #4FC1FF">END_IF</span></span></code></pre></div>



<p class="wp-block-paragraph">Station 0 is straightforward. Once a mover arrives, the logic waits for 1 second before setting the velocity to medium velocity and sending the mover to station 1.</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-start:223;--cbp-line-number-width:calc(3 * 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">Structured Text</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>// Station 1 Logic
IF Station&#91;1&#93;.MoverInPosition THEN
  StationTimer&#91;1&#93;(IN := TRUE, PT := T#250MS);
  IF StationTimer&#91;1&#93;.Q THEN
    Station&#91;1&#93;.CurrentMover.SetVelocity(mediumVelocity);
    Station&#91;1&#93;.CurrentMover.MoveToStation(Station&#91;nextStation&#93;);
    nextStation := nextStation - 1;
    IF nextStation = 1 THEN
      nextStation := 4;
    END_IF
  END_IF
ELSE
  StationTimer&#91;1&#93;(IN := FALSE);
END_IF</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">// Station 1 Logic</span></span>
<span class="line"><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverInPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;(</span><span style="color: #4FC1FF">IN</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">TRUE</span><span style="color: #D4D4D4">, </span><span style="color: #4FC1FF">PT</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">T</span><span style="color: #D4D4D4">#250</span><span style="color: #4FC1FF">MS</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #4FC1FF">Q</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">SetVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">mediumVelocity</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">MoveToStation</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">nextStation</span><span style="color: #D4D4D4">&#93;);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C8C8C8">nextStation</span><span style="color: #D4D4D4"> := </span><span style="color: #9CDCFE">nextStation</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: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">nextStation</span><span style="color: #D4D4D4"> = </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #C8C8C8">nextStation</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #4FC1FF">END_IF</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">END_IF</span></span>
<span class="line"><span style="color: #4FC1FF">ELSE</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;(</span><span style="color: #4FC1FF">IN</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">FALSE</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #4FC1FF">END_IF</span></span></code></pre></div>



<p class="wp-block-paragraph">Station 1 has some similar logic. It only waits for 250 milliseconds and then rotates through sending to station 4, then station 3, then station 2, then back to station 4. This is a great example of how you can use the XTS system to multi-task with processes that have higher cycle times.</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-start:238;--cbp-line-number-width:calc(3 * 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">Structured Text</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>// Group of Stations 2, 3, and 4 Logic
IF Station&#91;2&#93;.MoverInPosition AND Station&#91;3&#93;.MoverInPosition AND Station&#91;4&#93;.MoverInPosition THEN
  StationTimer&#91;2&#93;(IN := TRUE, PT := T#750MS);
  IF StationTimer&#91;2&#93;.Q THEN
    StationTimer&#91;2&#93;(IN := FALSE);

    Station&#91;2&#93;.CurrentMover.MoveVelocity(500);
    Station&#91;3&#93;.CurrentMover.MoveVelocity(500);
    Station&#91;4&#93;.CurrentMover.MoveVelocity(500);
  END_IF
END_IF</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">// Group of Stations 2, 3, and 4 Logic</span></span>
<span class="line"><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverInPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">AND</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverInPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">AND</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MoverInPosition</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;(</span><span style="color: #4FC1FF">IN</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">TRUE</span><span style="color: #D4D4D4">, </span><span style="color: #4FC1FF">PT</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">T</span><span style="color: #D4D4D4">#750</span><span style="color: #4FC1FF">MS</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #4FC1FF">Q</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">StationTimer</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;(</span><span style="color: #4FC1FF">IN</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">FALSE</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">MoveVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #B5CEA8">500</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">MoveVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #B5CEA8">500</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">Station</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">CurrentMover</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">MoveVelocity</span><span style="color: #D4D4D4">(</span><span style="color: #B5CEA8">500</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">END_IF</span></span>
<span class="line"><span style="color: #4FC1FF">END_IF</span></span></code></pre></div>



<p class="wp-block-paragraph">Stations 2 through 4 have their logic combined since they’re intended to be parallel processes. Once a mover has arrived in each of the three stations, the logic waits for 750 milliseconds before commanding all three movers to move at 500mm/s.</p>



<p class="wp-block-paragraph">If we’re commanding these movers to move at 500mm/s until they receive another command, how will they ever stop? The first answer is that they have collision avoidance, so the movers will stop if they would run into a mover ahead of them. The second answer is that we have position triggers further along the track to give them new commands. In the next blog in this series, we will go over position triggers.</p>



<p class="wp-block-paragraph">If you’d like help with the next steps for your XTS system, DMC is proud to be a Beckhoff System Integrator and has worked on multiple XTS projects and applications.</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"><strong>Turn XTS Motion into Intelligent Machine Behavior</strong>.</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">Our <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> experts develop custom station logic that enables dynamic routing and efficient machine performance. Learn more about our <a href="https://static.dmcinfo.com/about/partners/beckhoff-platinum-solution-provider/" data-type="page" data-id="891">Beckhoff</a> partnership.</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>The post <a href="https://static.dmcinfo.com/blog/15354/beckhoff-xts-part-5-stations/">Beckhoff XTS Part 5: Stations</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff XTS Part 4: Movers</title>
		<link>https://static.dmcinfo.com/blog/15357/beckhoff-xts-part-4-movers/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Thu, 17 Apr 2025 10:38:02 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/15357/beckhoff-xts-part-4-movers/</guid>

					<description><![CDATA[<p>In previous entries of this blog series, we went over how to configure, activate, and run code on a Beckhoff XTS system. Running the starter project is great to ensure the system is wired and configured correctly, but to truly get the most out of our XTS system we need to understand how to control [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/15357/beckhoff-xts-part-4-movers/">Beckhoff XTS Part 4: Movers</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In previous entries of this blog series, we went over how to configure, activate, and run code on a Beckhoff XTS system. Running the starter project is great to ensure the system is wired and configured correctly, but to truly get the most out of our XTS system we need to understand how to control the movers for our specific application.</p>



<p class="wp-block-paragraph">This blog will go over the Beckhoff XTS mover blocks that comes with the base starter project. We will see how to configure the movers properly and what methods we have at our disposal to use with our system.&nbsp;This blog will continue to use the <a href="https://github.com/Beckhoff-USA-Community/XTS_Base/tree/master">Beckhoff XTS_Base GitHub</a> and the <a href="https://www.beckhoff.com/nl-be/products/motion/xts-linear-product-transport/xts-starter-kits/at2000-1500-0170.html">large XTS starter kit</a>.&nbsp;</p>



<h2 id="h-beckhoff-xts-series" class="wp-block-heading">Beckhoff XTS Series</h2>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13704/beckhoff-xts-part-1-downloads-and-starter-project">Part 1 &#8211; Downloads and Starter Project</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13706/beckhoff-xts-part-2-setting-up-a-physical-xts-system">Part 2 &#8211;&nbsp;Setting Up a Physical XTS System</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13712/beckhoff-xts-part-3--simulation-and-plc-logic">Part 3 &#8211; Simulation and PLC Logic</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14735/beckhoff-xts-part-5-stations">Part 5 &#8211; Stations</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14736/beckhoff-xts-part-6-position-triggers">Part 6 &#8211; Position Triggers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14737/beckhoff-xts-part-7-customizing-logic">Part 7 &#8211; Customizing Logic</a></li>
</ul>



<h2 id="h-movers" class="wp-block-heading">Movers</h2>



<p class="wp-block-paragraph">Movers are the software representation of the physical XTS movers. The mover object built into the base project is a great starting point since it comes with a lot of useful methods for controlling the mover behavior.&nbsp;</p>



<h3 id="h-declaring-movers" class="wp-block-heading">Declaring Movers</h3>



<p class="wp-block-paragraph">In the previous entry in this blog series, we made sure to update the number of movers to match the physical movers in our system. In the MAIN program, we can see that the movers are declared with the line.</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">Structured Text</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>Mover : ARRAY&#91;0..GVL.NUM_MOVERS - 1&#93; OF Mover;</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: #C8C8C8">Mover</span><span style="color: #D4D4D4"> : </span><span style="color: #4FC1FF">ARRAY</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">0.</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93; </span><span style="color: #4FC1FF">OF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">;</span></span></code></pre></div>



<p class="wp-block-paragraph">As mentioned in the previous section, this <code>NUM_MOVERS</code> should be exactly equal to the number of physical movers in the XTS system. Additionally, the axis references of these mover objects should be linked to the motion axes. If you haven’t already done that see <a href="https://static.dmcinfo.com/latest-thinking/blog/id/13712/beckhoff-xts-part-3--simulation-and-plc-logic#:~:text=Link%20the%20Mover%20Axes%C2%A0">this section</a>.&nbsp;</p>



<h3 id="h-configuring-movers" class="wp-block-heading">Configuring Movers</h3>



<p class="wp-block-paragraph">Like most drives, the movers need to have a set of parameters and to go through an enable process before they can run. The base project already does both things for us. In the MAIN program the code starting at line 52 is where the parameter set is applied to all of the movers configured in our system.&nbsp;</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-start:52;--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">Structured Text</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>FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
  Mover&#91;i&#93;.MotionParameters := ParameterSet;
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">MotionParameters</span><span style="color: #D4D4D4"> := </span><span style="color: #9CDCFE">ParameterSet</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">The lines starting at line 46 define the parameter set, which includes acceleration, deceleration, jerk, velocity, and direction.&nbsp;</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-start:46;--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">Structured Text</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>ParameterSet.Jerk     := 1E5; // mm/s3
ParameterSet.Acceleration := 1E4; // mm/s2
ParameterSet.Deceleration := 1E4; // mm/s2
ParameterSet.Velocity   := 1E3; // mm/s
ParameterSet.Direction   := mcDirectionPositive;</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: #9CDCFE">ParameterSet</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">Jerk</span><span style="color: #D4D4D4">     := </span><span style="color: #B5CEA8">1E5</span><span style="color: #D4D4D4">; </span><span style="color: #6A9955">// mm/s3</span></span>
<span class="line"><span style="color: #9CDCFE">ParameterSet</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">Acceleration</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">1E4</span><span style="color: #D4D4D4">; </span><span style="color: #6A9955">// mm/s2</span></span>
<span class="line"><span style="color: #9CDCFE">ParameterSet</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">Deceleration</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">1E4</span><span style="color: #D4D4D4">; </span><span style="color: #6A9955">// mm/s2</span></span>
<span class="line"><span style="color: #9CDCFE">ParameterSet</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">Velocity</span><span style="color: #D4D4D4">   := </span><span style="color: #B5CEA8">1E3</span><span style="color: #D4D4D4">; </span><span style="color: #6A9955">// mm/s</span></span>
<span class="line"><span style="color: #9CDCFE">ParameterSet</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">Direction</span><span style="color: #D4D4D4">   := </span><span style="color: #9CDCFE">mcDirectionPositive</span><span style="color: #D4D4D4">;</span></span></code></pre></div>



<p class="wp-block-paragraph">Line 72 is where the movers are enabled&nbsp;</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-start:72;--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">Structured Text</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>FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
  Mover&#91;i&#93;.Enable();
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Enable</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">and a few lines down in line 87 is where their Ready property is checked to see if they got enabled properly.&nbsp;</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-start:87;--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">Structured Text</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>FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
  IF Mover&#91;i&#93;.Ready = FALSE THEN
    allMoversEnabled := FALSE;
  END_IF
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">IF</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">Ready</span><span style="color: #D4D4D4"> = </span><span style="color: #4FC1FF">FALSE</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C8C8C8">allMoversEnabled</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">FALSE</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">END_IF</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">Additionally, the movers must be assigned to a track. This happens starting at line 144 by calling ActivateTrack and passing in the track the mover is to be assigned to.&nbsp;</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-start:114;--cbp-line-number-width:calc(3 * 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">Structured Text</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>FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
  Mover&#91;i&#93;.ActivateTrack(Track&#91;1&#93;);
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">ActivateTrack</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">Track</span><span style="color: #D4D4D4">&#91;</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">&#93;);</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">For the basic starter project, all movers are assigned to track 1. If your application has multiple tracks, this is where you can specify which movers belong to which track. A few lines down at line 153 is where the logic checks the mover’s IsTrackReady property to make sure they’re properly assigned to their track.&nbsp;</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-start:153;--cbp-line-number-width:calc(3 * 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">Structured Text</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>allMoverTracksEnabled := TRUE;
FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
  IF (NOT Mover&#91;i&#93;.IsTrackReady) THEN
    allMoverTracksEnabled := FALSE;
  END_IF;
END_FOR</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: #C8C8C8">allMoverTracksEnabled</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">TRUE</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #DCDCAA">IF</span><span style="color: #D4D4D4"> (</span><span style="color: #4FC1FF">NOT</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">IsTrackReady</span><span style="color: #D4D4D4">) </span><span style="color: #4FC1FF">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C8C8C8">allMoverTracksEnabled</span><span style="color: #D4D4D4"> := </span><span style="color: #4FC1FF">FALSE</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #4FC1FF">END_IF</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">To stop the movers, the logic will need to call the Halt method. This is already implemented in line 286 of the base starter project.&nbsp;</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-start:286;--cbp-line-number-width:calc(3 * 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">Structured Text</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>FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
  Mover&#91;i&#93;.Halt();
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Halt</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">Once the movers are stopped, they can be disabled using the Disable method. Again, this is already implemented in line 348.&nbsp;</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-start:348;--cbp-line-number-width:calc(3 * 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">Structured Text</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>FOR i := 0 TO GVL.NUM_MOVERS DO
  Mover&#91;i&#93;.Disable();
END_FOR</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Disable</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span></span></code></pre></div>



<p class="wp-block-paragraph">It’s worth noting that if you have a vertically mounted track, disabling the movers will often let them succumb to gravity. It could be worth implementing something that gets the movers off the curved sections before disabling them.&nbsp;</p>



<p class="wp-block-paragraph">Many of these XTS library objects have methods named Cyclic or CyclicLogic that need to be called every scan in order to function properly, so check those are getting called correctly if any issues come up. For our movers, this happens at line 408.&nbsp;</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-start:408;--cbp-line-number-width:calc(3 * 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">Structured Text</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>FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
  Mover&#91;i&#93;.Cyclic(GroupRef);
  Mover&#91;i&#93;.AxisReference.ReadStatus();
END_FOR;</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: #4FC1FF">FOR</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">i</span><span style="color: #D4D4D4"> := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">TO</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">GVL</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">NUM_MOVERS</span><span style="color: #D4D4D4"> - </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #4FC1FF">DO</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #DCDCAA">Cyclic</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">GroupRef</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #9CDCFE">Mover</span><span style="color: #D4D4D4">&#91;</span><span style="color: #9CDCFE">i</span><span style="color: #D4D4D4">&#93;.</span><span style="color: #9CDCFE">AxisReference</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">ReadStatus</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #4FC1FF">END_FOR</span><span style="color: #D4D4D4">;</span></span></code></pre></div>



<p class="wp-block-paragraph">The logic also calls the ReadStatus method of the mover’s internal axis reference to ensure the status values are up to date.&nbsp;</p>



<p class="wp-block-paragraph">Now we’ve gone over a lot of the configuration that these movers need. We can enable them, assign a parameter set to them, assign them to tracks, stop them and disable them. We’re also calling the Cyclic method that ensures our commands get processed properly. Now it’s time for the fun part, getting the movers to move around the track.&nbsp;</p>



<h3 id="h-mover-logic" class="wp-block-heading">Mover Logic</h3>



<p class="wp-block-paragraph">The mover objects come with four main methods that will help control their movement throughout the track. Here’s a quick description of each of the methods.&nbsp;</p>



<h3 id="h-setvelocity" class="wp-block-heading"><em>SetVelocity</em></h3>



<p class="wp-block-paragraph">SetVelocity is a method of the mover object. It will immediately change the velocity of the mover to the commanded velocity (in mm/s).</p>



<h3 id="h-movevelocity" class="wp-block-heading"><em>MoveVelocity</em></h3>



<p class="wp-block-paragraph">MoveVelocity is a method of the mover object. It will command a mover to run at the commanded velocity (in mm/s) until it receives another command.</p>



<h3 id="h-movetostation" class="wp-block-heading"><em>MoveToStation</em></h3>



<p class="wp-block-paragraph">MoveToStation is a method of the mover object. It will command a mover to go to the commanded station. Note that there’s no velocity input for this method, so the mover will go at its existing velocity, which was likely last given by SetVelocity or MoveVelocity. The mover will stop once it reaches the commanded station.</p>



<h3 id="h-movetoposition" class="wp-block-heading"><em>MoveToPosition</em></h3>



<p class="wp-block-paragraph">MoveToPosition is a method of the mover object. It will command a mover to go to the inputted position (in mm). Similar to MoveToStation, there is no velocity input so this will use the mover’s existing velocity.</p>



<p class="wp-block-paragraph">The MoveToStation function is particularly useful, but first we have to understand what a station is. We will go over stations in the next entry in this blog series.</p>



<p class="wp-block-paragraph">If you’d like help with the next steps for your XTS system, DMC is proud to be a Beckhoff System Integrator and has worked on multiple XTS projects and applications.</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"><strong><strong>Engineering Intelligent Motion Control Systems</strong></strong> for Your XTS Project.</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">Our <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> experts can design and implement custom XTS applications. Learn more about our <a href="https://static.dmcinfo.com/about/partners/beckhoff-platinum-solution-provider/" data-type="page" data-id="891">Beckhoff</a> partnership.</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>The post <a href="https://static.dmcinfo.com/blog/15357/beckhoff-xts-part-4-movers/">Beckhoff XTS Part 4: Movers</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff XTS Part 3 &#8211; Simulation and PLC Logic</title>
		<link>https://static.dmcinfo.com/blog/15598/beckhoff-xts-part-3-simulation-and-plc-logic/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Thu, 20 Mar 2025 11:43:23 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/15598/beckhoff-xts-part-3-simulation-and-plc-logic/</guid>

					<description><![CDATA[<p>This is Part 3 of Getting Started with XTS. The first two posts in the series discuss Beckhoff XTS, walks through the installation process, setting up a base project, and configuring an XTS system. Today we will continue by setting up an XTS simulation and begin adding logic into our application &#160; Beckhoff XTS Series [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/15598/beckhoff-xts-part-3-simulation-and-plc-logic/">Beckhoff XTS Part 3 &#8211; Simulation and PLC Logic</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">This is Part 3 of Getting Started with XTS. The first two posts in the series discuss Beckhoff XTS, walks through the installation process, setting up a base project, and configuring an XTS system. Today we will continue by setting up an XTS simulation and begin adding logic into our application &nbsp;</p>



<h2 id="h-beckhoff-xts-series" class="wp-block-heading">Beckhoff XTS Series</h2>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13704/beckhoff-xts-part-1-downloads-and-starter-project">Part 1 &#8211; Downloads and Starter Project</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13706/beckhoff-xts-part-2-setting-up-a-physical-xts-system">Part 2 &#8211;&nbsp;Setting Up a Physical XTS System</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14734/beckhoff-xts-part-4-movers">Part 4 &#8211; Movers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14735/beckhoff-xts-part-5-stations">Part 5 &#8211; Stations</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14736/beckhoff-xts-part-6-position-triggers">Part 6 &#8211; Position Triggers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14737/beckhoff-xts-part-7-customizing-logic">Part 7 &#8211; Customizing Logic</a></li>
</ul>



<h2 id="h-setting-up-an-xts-simulation-nbsp" class="wp-block-heading">Setting Up an XTS Simulation&nbsp;</h2>



<h3 id="h-start-the-xts-simulator-nbsp" class="wp-block-heading">Start the XTS Simulator&nbsp;</h3>



<p class="wp-block-paragraph">XTS has a built-in simulator that you can start through the XTS simulation builder. This is the gear icon with a <em>blue</em> arrow.&nbsp;</p>



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



<h3 id="h-start-the-xts-simulation-builder" class="wp-block-heading">Start the XTS Simulation Builder</h3>



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



<p class="wp-block-paragraph">This starts the XTS simulation builder. You can select from a few template projects, but modifying the base project will give you the most control over the XTS system being set up. To do this, click the pencil next to modify base project.&nbsp;</p>



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



<h3 id="h-configure-xts-modules" class="wp-block-heading">Configure XTS Modules</h3>



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



<p class="wp-block-paragraph">The first tab of the simulation builder is to configure the modules. Here you can add XTS track modules to build your track. In the top bar, you can select from the catalog of XTS modules and hovering over each module will give you the part number. To add a module, either select the module and click the add module plus button or double click on the module.&nbsp;</p>



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



<p class="wp-block-paragraph">The last four digits of each module’s part number represent its length in millimeters. There are some modules that look the same but have different lengths, so be sure to select the correct length of each part for your application. Below is a simulation track for the XTS larger starter kit. It uses two&nbsp;AT2002-0250, 2 AT2050-0250, and 10 AT2000-0250 modules to form a 4m loop.&nbsp;</p>



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



<h3 id="h-configure-xts-movers-nbsp" class="wp-block-heading">Configure XTS Movers&nbsp;</h3>



<p class="wp-block-paragraph">Next, navigate to the Movers tab.&nbsp;</p>



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



<p class="wp-block-paragraph">Here you can add movers to the XTS track. Similar to the modules, at the top you can select which mover from the Beckhoff XTS catalog you’d like to add to the track. To add a mover, select the type and then click the add mover plus button. Below are the simulation movers for the XTS large starter kit. It uses 10 AT9014-0070 movers.&nbsp;</p>



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



<h3 id="h-configure-parts-tracks-and-stations-nbsp" class="wp-block-heading">Configure Parts, Tracks, and Stations&nbsp;</h3>



<p class="wp-block-paragraph">For this example, we’re not going to be using any parts, tracks, or stations. Here’s a quick rundown of what each of them are with links to the Beckhoff documentation for more detail.&nbsp;</p>



<ul class="wp-block-list">
<li><strong><a href="https://infosys.beckhoff.com/content/1033/xts_software/10518294411.html?id=5816654963653202432" target="_blank" rel="noreferrer noopener">Parts</a> –</strong> Groupings of modules. Since our large starter kit is a loop, we only have the one part which was added by default.&nbsp;</li>



<li><strong><a href="https://infosys.beckhoff.com/content/1033/xts_software/10518303499.html?id=5057607251771315029" target="_blank" rel="noreferrer noopener">Tracks</a> –</strong> A route that can be used by movers that is made up of one or multiple parts. Since our large starter kit is a loop with only one part, we also only use the single default track.&nbsp;</li>



<li><strong><a href="https://infosys.beckhoff.com/content/1033/xts_software/10518313355.html?id=7102308198055763556" target="_blank" rel="noreferrer noopener">Stations</a> –</strong> A station in this configurator is still in the beta phase and is currently purely cosmetic. Stations will display in the XTS tool window, but the movers cannot use these stations in their logic. We will set up stations in the PLC logic later, so we don’t have to set any up here.&nbsp;</li>
</ul>



<h3 class="wp-block-heading" aria-level="3" paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{104}" paraid="304739211" role="heading">Configure XTS Real-Time Settings&nbsp;</h3>



<p class="wp-block-paragraph"><p paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{115}" paraid="75925578">Lastly, we need to set the real-time settings for the XTS system. This is functionally the same as going to SYSTEM &gt; Real-Time, but it’s conveniently here in the configurator as well. First, navigate to the System tab and click the download button to sync the number of cores on your target to the configurator.&nbsp;</p></p>



<p class="wp-block-paragraph"><p paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{115}" paraid="75925578"></p></p>



<p class="wp-block-paragraph"><p paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{115}" paraid="75925578">Say &#8220;yes&#8221; to the popup that asks if you want to overwrite the current CPU config.&nbsp;</p></p>



<p class="wp-block-paragraph"><p paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{115}" paraid="75925578"></p></p>



<p class="wp-block-paragraph"><p paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{115}" paraid="75925578">The XTS Task 1 has to be configured onto an isolated CPU by itself with a 250μs base time and 1 cycle tick. Isolated cores are represented by an orange rectangle on the right side of the core. You can select which cores are being used with the checkbox on the left side and move tasks around using the up and down arrows on each task. The remaining tasks on the system can be set up to fit your system&#8217;s needs, but the XTS Task 1 should be configured like the image below.&nbsp;</p></p>



<p class="wp-block-paragraph"><p paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{115}" paraid="75925578"></p></p>



<p class="wp-block-paragraph"><p paraeid="{9a139b91-8159-4c71-b387-a6090cf60596}{115}" paraid="75925578">If you’re simulating on your engineering computer, keep in mind that all tasks must be on isolated cores, not just the XTS Task 1. The image above has all tasks on isolated cores for this reason.&nbsp;</p></p>



<h3 id="h-finish-the-xts-simulation-builder-nbsp" class="wp-block-heading">Finish the XTS Simulation Builder&nbsp;</h3>



<p class="wp-block-paragraph">Click the next button a couple times and the XTS simulation builder should process the information to add the XTS system to your solution. This may take a few minutes, but afterwards the simulation builder should close. To start sending movers around the track, go to step 5.&nbsp;</p>



<h2 id="h-adding-logic-to-the-xts-system-nbsp" class="wp-block-heading">Adding Logic to the XTS System&nbsp;</h2>



<p class="wp-block-paragraph">This section assumes that you’re using the <a href="https://github.com/Beckhoff-USA-Community/XTS_Base/tree/master" target="_blank">XTS_Base code provided on Beckhoff’s GitHub</a>. It’s highly recommended to use this since it provides well-tested code for commonly used XTS tools like movers, stations, zones, position triggers, etc.&nbsp;</p>



<h3 id="h-check-iddetectionmode-nbsp" class="wp-block-heading">Check IdDetectionMode&nbsp;</h3>



<p class="wp-block-paragraph">Under SYSTEM &gt; TcCOM Object &gt; XTS ProcessingUnit 1, go to the Parameter (Init) tab. Under the section for Mover ID Detection, we will want to set IdDetectionMode to the correct detection mode for our system.&nbsp;</p>



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



<p class="wp-block-paragraph">If you’re simulating an XTS system, the IdDetectionMode should be set to Standard. If you’re working with a physical XTS system, then it depends on your movers. Some movers are identified with mover 1 magnet plates. If you have no mover 1 magnet plates, set IdDetectionMode to Standard. With one mover 1 magnet plate, set the IdDetectionMode to Mover1. With multiple mover 1 magnet plates, set the IdDetectionMode to MultipleMover1.&nbsp;</p>



<h2 id="h-setting-the-gvl-parameters" class="wp-block-heading">Setting the GVL Parameters</h2>



<p class="wp-block-paragraph">Under the Main Project, open GVLs &gt; GVL. In this global variable list, you’ll need to set the following variables&nbsp;</p>



<ul class="wp-block-list">
<li><strong>NUM_MOVERS –</strong>&nbsp;This should be the number of movers in your XTS system. In our case, 10.&nbsp;</li>



<li><strong>NUM_STATIONS –</strong>&nbsp;This should be set to a number greater than or equal to the number of stations you’ll add to your system. In our case, we will keep it at 10.&nbsp;</li>



<li><strong>TRACK_LENGTH – </strong>This should be the length of the track in your XTS system in millimeters. In our case, 4000mm. If you don’t know the track length, you can find it under SYSTEM &gt; TcCOM Object &gt; XTS ProcessingUnit 1 &gt; Track 1 in the Parameter (Online) tab. The Length parameter should show an online value which should be entered for TRACK_LENGTH.&nbsp;</li>



<li><strong>NUM_TRACKS –</strong>&nbsp;This should be set to the number of tracks in your system. In our case, 1.&nbsp;</li>
</ul>



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



<h3 class="wp-block-heading" aria-level="3" paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{57}" paraid="1871624229" role="heading">Update the Track OTCID in MAIN&nbsp;</h3>



<p class="wp-block-paragraph"><p paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{68}" paraid="1362841373">In the MAIN program inside the POUs folder, on line 138 there is an assignment to Track[1].OTCID. This will likely need to be changed.&nbsp;</p></p>



<p class="wp-block-paragraph"><p paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{68}" paraid="1362841373"></p></p>



<p class="wp-block-paragraph"><p paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{68}" paraid="1362841373">You can find your track’s OTCID under SYSTEM &gt; TcCOM Objects &gt; XTS ProcessingUnit 1 &gt; Track 1 in the Object tab.&nbsp;</p></p>



<p class="wp-block-paragraph"><p paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{68}" paraid="1362841373"></p></p>



<p class="wp-block-paragraph"><p paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{68}" paraid="1362841373">You can then copy this value and assign it to Track[1].OTCID in MAIN. Make sure to change the “0x” prefix to a “16#” to match structured text formatting for hexadecimal numbers.&nbsp;</p></p>



<h3 id="h-link-the-mover-axes-nbsp" class="wp-block-heading">Link the Mover Axes&nbsp;</h3>



<p class="wp-block-paragraph">Rebuild the solution first by going to the top toolbar and selecting Build &gt; Rebuild Solution. This makes sure that our change to NUM_MOVERS regenerated the correct number of AXIS_REFs to link to. After rebuilding, go to MOTION &gt; NC SAF &gt; Axes and you’ll see a list of axes that are in our solution. They should already be linked to their I/O components, which should be Mover Controllers. The next step is to link them to their PLC AXIS_REFs. Select all the axes using Shift + Click, then right click to select Change Axis PLC Links.&nbsp;</p>



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



<p class="wp-block-paragraph">You should see the mover axis references show up. Click each reference to link all the movers to their NC axes. The linking should look like the image below afterwards.&nbsp;</p>



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



<h3 id="h-run-the-program-nbsp" class="wp-block-heading">Run the Program&nbsp;</h3>



<p class="wp-block-paragraph">We can now activate our configuration. Do this by clicking the icon shown below.&nbsp;</p>



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



<p class="wp-block-paragraph">Click OK in the next popup.&nbsp;</p>



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



<p class="wp-block-paragraph">If you haven’t already purchased licenses from Beckhoff, you’ll likely get a popup asking if you want to activate trial licenses. Click yes and follow the steps to get a free 7-day trial license. Once you deploy the code onto a production machine, make sure to get a license from your local Beckhoff sales representative.&nbsp;</p>



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



<p class="wp-block-paragraph">After activating configuration, the target device should switch into run mode, which is indicated by the green gear icon next to the activate configuration button being highlighted instead of the blue one. Once in run mode, we can enable and start the movers.&nbsp;</p>



<h3 id="h-start-the-movers-nbsp" class="wp-block-heading">Start the Movers&nbsp;</h3>



<p class="wp-block-paragraph">The solution we pulled from the Beckhoff GitHub already has a simple HMI to get the movers started. Let’s log in by clicking the green door with the arrow pointing towards it.&nbsp;</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/start-xts-movers.png" alt="start the movers in xts"/></figure>



<p class="wp-block-paragraph">After logging in, open the visualization under Main Project &gt; VISUs &gt; Controls.</p>



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



<p class="wp-block-paragraph"><p paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{232}" paraid="1628073123">This provides four&nbsp;buttons for interacting with the XTS system.&nbsp;</p></p>



<ul class="wp-block-list">
<li paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{238}" paraid="1744214791"><strong>Enable &ndash;</strong> Will run the enable sequence for the movers, which initializes their order and assigns movers to tracks.&nbsp;</li>



<li paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{244}" paraid="2057721951"><strong>Start &ndash;</strong> Once the movers are enabled, this will start running the station logic for the movers,&nbsp;</li>



<li paraeid="{334c0585-749a-44c8-b51c-103ff91ff81c}{250}" paraid="1519986144"><strong>Stop &ndash;</strong> This will stop the movers but will keep them enabled.&nbsp;</li>



<li paraeid="{e12f2616-cfdb-4722-a69e-8637d8283319}{1}" paraid="1078918102"><strong>Disable &ndash;</strong> This will remove the movers from their tracks, which allows for errors to be reset. If your track is mounted vertically, it&rsquo;s worth noting that this will depower the movers and they will succumb to gravity.&nbsp;</li>
</ul>



<p class="wp-block-paragraph">Click the enable button. Then click the start button. If you have a physical XTS system, you should see the movers start to move. Both physical and simulation systems can take advantage of the XTS tool window to see a live view of the track.&nbsp;</p>



<h3 id="h-live-monitor-the-xts-track-nbsp" class="wp-block-heading">Live Monitor the XTS Track&nbsp;</h3>



<p class="wp-block-paragraph">Go back to the XTS tool window. You should be able to click the live view button to see the current state of the movers on the XTS track.&nbsp;</p>



<p class="wp-block-paragraph">At this point, you should see the movers going around the track according to the station logic that was already in the code we downloaded from Beckhoff’s GitHub.&nbsp;</p>



<p class="wp-block-paragraph">&nbsp;</p>



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



<p class="wp-block-paragraph">This should help get your physical or simulated XTS system moving. However, all XTS systems are different&nbsp;and this default station logic likely isn’t going to work for your application. Next time, we will explore how to set up stations, position triggers, zones, and other things that can help customize the XTS system further.</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"><strong>Need help developing PLC logic for a Beckhoff XTS application?</strong></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">Discover how DMC&#8217;s <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> experts can accelerate your XTS project, and learn more about our <a href="https://static.dmcinfo.com/about/partners/beckhoff-platinum-solution-provider/" data-type="page" data-id="891">Beckhoff</a> partnership.</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>The post <a href="https://static.dmcinfo.com/blog/15598/beckhoff-xts-part-3-simulation-and-plc-logic/">Beckhoff XTS Part 3 &#8211; Simulation and PLC Logic</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff XTS Part 2 – Setting Up a Physical XTS System</title>
		<link>https://static.dmcinfo.com/blog/15650/beckhoff-xts-part-2-setting-up-a-physical-xts-system/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Fri, 21 Feb 2025 15:04:48 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/15650/beckhoff-xts-part-2-setting-up-a-physical-xts-system/</guid>

					<description><![CDATA[<p>In the previous blog in this series, we introduced Beckhoff XTS and why you should consider using it. We also walked through downloading and installing the necessary packages and setting up a base project. In this post, we will continue to build upon those steps&#160;as we configure a physical XTS system.&#160; Note: This blog and [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/15650/beckhoff-xts-part-2-setting-up-a-physical-xts-system/">Beckhoff XTS Part 2 – Setting Up a Physical XTS System</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In the <a href="https://static.dmcinfo.com/latest-thinking/blog/id/13704/beckhoff-xts-part-1-downloads-and-starter-project">previous blog in this series</a>, we introduced Beckhoff XTS and why you should consider using it. We also walked through downloading and installing the necessary packages and setting up a base project. In this post, we will continue to build upon those steps&nbsp;as we configure a physical XTS system.&nbsp;</p>



<p class="wp-block-paragraph">Note: This blog and all its images are from TwinCAT XAE build 3.1.4024.62. Since XTS is one of Beckhoff’s newer offerings, they are consistently providing more features so some aspects may look different in newer versions, especially in builds 3.1.4026.XX and beyond. As a reminder, this blog series is utilizing the <a href="https://github.com/Beckhoff-USA-Community/XTS_Base/tree/master" target="_blank">XTS_Base code provided on Beckhoff’s GitHub</a>.&nbsp;</p>



<h2 id="h-beckhoff-xts-series" class="wp-block-heading">Beckhoff XTS Series</h2>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13704/beckhoff-xts-part-1-downloads-and-starter-project">Part 1 &#8211; Downloads and Starter Project</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13712/beckhoff-xts-part-3--simulation-and-plc-logic">Part 3 &#8211; Simulation and PLC Logic</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14734/beckhoff-xts-part-4-movers">Part 4 &#8211; Movers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14735/beckhoff-xts-part-5-stations">Part 5 &#8211; Stations</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14736/beckhoff-xts-part-6-position-triggers">Part 6 &#8211; Position Triggers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14737/beckhoff-xts-part-7-customizing-logic">Part 7 &#8211; Customizing Logic</a></li>
</ul>



<h2 id="h-setting-up-a-physical-xts-system-nbsp" class="wp-block-heading">Setting Up a Physical XTS System&nbsp;</h2>



<p class="wp-block-paragraph">This blog will be using the large <a href="https://www.beckhoff.com/nl-be/products/motion/xts-linear-product-transport/xts-starter-kits/at2000-1500-0170.html" target="_blank">XTS starter kit</a>, though the steps should be similar for any XTS track and mover configuration.&nbsp;</p>



<h3 id="h-scan-in-io-nbsp" class="wp-block-heading">Scan in IO&nbsp;</h3>



<p class="wp-block-paragraph">Before we can set up the XTS system, we have to bring the XTS hardware into the TwinCAT solution. To do this, go down to I/O, right click on Devices, and select Scan. If you’re not able to scan, it’s likely your target is in run mode. You’ll have to switch it into config mode by clicking the blue icon with the gear in it before scanning devices in.&nbsp;</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/beckhoff-xts-scan-io.png" alt="beckhoff xts scani/o"/></figure>



<p class="wp-block-paragraph">If you get a popup saying that not all types of devices can be found automatically, click OK. The XTS tracks and movers should be found automatically. Select Yes for both the scan for boxes and the activate free run popups.</p>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">If the hardware is connected to the PLC correctly and powered on, you will see a popup similar to the one below. Make sure to select the RT-Ethernet Adapter and the EtherCAT devices. In the image below its devices 4, 9, 10, and 11.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/beckhoff-xts-new-io-devices-found.png" alt="beckhff xts new i/o devices found"/></figure>



<p class="wp-block-paragraph">After clicking OK, the software will take some time to scan in the hardware. After it scans, you should see all the devices you have connected to the PLC appear in the IO tree. For example, the large XTS starter kit IO looks like the image below.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/beckhoff-xts-starter-kit-io.png" alt="Beckhoff xts starter kit i/o"/></figure>



<p class="wp-block-paragraph">Note: the movers are not included in the IO tree. That will come later.</p>



<h3 id="h-start-the-xts-configurator" class="wp-block-heading">Start the XTS Configurator</h3>



<p class="wp-block-paragraph">Go back to the XTS tool window and start the XTS configurator. This is the gear icon with a green arrow.</p>



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



<h2 id="h-configure-xts-parts" class="wp-block-heading">Configure XTS Parts</h2>



<p class="wp-block-paragraph">You’ll be presented with a popup for the XTS configurator. Click past the first screen to get to the screen for configuring parts. You’ll see a warning towards the bottom that says no modules have been added yet. Right above that, click the plus button to add some modules.</p>



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



<p class="wp-block-paragraph">After clicking the plus button, you should see the devices with XTS parts available for selection. The image below is what the large XTS starter kit scans in as. Select all the devices by using Shift+Click and click OK.&nbsp;</p>



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



<p class="wp-block-paragraph">After clicking OK, the modules should be displayed in the bottom left where the “no modules” warning used to be. These can be adjusted relative to each other by selecting a module and using the up/down arrows to adjust its relative location. Note that the track shape is displayed in the main window to help orient the track to its physical setup. Once you’re done adding parts, select the right arrow in the bottom right corner.</p>



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



<h2 id="h-configure-xts-tracks" class="wp-block-heading">Configure XTS Tracks</h2>



<p class="wp-block-paragraph">See <a href="https://infosys.beckhoff.com/content/1033/xts_software/10518303499.html?id=5057607251771315029" target="_blank" rel="noreferrer noopener">Beckhoff’s information page on XTS tracks</a> for a complete definition. Generally, tracks are groupings of XTS parts that have minimal or no overlap in movers and/or parts. The large XTS starter kit has only one track and it is a loop, so we will check the box for is closed.&nbsp;</p>



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



<p class="wp-block-paragraph">If your system has multiple tracks, you can add them through the plus button in the top bar and configure each individually by selecting each track under the XTS ProcessingUnit and adding the parts that are associated with that track. Click to the next section of the configurator once you’re done configuring tracks.</p>



<h2 id="h-configure-xts-stations" class="wp-block-heading">Configure XTS Stations</h2>



<p class="wp-block-paragraph">XTS stations in this configurator are still in the beta phase and are currently purely cosmetic. They will display in the XTS tool window, but the movers cannot use these stations in their logic. If you want to set up cosmetic stations, you can add them with the plus button in the top bar. These can be useful for visualizing your XTS stations but can often be misleading since they’re not directly tied to mover logic. In this example, we won’t use these cosmetic stations, but feel free to add them if it’s useful in your application.</p>



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



<p class="wp-block-paragraph">Click to the next section of the configurator once you’re done configuring stations.</p>



<h2 id="h-configuring-xts-movers" class="wp-block-heading">Configuring XTS Movers</h2>



<p class="wp-block-paragraph">Before adding any movers, make sure to select the mover type and magnet plate type that you’re using in your application. If needed, you can reference the Beckhoff XTS catalog to verify which mover type you have.</p>



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



<p class="wp-block-paragraph">Once the mover type and magnet plate type are selected, click the plus button until you have added the same number of movers as the physical system. In the large XTS starter kit, we have 10 AT9011_0070 movers with magnet plates AT9001_0550, so that’s what the image below shows.</p>



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



<p class="wp-block-paragraph">Click to the next section of the configurator once you’re done configuring movers.</p>



<h2 id="h-configuring-control-areas" class="wp-block-heading">Configuring Control Areas</h2>



<p class="wp-block-paragraph">Control areas can be defined to allow different parameter sets to be used for different track segments. For example, if our XTS starter kit was mounted vertically, we might want different PID control for the movers while they’re sliding with/against gravity. For this example, we will not set up any control areas. Click to the next section of the configurator once you’re done configuring control areas.</p>



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



<h2 id="h-configuring-xts-real-time-settings" class="wp-block-heading">Configuring XTS Real-Time Settings</h2>



<p class="wp-block-paragraph">Lastly, we need to set the real-time settings for the XTS system. This is functionally the same as going to SYSTEM &gt; Real-Time, but it’s conveniently here in the configurator as well. First, navigate to the System tab and click the download button to sync the number of cores on your target to the configurator.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/configure-beckhoff-XTS-Real-Time-Settings.png" alt="configure beckhoff XTS Real-Time Settings"/></figure>



<p class="wp-block-paragraph">Say yes to the popup that asks if you want to overwrite the current CPU config.</p>



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



<p class="wp-block-paragraph">The XTS Task 1 has to be configured onto an isolated CPU by itself with a 250μs base time and 1 cycle tick. Isolated cores are represented by an orange rectangle on the right side of the core. You can select which cores are being used with the checkbox on the left side and move tasks around using the up and down arrows on each task. The remaining tasks on the system can be set up to fit your system&#8217;s needs, but the XTS Task 1 should be configured like the image below.</p>



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



<h2 id="h-finish-the-xts-configurator" class="wp-block-heading">Finish the XTS Configurator</h2>



<p class="wp-block-paragraph">Click the next button a couple times and the XTS configurator should process the information to add the XTS system to your solution. This may take a few minutes, but afterwards the configurator should close.</p>



<p class="wp-block-paragraph">Our physical XTS system has now been set up. The next blog in this series will go over how to set up a simulated version of your XTS system and how to update the PLC logic to start sending movers around the track.</p>



<h2 id="h-beckhoff-xts-series-0" class="wp-block-heading">Beckhoff XTS Series</h2>



<p class="wp-block-paragraph"><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13704/beckhoff-xts-part-1-downloads-and-starter-project">Part 1 &#8211; Downloads and Starter Project</a><br><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13712/beckhoff-xts-part-3--simulation-and-plc-logic">Part 3 &#8211; Simulation and PLC Logic</a></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"><strong>From System Configuration to Production Deployment</strong>.</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">DMC is proud to be a <a href="https://static.dmcinfo.com/about/partners/beckhoff-platinum-solution-provider/" data-type="page" data-id="891">Beckhoff System Integrator</a> and has worked on multiple XTS projects and applications. Learn more about our <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> expertise for your next project.</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>The post <a href="https://static.dmcinfo.com/blog/15650/beckhoff-xts-part-2-setting-up-a-physical-xts-system/">Beckhoff XTS Part 2 – Setting Up a Physical XTS System</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff XTS Part 1 – Downloads and Starter Project</title>
		<link>https://static.dmcinfo.com/blog/15666/beckhoff-xts-part-1-downloads-and-starter-project/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Mon, 03 Feb 2025 18:13:33 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/15666/beckhoff-xts-part-1-downloads-and-starter-project/</guid>

					<description><![CDATA[<p>This blog and all its images are from TwinCAT XAE build 3.1.4024.62. Since XTS is one of Beckhoff’s newer offerings, they are consistently providing more features so some aspects may look different in newer versions, especially in builds 3.1.4026.XX and beyond.&#160; Beckhoff XTS Series Table of Contents Why Beckhoff XTS? Download and Installation &#160; Download [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/15666/beckhoff-xts-part-1-downloads-and-starter-project/">Beckhoff XTS Part 1 – Downloads and Starter Project</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">This blog and all its images are from TwinCAT XAE build 3.1.4024.62. Since XTS is one of Beckhoff’s newer offerings, they are consistently providing more features so some aspects may look different in newer versions, especially in builds 3.1.4026.XX and beyond.&nbsp;</p>



<h2 id="h-beckhoff-xts-series" class="wp-block-heading">Beckhoff XTS Series</h2>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13706/beckhoff-xts-part-2-setting-up-a-physical-xts-system">Part 2&nbsp;&#8211;&nbsp;Setting Up a Physical XTS System</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/13712/beckhoff-xts-part-3--simulation-and-plc-logic">Part 3 &#8211; Simulation and PLC Logic</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14734/beckhoff-xts-part-4-movers">Part 4 &#8211; Movers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14735/beckhoff-xts-part-5-stations">Part 5 &#8211; Stations</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14736/beckhoff-xts-part-6-position-triggers">Part 6 &#8211; Position Triggers</a></li>



<li><a href="https://static.dmcinfo.com/latest-thinking/blog/id/14737/beckhoff-xts-part-7-customizing-logic">Part 7 &#8211; Customizing Logic</a></li>
</ul>



<h2 id="h-table-of-contents" class="wp-block-heading">Table of Contents</h2>



<p class="wp-block-paragraph"><a href="#why">Why Beckhoff XTS?</a><br>
<a href="#Download and Installation">Download and Installation</a><br>
&nbsp; <a href="#download">Download</a><br>
&nbsp; <a href="#installation">Installation</a><br>
<a href="#Setting Up Base Project">Setting Up Base Project</a><br>
&nbsp; <a href="#open xts">Open the XTS Tool Window</a><br>
&nbsp; <a href="#clear out">Clear Out the Existing XTS System</a></p>



<h2 id="h-why-beckhoff-xts" class="wp-block-heading"><a id="why" name="why"></a>Why Beckhoff XTS?</h2>



<p class="wp-block-paragraph">The <a href="https://www.beckhoff.com/en-us/products/motion/xts-linear-product-transport/at8x00-at9xxx-ath9xxx-xts-guide-rails-and-movers/at8x00-at9xxx-ath9xxx-xts-guide-rails-and-movers.html" target="_blank">eXtended Transport System (XTS)</a> is Beckhoff’s linear product transport solution. Linear transport systems allow for smart product transportation. Since products are on individual movers, it allows for easy diverting of rejected products or parallelization of duplicated stations to reduce cycle time. Since the movers can be programmed to stop at stations, this allows for parts to be manipulated directly on the movers, which can greatly reduce the amount of time it takes to move products from station to station. Additionally, a linear transport system often reduces the footprint on the factory floor as compared to traditional conveyor belt solutions.&nbsp;</p>



<p class="wp-block-paragraph">XTS is unique from other linear transport systems because it utilizes the EtherCAT framework and TwinCAT Motion libraries to produce a plug-and-play solution for many applications. There’s also a wide variety of options to customize your XTS system from <a href="https://www.beckhoff.com/en-us/products/motion/xts-with-nct/" target="_blank">no-cable technology (NCT)</a> allowing you to power electronics on each individual mover to <a href="https://infosys.beckhoff.com/content/1033/xts_hygienic_design_ba/index.html?id=1836410892129756218" target="_blank" rel="noreferrer noopener">hygienic solutions</a> that are IP69K rated. &nbsp;</p>



<p class="wp-block-paragraph">Beckhoff XTS can be the right solution for a wide variety of applications, and this blog series on getting started with XTS is going to help give you the tools to effectively utilize this innovative technology. We’ll start with installing the right packages and setting up a base project today.&nbsp;</p>



<h2 id="h-download-and-installation" class="wp-block-heading"><a id="Download and Installation" name="Download and Installation"></a>Download and Installation</h2>



<h3 id="h-download" class="wp-block-heading"><a id="download" name="download"></a>Download</h3>



<p class="wp-block-paragraph">First, download <a href="https://www.beckhoff.com/en-us/products/automation/twincat/tfxxxx-twincat-3-functions/tf5xxx-motion/tf5850.html" target="_blank">TF5850</a> and <a href="https://www.beckhoff.com/en-us/products/automation/twincat/tfxxxx-twincat-3-functions/tf5xxx-motion/tf5410.html" target="_blank">TF5410</a> from the Beckhoff website. The installers are located in Documentation and Downloads &gt; Software and Tools.&nbsp;</p>



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



<h3 id="h-installation" class="wp-block-heading"><a id="installation" name="installation"></a>Installation</h3>



<p class="wp-block-paragraph">Once downloaded, you will need to run the two .EXE files on both the engineering computer and on the PLC. To download onto the PLC, the simplest way is to move the .EXE files onto a USB and plug this into the PLC. Once the USB is plugged in, you can either remote into the PLC (Remote Desktop Connection) or connect a monitor and mouse using any of the outputs on the PLC. Once connected, run the .EXE files on the PLC and install the software.<br>
<br>
Note: You will have to restart the engineering computer and PLC after running the installers, so make sure the PLC’s system is in a state to do so.</p>



<h3 id="h-open-twincat-xae" class="wp-block-heading"><a id="open twincat" name="open twincat"></a>Open TwinCAT XAE</h3>



<p class="wp-block-paragraph">Once installation is complete, open TwinCAT XAE. This blog will use the <a href="https://github.com/Beckhoff-USA-Community/XTS_Base/tree/master" target="_blank">XTS_Base code provided on Beckhoff’s GitHub</a> since it provides a lot of reusable code to interact with movers and set up stations. Downloading this project will give a great starting point for the rest of this blog series, but you should be able to follow along in your own TwinCAT solution if desired. If you haven&#8217;t already installed TwinCAT XAE or configured your Beckhoff IPC yet, <a href="https://static.dmcinfo.com/latest-thinking/blog/id/10162/getting-started-with-a-beckhoff-plc-part-one--setup">check out our setup blog on how to get started</a> and then come back to step 3.</p>



<h2 id="h-setting-up-base-project" class="wp-block-heading"><a id="Setting Up Base Project" name="Setting Up Base Project"></a>Setting Up Base Project</h2>



<h3 id="h-open-the-xts-tool-window" class="wp-block-heading"><a id="open xts" name="open xts"></a>Open the XTS Tool Window</h3>



<p class="wp-block-paragraph">In the top bar of the XAE solution, go to TwinCAT &gt; XTS &gt; XTS Tool Window to open the XTS tool window.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/beckhoff-xts-tool-window.png" alt="Beckhoff XTS tool window"/></figure>



<p class="wp-block-paragraph">This is where we can configure our XTS track, movers, and ultimately go online to monitor the XTS system. The XTS_Base project this blog starts with already has an XTS track configured. Let’s clear out that track so we can set it up ourselves.&nbsp;</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/clear-beckhoff-xts-track.png" alt="clear out beckhoff ext track"/></figure>



<h3 id="h-clear-out-the-existing-xts-system" class="wp-block-heading"><a id="clear out" name="clear out"></a>Clear Out the Existing XTS System</h3>



<p class="wp-block-paragraph">There are three main places where XTS components are stored. They are SYSTEM &gt; TcCOM Objects, MOTION &gt; NC SAF &gt; Axes, and I/O &gt; Devices. This blog series will go into more detail about each of these sections later on, but for now we will want to clear out everything under these sections to remove the existing XTS system. Namely, remove XtsProcessingUnit 1, Mover Axis 1-6, and Device 1 and Device 3. We also need to remove SYSTEM &gt; Tasks &gt; XTS Task 1.</p>



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



<p class="wp-block-paragraph">Once all those objects have been removed, go back to the XTS tool window and click the refresh button. The XTS track and movers should disappear.</p>



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



<p class="wp-block-paragraph">With that, the downloads and starter project are set up for our XTS project. We are now ready to set up our own XTS system. The next blog in this series will go over how to set up a physical XTS system.</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"><strong>Implement an XTS-Based Machine Automation Solution</strong> for Your Next Project.</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">Turn your data into a competitive advantage with DMC&#8217;s <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> solutions. Learn more about our <a href="https://static.dmcinfo.com/about/partners/beckhoff-integrator-group">Beckhoff partnership</a> and capabilities.</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>The post <a href="https://static.dmcinfo.com/blog/15666/beckhoff-xts-part-1-downloads-and-starter-project/">Beckhoff XTS Part 1 – Downloads and Starter Project</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Getting Started with Database Server in Beckhoff TwinCAT 3</title>
		<link>https://static.dmcinfo.com/blog/16328/getting-started-with-database-server-in-beckhoff-twincat-3/</link>
		
		<dc:creator><![CDATA[Carter Silvey]]></dc:creator>
		<pubDate>Fri, 03 May 2024 09:41:19 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Beckhoff]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[TwinCAT3]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/16328/getting-started-with-database-server-in-beckhoff-twincat-3/</guid>

					<description><![CDATA[<p>Table of contents Being able to store long term data is one of the most crucial parts of a manufacturing or testing environment. Having access to this data can allow a team to track long term trends of their systems. For instance, one team&#160;could track the uptimes of the various production lines to find where [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/16328/getting-started-with-database-server-in-beckhoff-twincat-3/">Getting Started with Database Server in Beckhoff TwinCAT 3</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 id="h-table-of-contents" class="wp-block-heading">Table of contents</h2>



<ol class="wp-block-list">
<li><a href="#download">Download and Installation</a></li>



<li><a href="#database">Adding the Database Project to a TwinCAT 3 Solutions</a></li>



<li><a href="#code">Writing Code to Write to the Database Server</a></li>



<li><a href="#testing">Testing the Database Connection</a></li>
</ol>



<p class="wp-block-paragraph">Being able to store long term data is one of the most crucial parts of a manufacturing or testing environment. Having access to this data can allow a team to track long term trends of their systems. For instance, one team&nbsp;could track the uptimes of the various production lines to find where the bottlenecks in the process flow are. Another team could use their motor&#8217;s&nbsp;speed data to track when it needs maintenance.</p>



<p class="wp-block-paragraph">Beckhoff TwinCAT 3 offers the ability to run a database server directly on the IPC using their TF6420 module. This module allows you to send data up to most types of databases, though this blog will provide specific examples by using a <a href="https://www.postgresql.org/" target="_blank">PostgreSQL</a> database since it is free to use,&nbsp;open source, and uses structured query language (SQL).</p>



<h2 id="download" class="wp-block-heading">1. Download and Installation</h2>



<h3 id="h-1-1-download" class="wp-block-heading">1.1. Download</h3>



<p class="wp-block-paragraph">First,&nbsp;<a href="https://www.beckhoff.com/en-us/products/automation/twincat/tfxxxx-twincat-3-functions/tf6xxx-connectivity/tf6420.html?" target="_blank" rel="noreferrer noopener">Download TF6420 from the Beckhoff website</a>. The installer is located in Documentation and Downloads&nbsp;&gt; Software and Tools.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="619" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-download.png" alt="" class="wp-image-34727" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-download.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-download-300x214.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-download-768x549.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<h3 id="h-1-2-installation" class="wp-block-heading">1.2. Installation</h3>



<p class="wp-block-paragraph">Once downloaded you will need to run the .EXE on both the engineering computer and on the PLC. To download onto the PLC, the simplest way is to move the .EXE onto a USB and plug this into the PLC. Once the USB is plugged in, you can either remote into the PLC (Remote Desktop Connection) or connect a monitor and mouse using any of the outputs on the PLC. Once connected, run the .EXE on the PLC and install the software.</p>



<h3 id="h-1-3-open-twincat-xae" class="wp-block-heading">1.3. Open TwinCAT XAE</h3>



<p class="wp-block-paragraph">Once the installer is complete, open the TwinCAT XAE solution in which the database connection should be installed. If you haven&#8217;t already installed TwinCAT XAE or configured your Beckhoff IPC yet, <a href="https://static.dmcinfo.com/blog/19695/getting-started-with-a-beckhoff-plc-part-one-setup/">check out our setup blog on how to get started </a>and then come back to step 2.</p>



<h2 id="database" class="wp-block-heading">2. Adding the Database Project to a TwinCAT 3 Solution</h2>



<h3 id="h-2-1-add-new-database-server-nbsp-project" class="wp-block-heading">2.1. Add New Database Server&nbsp;Project</h3>



<p class="wp-block-paragraph">Within the project, right-click on the project solution -&gt; Add -&gt; New Project</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="438" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-new-project.png" alt="" class="wp-image-34731" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-new-project.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-new-project-300x152.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-new-project-768x388.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">In the window that opens, select TwinCAT Connectivity and then choose &#8220;Empty TwinCAT Database Server Project&#8221;</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="602" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-empty-twincat-database-server-project.png" alt="" class="wp-image-34733" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-empty-twincat-database-server-project.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-empty-twincat-database-server-project-300x209.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-empty-twincat-database-server-project-768x534.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<h3 class="wp-block-heading">2.2. Add and Configure the Database</h3>



<p class="wp-block-paragraph">Once the new project is added, there should be a default TcDbServer already added under the project. There is currently no database in the project, but this can be done by right-clicking TcDbServer -&gt; Add New Database</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="433" height="576" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-new-database.png" alt="" class="wp-image-34734" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-new-database.png 433w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-new-database-226x300.png 226w" sizes="(max-width: 433px) 100vw, 433px" /></figure>



<p class="wp-block-paragraph">You will then see a new DB server appear under TcDbServer. The server can be configured by double-clicking the DB. This will bring up the configuration window. Currently the window is empty, but this can be fixed by selecting the database type pictured below. For this example, a PostgreSQL database will be used.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="436" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-postgresql.png" alt="" class="wp-image-34735" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-postgresql.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-postgresql-300x151.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-postgresql-768x387.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">Once the database type is selected, the settings will appear and can be configured there. For PostgreSQL, the first few settings are Host, Database, and Port. The next option is Authentication which contains a drop down with different kinds of authentication. The example below is going to use Username/Password.</p>



<p class="wp-block-paragraph"><em>Note:&nbsp;The password used here is encrypted and is not stored in plain text anywhere on the PLC</em></p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="442" height="269" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-username-password.png" alt="" class="wp-image-34736" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-username-password.png 442w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-username-password-300x183.png 300w" sizes="(max-width: 442px) 100vw, 442px" /></figure>



<h3 id="h-2-3-set-target-ams-net-id" class="wp-block-heading">2.3. Set Target AMS Net ID</h3>



<p class="wp-block-paragraph">Once all the information is added, the connection is not quite ready to be tested. The AMS Net ID must be set up first. To do this, go back to TcDbServer and double click the tab. Once the server settings window is open, there is a dropdown menu in the top left where all the options for Ams Net Ids appear.</p>



<p class="wp-block-paragraph">For testing on a local machine select &lt;Local&gt;.</p>



<p class="wp-block-paragraph">If this is running on a PLC and you are connected to the PLC, the name of the PLC will be on this menu and you can choose that instead.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="451" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-ams-net-selection.png" alt="" class="wp-image-34739" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-ams-net-selection.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-ams-net-selection-300x156.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-ams-net-selection-768x400.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<h3 id="h-2-4-tf6420-license" class="wp-block-heading">2.4. TF6420 License</h3>



<p class="wp-block-paragraph">Before checking the connection to the server, the TF6420 license must be activated. For now, a trial license can be generated. First start by going to the Manage License tab at the top of the window that has opened. Next scroll all the way down to TF6420 TC3 Database Server and check the box next to it that says cpu license.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="296" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-license.png" alt="" class="wp-image-34741" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-license.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-license-300x103.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-license-768x263.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">After this box is checked, go back to the main license screen and into the Order Information (Runtime) tab. Once here go down to the 7 Days Trial License and click on that. A small screen will then appear in which you will type a short captcha. Once this is typed, hit Ok and the license will be generated.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="432" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-7-day-trial-license.png" alt="" class="wp-image-34742" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-7-day-trial-license.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-7-day-trial-license-300x150.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-7-day-trial-license-768x383.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<h3 id="h-2-5-activate-database-configuration" class="wp-block-heading">2.5. Activate Database Configuration</h3>



<p class="wp-block-paragraph">Next, activate the configuration of the database connection by right-clicking the DB and selecting Activate Configuration.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="433" height="555" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-activate-configuration.png" alt="" class="wp-image-34744" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-activate-configuration.png 433w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-activate-configuration-234x300.png 234w" sizes="(max-width: 433px) 100vw, 433px" /></figure>



<p class="wp-block-paragraph">(Optional) The database server toolbar&nbsp;is optional, but will be beneficial moving forward. At the top of the screen on the task bar, right-click and select TwinCAT Database Server. This will add a new set of tools at the top that can be used with the databases (one of them being activate configuration).</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="320" height="789" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-database-toolbar.png" alt="" class="wp-image-34745" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-database-toolbar.png 320w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-database-toolbar-122x300.png 122w" sizes="(max-width: 320px) 100vw, 320px" /></figure>



<p class="wp-block-paragraph">Here is what the toolbar will look like when added:</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="320" height="28" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-database-toolbar.png" alt="" class="wp-image-34746" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-database-toolbar.png 320w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-database-toolbar-300x26.png 300w" sizes="(max-width: 320px) 100vw, 320px" /></figure>



<h3 id="h-2-6-check-database-connection" class="wp-block-heading">2.6. Check Database Connection</h3>



<p class="wp-block-paragraph">After activating configuration, check this connection by going back to the DB page. At the bottom, there will be 2 options, CREATE and CHECK. Select CHECK.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="687" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-check-database.png" alt="" class="wp-image-34747" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-check-database.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-check-database-300x238.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-check-database-768x609.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">If everything went well, you should see a pop up that says the check succeeded. If not, verify all database information is correct and go back to step 8.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="314" height="196" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-configuration-check-succeeded.png" alt="" class="wp-image-34748" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-configuration-check-succeeded.png 314w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-configuration-check-succeeded-300x187.png 300w" sizes="(max-width: 314px) 100vw, 314px" /></figure>



<h3 id="h-2-7-add-database-to-configuration-pool" class="wp-block-heading">2.7. Add Database to Configuration Pool</h3>



<p class="wp-block-paragraph">Once the database is configured, it needs to be added to the DB configuration pool. This can be done by right-clicking on the DB and hitting the Add to DB Configuration Pool tab.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="433" height="482" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-to-configuration-pool.png" alt="" class="wp-image-34749" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-to-configuration-pool.png 433w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-to-configuration-pool-270x300.png 270w" sizes="(max-width: 433px) 100vw, 433px" /></figure>



<h2 id="code" class="wp-block-heading">3. Writing Code to Write to the Database Server</h2>



<h3 id="h-3-1-installing-reference-libraries" class="wp-block-heading">3.1. Installing Reference Libraries</h3>



<p class="wp-block-paragraph">Once added to the DB Configuration Pool, there are a few basic functions to test the connection and write a few queries. In order to use these, we will need to install 2 additional libraries. To do this, go to the PLC project that the database will be called in. Then go to the references tab in the project tree pictured below. Right-click this and then select Add library.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="433" height="428" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-library.png" alt="" class="wp-image-34750" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-library.png 433w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-add-library-300x297.png 300w" sizes="(max-width: 433px) 100vw, 433px" /></figure>



<p class="wp-block-paragraph">This will open a library window where the 2 libraries needed for database are located. Tc3_Database and Tc3_EventLogger.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="771" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-tc3-database-and-tc3-eventlogger.png" alt="" class="wp-image-34751" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-tc3-database-and-tc3-eventlogger.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-tc3-database-and-tc3-eventlogger-300x267.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-tc3-database-and-tc3-eventlogger-768x684.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<h3 id="h-3-2-example-code" class="wp-block-heading">3.2. Example Code</h3>



<p class="wp-block-paragraph">We can now use the built-in TwinCAT functions to send a basic SQL command. Again, for this example we&#8217;re using PostgreSQL functions and syntax. Under POUs, open MAIN and put the following code in the variable declaration section:</p>


<pre class="”brush:pascal”"><br /><br />
</pre>


<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">Pascal</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>VAR 
    nStep, nNextStep : INT; 
    sQuery : STRING; 
    fbDatabase : FB_SQLDatabaseEvt(sNetID := '', tTimeout := T#5S); 
    fbSqlCommand : FB_SQLCommandEvt(sNetID := '', tTimeout := T#5S); 
    tcMessage : I_TcMessage;  
END_VAR</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">VAR</span><span style="color: #D4D4D4"> </span></span>
<span class="line"><span style="color: #D4D4D4">    nStep, nNextStep : INT; </span></span>
<span class="line"><span style="color: #D4D4D4">    sQuery : </span><span style="color: #569CD6">STRING</span><span style="color: #D4D4D4">; </span></span>
<span class="line"><span style="color: #D4D4D4">    fbDatabase : FB_SQLDatabaseEvt(sNetID := </span><span style="color: #CE9178">&apos;&apos;</span><span style="color: #D4D4D4">, tTimeout := T</span><span style="color: #CE9178">#5</span><span style="color: #D4D4D4">S); </span></span>
<span class="line"><span style="color: #D4D4D4">    fbSqlCommand : FB_SQLCommandEvt(sNetID := </span><span style="color: #CE9178">&apos;&apos;</span><span style="color: #D4D4D4">, tTimeout := T</span><span style="color: #CE9178">#5</span><span style="color: #D4D4D4">S); </span></span>
<span class="line"><span style="color: #D4D4D4">    tcMessage : I_TcMessage;  </span></span>
<span class="line"><span style="color: #D4D4D4">END_VAR</span></span></code></pre></div>



<p class="wp-block-paragraph">Here is a&nbsp;brief explanation of each variable:</p>



<ul class="wp-block-list">
<li>nStep and nNextStep are used to drive a state machine.</li>



<li>sQuery is the raw string for the query we want to send to the database</li>



<li>FB_SQLDatabaseEvt is responsible for connecting, disconnecting and overall communication with the database.</li>



<li>FB_SQLCommandEvt is responsible for generating a SQL command to be sent via the FB_SQLDatabaseEvt. Note: A standard STRING will not work if being sent through FB_SQLDatabaseEvt, even if the syntax is correct.</li>



<li>I_TcMessage will store any messages sent back from the database server. This will be helpful for identifying errors if there are any.</li>
</ul>



<p class="wp-block-paragraph">In the code execution section of MAIN, add the following basic state machine:</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">Pascal</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>//Generate the query string.
//Change TableName to your table's name.
//Change column1 and column2 to the column names (include any other columns your table has, separated by ,).
//Change $'value1$' and $'value2$' to the values you wish to send.
//Note: $ is an escape character for a single quote. Single quotes indicate a string.

sQuery := 'INSERT INTO TableName (column1, column2) values ($'value1$', $'value2$')';

CASE nStep OF
    0:
        //Connect to the database at database ID 1
        IF fbDatabase.Connect(1) THEN
            nNextStep := 10;
        END_IF
    10:
        //Move the database message result to tcMessage
        tcMessage := fbDatabase.ipTcResult;
        //Go to disconnect step if there's an error
        IF fbDatabase.bError THEN
            nNextStep := 99;
        END_IF
        //Create a SQL command
        IF fbDatabase.CreateCmd(ADR(fbSqlCommand)) THEN
            nNextStep := 20;
        END_IF
    20:
        //Execute the SQL command of sQuery
        IF fbSQLCommand.Execute(ADR(sQuery), SIZEOF(sQuery)) >= 0 THEN
            tcMessage := fbSQLCommand.ipTcResult;
            nNextStep := 99;
        END_IF
    99:
        //Disconnect from the database
        IF fbDatabase.Disconnect() THEN
            nNextStep := 0;
        END_IF
END_CASE
 
//Advance the state machine step
nStep := nNextStep;</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">//Generate the query string.</span></span>
<span class="line"><span style="color: #6A9955">//Change TableName to your table&apos;s name.</span></span>
<span class="line"><span style="color: #6A9955">//Change column1 and column2 to the column names (include any other columns your table has, separated by ,).</span></span>
<span class="line"><span style="color: #6A9955">//Change $&apos;value1$&apos; and $&apos;value2$&apos; to the values you wish to send.</span></span>
<span class="line"><span style="color: #6A9955">//Note: $ is an escape character for a single quote. Single quotes indicate a string.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">sQuery := </span><span style="color: #CE9178">&apos;INSERT INTO TableName (column1, column2) values ($&apos;</span><span style="color: #D4D4D4">value1$</span><span style="color: #CE9178">&apos;, $&apos;</span><span style="color: #D4D4D4">value2$</span><span style="color: #CE9178">&apos;)&apos;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">CASE</span><span style="color: #D4D4D4"> nStep </span><span style="color: #569CD6">OF</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #6A9955">//Connect to the database at database ID 1</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #569CD6">IF</span><span style="color: #D4D4D4"> fbDatabase.Connect(</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">) </span><span style="color: #569CD6">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">            nNextStep := </span><span style="color: #B5CEA8">10</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">        END_IF</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #B5CEA8">10</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #6A9955">//Move the database message result to tcMessage</span></span>
<span class="line"><span style="color: #D4D4D4">        tcMessage := fbDatabase.ipTcResult;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #6A9955">//Go to disconnect step if there&apos;s an error</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #569CD6">IF</span><span style="color: #D4D4D4"> fbDatabase.bError </span><span style="color: #569CD6">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">            nNextStep := </span><span style="color: #B5CEA8">99</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">        END_IF</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #6A9955">//Create a SQL command</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #569CD6">IF</span><span style="color: #D4D4D4"> fbDatabase.CreateCmd(ADR(fbSqlCommand)) </span><span style="color: #569CD6">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">            nNextStep := </span><span style="color: #B5CEA8">20</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">        END_IF</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #B5CEA8">20</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #6A9955">//Execute the SQL command of sQuery</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #569CD6">IF</span><span style="color: #D4D4D4"> fbSQLCommand.Execute(ADR(sQuery), SIZEOF(sQuery)) &gt;= </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">            tcMessage := fbSQLCommand.ipTcResult;</span></span>
<span class="line"><span style="color: #D4D4D4">            nNextStep := </span><span style="color: #B5CEA8">99</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">        END_IF</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #B5CEA8">99</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #6A9955">//Disconnect from the database</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #569CD6">IF</span><span style="color: #D4D4D4"> fbDatabase.Disconnect() </span><span style="color: #569CD6">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">            nNextStep := </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">        END_IF</span></span>
<span class="line"><span style="color: #D4D4D4">END_CASE</span></span>
<span class="line"><span style="color: #D4D4D4"> </span></span>
<span class="line"><span style="color: #6A9955">//Advance the state machine step</span></span>
<span class="line"><span style="color: #D4D4D4">nStep := nNextStep;</span></span></code></pre></div>



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



<p class="wp-block-paragraph">The state machine will do the following:</p>



<ul class="wp-block-list">
<li>Connect to the database with database ID 1. If you have multiple databases, you can change the database ID input to point to a specific database. You can find this ID by going back to the database configuration page (where you typed in the IP address, port number, etc.) and checking what the DBID is in the top left corner.</li>



<li>Create the SQL command.</li>



<li>Execute the SQL command according to sQuery</li>



<li>Disconnect from the database</li>
</ul>



<p class="wp-block-paragraph">You can activate the configuration for the PLC project to start sending queries to the database!</p>



<h2 id="testing" class="wp-block-heading">4. Testing the Database Connection</h2>



<h3 id="h-4-1-open-tf6420-configurator" class="wp-block-heading">4.1. Open TF6420 Configurator</h3>



<p class="wp-block-paragraph">After activating the configuration, the state machine should be looping through and inserting data into our table. We can check this by opening up the TF6420 Configurator application.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="707" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-configurator.png" alt="" class="wp-image-34752" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-configurator.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-configurator-300x245.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-configurator-768x627.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">The database server and configuration should already be added from our steps to install the database server. If not, refer to the&nbsp;Adding the Database Project to a TwinCAT 3 Solution section.</p>



<h3 id="h-4-2-execute-a-sql-select-query" class="wp-block-heading">4.2. Execute a SQL Select Query</h3>



<p class="wp-block-paragraph">Open the SQL Query Editor.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="316" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-query-editor.png" alt="" class="wp-image-34753" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-query-editor.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-query-editor-300x109.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-query-editor-768x280.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">You should see a list of the SQL databases available from the DB configuration pool. You can click the refresh button if there are no databases currently connected. If that doesn&#8217;t work, make sure you&#8217;ve gone through the above steps and the configuration is activated.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="369" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-databases.png" alt="" class="wp-image-34754" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-databases.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-databases-300x128.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-sql-databases-768x327.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">Drop down the database to see all the available tables. You can right click on the table you&#8217;re writing to and click Select.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="406" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-select-table.png" alt="" class="wp-image-34755" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-select-table.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-select-table-300x141.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-select-table-768x360.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">You can see that TF6420 has auto-generated a select statement for you. If you press the FB_SQLCommandEvt.ExecuteDataReturn button, you should see datasets populate in the results field to the right.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="866" height="383" src="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-execute-sql-statement.png" alt="" class="wp-image-34756" srcset="https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-execute-sql-statement.png 866w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-execute-sql-statement-300x133.png 300w, https://static.dmcinfo.com/wp-content/uploads/2024/05/tf6420-execute-sql-statement-768x340.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></figure>



<p class="wp-block-paragraph">If these are the values you&#8217;re sending to the database then the database server is communicating properly!</p>



<p class="wp-block-paragraph">For more information on some of the topics covered in this blog, please see the following:</p>



<ul class="wp-block-list">
<li><a href="https://infosys.beckhoff.com/content/1033/tf6420_tc3_database_server/index.html?id=3802295219214861788" target="_blank" rel="noreferrer noopener">TF6420 Database Server Infosys Page</a></li>



<li><a href="https://infosys.beckhoff.com/content/1033/tf6420_tc3_database_server/2674353931.html?id=997028420171989533" target="_blank" rel="noreferrer noopener">SQL Expert Mode Function Block Infosys Page</a></li>



<li><a href="https://www.postgresql.org/docs/" target="_blank">PostgreSQL Documentation</a></li>



<li><a href="https://static.dmcinfo.com/blog/19695/getting-started-with-a-beckhoff-plc-part-one-setup/">Getting Started with a Beckhoff PLC</a></li>
</ul>



<p class="wp-block-paragraph">For information that was not discussed directly in this blog&nbsp;but could be good next steps, please see the following:</p>



<ul class="wp-block-list">
<li><a href="https://static.dmcinfo.com/blog/26400/ms-sql-stored-procedures-directly-from-beckhoff-twincat-plc/">MS SQL Stored Procedures Directly from Beckhoff TwinCAT PLC</a></li>



<li><a href="https://static.dmcinfo.com/blog/17976/getting-started-with-opc-ua-in-beckhoff-twincat-3/">Getting Started with OPC UA in Beckhoff TwinCAT 3</a></li>



<li><a href="https://static.dmcinfo.com/blog/16708/sql-server-performance-troubleshooting/">SQL Server Performance Troubleshooting</a></li>



<li><a href="https://infosys.beckhoff.com/content/1033/tf6420_tc3_database_server/5875128203.html?id=7303488825076816628" target="_blank" rel="noreferrer noopener">NoSQL Expert mode Function Block Infosys Page</a></li>
</ul>



<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"><strong>Connect TwinCAT 3 Directly to Your Database</strong>.</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">Explore our <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" data-type="page" data-id="420">Automation</a> expertise in <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming/beckhoff-and-twincat-3-programming/" data-type="page" data-id="457">Beckhoff TwinCAT 3</a>, TF6420 Database Server, PostgreSQL, and PLC-based SQL integration.</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>The post <a href="https://static.dmcinfo.com/blog/16328/getting-started-with-database-server-in-beckhoff-twincat-3/">Getting Started with Database Server in Beckhoff TwinCAT 3</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
