<?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>Programming Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/tag/programming/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Fri, 19 Jun 2026 20:39:21 +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>Programming Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ignition Tricks: Improving Exception Handling and Error Logging</title>
		<link>https://static.dmcinfo.com/blog/44984/ignition-exception-handling/</link>
		
		<dc:creator><![CDATA[Isabelle Chan]]></dc:creator>
		<pubDate>Mon, 15 Jun 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Ignition]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[ignition]]></category>
		<category><![CDATA[Ignition 8.3]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/?p=44984</guid>

					<description><![CDATA[<p>What Are Exceptions in Ignition and Why Should I Care? Exceptions are unexpected events that a program cannot take care of on its own, and stop the program from executing. Exceptions can be caused by a wide range of factors, leaving the user wondering why the system isn’t working when improperly managed. When an exception [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/44984/ignition-exception-handling/">Ignition Tricks: Improving Exception Handling and Error Logging</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="h-what-are-exceptions-in-ignition-and-why-should-i-care">What Are Exceptions in Ignition and Why Should I Care?</h2>



<p class="wp-block-paragraph">Exceptions are unexpected events that a program cannot take care of on its own, and stop the program from executing. Exceptions can be caused by a wide range of factors, leaving the user wondering why the system isn’t working when improperly managed.</p>



<p class="wp-block-paragraph">When an exception occurs, the event details are laid out in an exception object, which can be used to better handle the event. By learning to use these details and handle exceptions, developers can write more robust functions, provide useful error messages when things go wrong, and flag conditions that could cause problems downstream.</p>



<h2 class="wp-block-heading">How to Approach Exception Handling</h2>



<p class="wp-block-paragraph">When handling exceptions, DMC encourages engineers and programmers to stick by these three guidelines:</p>



<ol class="wp-block-list">
<li>Let the code fail but rewrite the error message so that it is more helpful.</li>



<li>Use the DMC pop-up library to display exceptions as errors to the users.</li>



<li>Set up the code so that the system handles known and unknown errors consistently.</li>
</ol>



<h2 class="wp-block-heading" id="h-handling-exceptions">Handling Exceptions</h2>



<p class="wp-block-paragraph">Exceptions are handled by wrapping error-prone code in a <code>try/except</code> block. There are several types of except statements that can accomplish different things.</p>



<p class="wp-block-paragraph">Because Ignition uses Jython, a Java implementation of Python, it is also important to handle Java <code>exception</code> types where applicable.</p>



<h3 class="wp-block-heading">Understanding Python Syntax for Exception Handling</h3>



<p class="wp-block-paragraph">In Python, there are four main keywords for handling exceptions:</p>



<ul class="wp-block-list">
<li><strong>Try: </strong>contains error-prone code</li>



<li><strong>Except: </strong>catches and handles errors if they occur</li>



<li><strong>Else: </strong>runs if the try block completes successfully</li>



<li><strong>Finally:</strong> always runs, regardless of what occurs earlier</li>
</ul>



<p class="wp-block-paragraph">The core of exception handling occurs in the <code>try</code> and <code>except</code> statements, so we will focus on those in the following examples.</p>



<h3 class="wp-block-heading">Basic Exception</h3>



<p class="wp-block-paragraph">This example uses the most basic implementation of a <code>try/except</code> statement. You know that an error occurred, but you don’t know anything about the error. Not very useful.</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">Python</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>try:
  output = dividend / divisor
  success = True
except:
  success = False
  errorMessage = 'An error occurred while dividing'</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: #C586C0">try</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">  output = dividend / divisor</span></span>
<span class="line"><span style="color: #D4D4D4">  success = </span><span style="color: #569CD6">True</span></span>
<span class="line"><span style="color: #C586C0">except</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">  success = </span><span style="color: #569CD6">False</span></span>
<span class="line"><span style="color: #D4D4D4">  errorMessage = </span><span style="color: #CE9178">&apos;An error occurred while dividing&apos;</span></span></code></pre></div>



<h3 class="wp-block-heading">Catch Python Exceptions</h3>



<p class="wp-block-paragraph">You can include the base exception type in the syntax to get the error message or filter for specific error types. It is best practice to look out for specific exception types. In the example below, we catch the <code>ZeroDivisionError</code> type and rewrite the error message so it is more human-readable. Notice how you can include multiple <code>except</code> statements! This way, you can filter for known exceptions and still catch others that may occur during execution of the code.</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">Python</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>try:
  output = dividend / divisor
except ZeroDivisionError as e:
  errorMessage = 'Cannot divide by zero: {}'.format(e.message)
except Exception as e:
  errorMessage = 'Division error: {}'.format(e.message)</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: #C586C0">try</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">  output = dividend / divisor</span></span>
<span class="line"><span style="color: #C586C0">except</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">ZeroDivisionError</span><span style="color: #D4D4D4"> </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> e:</span></span>
<span class="line"><span style="color: #D4D4D4">  errorMessage = </span><span style="color: #CE9178">&apos;Cannot divide by zero: </span><span style="color: #569CD6">{}</span><span style="color: #CE9178">&apos;</span><span style="color: #D4D4D4">.format(e.message)</span></span>
<span class="line"><span style="color: #C586C0">except</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Exception</span><span style="color: #D4D4D4"> </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> e:</span></span>
<span class="line"><span style="color: #D4D4D4">  errorMessage = </span><span style="color: #CE9178">&apos;Division error: </span><span style="color: #569CD6">{}</span><span style="color: #CE9178">&apos;</span><span style="color: #D4D4D4">.format(e.message)</span></span></code></pre></div>



<h3 class="wp-block-heading">Catch Python and Java Exceptions</h3>



<p class="wp-block-paragraph">Because Ignition uses Jython, a Java implementation of Python, we should also handle Java exception types that might occur during queries, casting, or other scenarios.</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">Python</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>import java.lang.Exception as JavaException

try:
  output = dividend / divisor
except (Exception, JavaException) as e:
  errorMessage = 'Division error: {}'.format(e.message)  </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: #C586C0">import</span><span style="color: #D4D4D4"> java.lang.Exception </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> JavaException</span></span>
<span class="line"></span>
<span class="line"><span style="color: #C586C0">try</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">  output = dividend / divisor</span></span>
<span class="line"><span style="color: #C586C0">except</span><span style="color: #D4D4D4"> (</span><span style="color: #4EC9B0">Exception</span><span style="color: #D4D4D4">, JavaException) </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> e:</span></span>
<span class="line"><span style="color: #D4D4D4">  errorMessage = </span><span style="color: #CE9178">&apos;Division error: </span><span style="color: #569CD6">{}</span><span style="color: #CE9178">&apos;</span><span style="color: #D4D4D4">.format(e.message)  </span></span></code></pre></div>



<h2 class="wp-block-heading">Displaying and Logging Exceptions</h2>



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



<p class="wp-block-paragraph">DMC’s pop-up library includes functions for automatically displaying exception message pop-ups in Perspective without requiring the declaration of a specific exception type. The pop-ups in this library can display simplified and detailed versions of the error, providing both user-friendly and developer-friendly messages.</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">Python</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>import traceback
logger = system.util.getLogger('Test Function')

try:
  myFunction(inputA,inputB,inputC)
except Exception as e:
  logger.error(traceback.format_exc(e))
</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: #C586C0">import</span><span style="color: #D4D4D4"> traceback</span></span>
<span class="line"><span style="color: #D4D4D4">logger = system.util.getLogger(</span><span style="color: #CE9178">&apos;Test Function&apos;</span><span style="color: #D4D4D4">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #C586C0">try</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">  myFunction(inputA,inputB,inputC)</span></span>
<span class="line"><span style="color: #C586C0">except</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Exception</span><span style="color: #D4D4D4"> </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> e:</span></span>
<span class="line"><span style="color: #D4D4D4">  logger.error(traceback.format_exc(e))</span></span>
<span class="line"></span></code></pre></div>



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



<p class="wp-block-paragraph">In addition to displaying the exception to users, exceptions should also be logged to the gateway to maintain a record of such events. Without logging, a user can close the exception pop-up, and all information associated with the event will be lost.</p>



<p class="wp-block-paragraph">Logging with <code>traceback.format_exc(e)</code> creates a well-formatted message with error type, message, and traceback, giving engineers the information they need to debug issues effectively.</p>



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

try:
    1/0
except Exception as e:
    print type(e).__name__
    print ''
    print e.message
    print ''
    print format_exc(e)
    
>>> 
ZeroDivisionError

integer division or modulo by zero

Traceback (most recent call last):
  File "&lt;input>", line 4, in &lt;module>
ZeroDivisionError: integer division or modulo by zero

>>> </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: #C586C0">from</span><span style="color: #D4D4D4"> traceback </span><span style="color: #C586C0">import</span><span style="color: #D4D4D4"> format_exc</span></span>
<span class="line"></span>
<span class="line"><span style="color: #C586C0">try</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">/</span><span style="color: #B5CEA8">0</span></span>
<span class="line"><span style="color: #C586C0">except</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Exception</span><span style="color: #D4D4D4"> </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> e:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">print</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">type</span><span style="color: #D4D4D4">(e).</span><span style="color: #9CDCFE">__name__</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">print</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&apos;&apos;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">print</span><span style="color: #D4D4D4"> e.message</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">print</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&apos;&apos;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">print</span><span style="color: #D4D4D4"> format_exc(e)</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">&gt;&gt;&gt; </span></span>
<span class="line"><span style="color: #4EC9B0">ZeroDivisionError</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">integer division </span><span style="color: #569CD6">or</span><span style="color: #D4D4D4"> modulo by zero</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Traceback (most recent call last):</span></span>
<span class="line"><span style="color: #D4D4D4">  File </span><span style="color: #CE9178">&quot;&lt;input&gt;&quot;</span><span style="color: #D4D4D4">, line </span><span style="color: #B5CEA8">4</span><span style="color: #D4D4D4">, </span><span style="color: #569CD6">in</span><span style="color: #D4D4D4"> &lt;module&gt;</span></span>
<span class="line"><span style="color: #4EC9B0">ZeroDivisionError</span><span style="color: #D4D4D4">: integer division </span><span style="color: #569CD6">or</span><span style="color: #D4D4D4"> modulo by zero</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">&gt;&gt;&gt; </span></span></code></pre></div>



<h2 class="wp-block-heading">Other Exceptions</h2>



<p class="wp-block-paragraph">You can raise your own Exceptions to catch errors that might not violate Python syntax by themselves. This is useful for sanitizing inputs or generally checking statuses before they cause errors later in program execution. You can also reraise within an Except block to add more context to an error message.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">Python</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>def divideNumbers(dividend, divisor):
  if divisor == 0:
    raise ValueError('Cannot divide by 0')
    
  try:
    output = dividend / divisor
  except Exception as e:
    raise Exception('Division error: {}'.format(e.message))
    
  return output</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">def</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">divideNumbers</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">dividend</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">divisor</span><span style="color: #D4D4D4">):</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> divisor == </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">raise</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">ValueError</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&apos;Cannot divide by 0&apos;</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">try</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">    output = dividend / divisor</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">except</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Exception</span><span style="color: #D4D4D4"> </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> e:</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">raise</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">Exception</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&apos;Division error: </span><span style="color: #569CD6">{}</span><span style="color: #CE9178">&apos;</span><span style="color: #D4D4D4">.format(e.message))</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> output</span></span></code></pre></div>



<h3 class="wp-block-heading">SQL Exceptions</h3>



<p class="wp-block-paragraph">When considering SQL exceptions, we first want to examine the query method. Where possible, we want to use named queries instead of prep queries because named queries provide much better error messages.</p>



<h3 class="wp-block-heading">Custom Exception Classes</h3>



<p class="wp-block-paragraph">Creating custom exception classes is incredibly easy to accomplish in Python. You might want to create separate exception types for user input errors and system errors.</p>



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



<p class="wp-block-paragraph">By moving beyond basic <code>try/except</code> usage and adopting a more structured approach, like catching specific exception types, handling both Python and Java errors in Ignition, and logging details, you can turn unexpected errors into actionable insights.</p>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)">At DMC, we always apply these best practices across our automation and software projects to deliver systems that are robust, user-friendly, and scalable. Whether you’re building a new Ignition application or improving existing systems, stronger exception handling helps ensure greater dependability and performance.</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>Kicking off an automation project? DMC can help you take the next step!</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 more about <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/ignition-programming/">Ignition solutions</a> and <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/ignition-programming/">HMI Programming services</a> with DMC and contact an expert today.</p>
</div>



<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:15%">
<div class="wp-block-buttons is-horizontal is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-2236275c wp-block-buttons-is-layout-flex">
<div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-base-contrast-color has-text-color has-link-color wp-element-button" href="https://static.dmcinfo.com/contact/">Contact Us</a></div>
</div>
</div>
</div>
</div>
<p>The post <a href="https://static.dmcinfo.com/blog/44984/ignition-exception-handling/">Ignition Tricks: Improving Exception Handling and Error Logging</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beckhoff OOP: Part One &#8211; Methods and Properties</title>
		<link>https://static.dmcinfo.com/blog/17364/beckhoff-oop-part-one-methods-and-properties/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Sun, 23 Jul 2023 21:36:25 +0000</pubDate>
				<category><![CDATA[Beckhoff PLC]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Beckhoff]]></category>
		<category><![CDATA[Methods]]></category>
		<category><![CDATA[Object-Oriented]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Properties]]></category>
		<category><![CDATA[TwinCAT]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/17364/beckhoff-oop-part-one-methods-and-properties/</guid>

					<description><![CDATA[<p>Welcome to the first blog in this&#160;series on Beckhoff Object-Oriented Programming (OOP). OOP&#160;enables code to be divided into self-contained, reusable objects, resulting in code that is easier to understand, maintain, and update. Throughout this series, the reasons behind this advantage will hopefully become evident and clear. Beckhoff has a set of&#160;examples that will occasionally be [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/17364/beckhoff-oop-part-one-methods-and-properties/">Beckhoff OOP: Part One &#8211; Methods and Properties</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Welcome to the first blog in this&nbsp;series on Beckhoff Object-Oriented Programming (OOP).</p>



<p class="wp-block-paragraph">OOP&nbsp;enables code to be divided into self-contained, reusable objects, resulting in code that is easier to understand, maintain, and update. Throughout this series, the reasons behind this advantage will hopefully become evident and clear.</p>



<p class="wp-block-paragraph">Beckhoff has a set of&nbsp;<a href="https://infosys.beckhoff.com/content/1033/tc3_plc_intro/7623882635.html?id=4094185901331026706" target="_blank" rel="noreferrer noopener">examples</a> that will occasionally be referenced throughout this series.</p>



<p class="wp-block-paragraph">Object oriented programming exists of 4 pillars:</p>



<ol class="wp-block-list">
<li><strong>Encapsulation</strong>: Encapsulation refers to the grouping of data (variables, properties) and functions (methods, function blocks) into a single unit called an object. The single object allows for the internal code to be hidden from the application code.</li>



<li><strong>Inheritance</strong>: Inheritance allows objects to inherit properties and functions from other objects. This allows for code to be reused even if the logic is not exactly the same.</li>



<li><strong>Polymorphism</strong>: Polymorphism means the ability of objects to take on different forms or exhibit different behaviors based on the context. This is useful for devices that have very similar functions, but the processes for how they are completed are very different. </li>



<li><strong>Abstraction</strong>: Abstraction involves simplifying complex systems by breaking them down into more manageable and understandable parts. It focuses on only the essential properties and behaviors of an object while hiding the unnecessary details. </li>
</ol>



<p class="wp-block-paragraph">Beckhoff provides several different tools that can be used to achieve these four pillars. Throughout this series, it will be pointed out how each tool correlates to the four pillars.</p>



<p class="wp-block-paragraph">This first blog will touch on two basic principles of OOP, methods and properties.</p>



<h2 class="wp-block-heading" id="h-methods">Methods</h2>



<p class="wp-block-paragraph"><a href="https://infosys.beckhoff.com/content/1033/tc3_plc_intro/2530307467.html?id=770088965081884469" target="_blank">Methods</a>&nbsp;are&nbsp;actions that an object can perform, while <em>encapsulating </em>the details of how an object performs its tasks. Methods specify the behavior or actions that objects can perform, <em>abstracting </em>the implementation details and providing a clean interface for interacting with objects.</p>



<p class="wp-block-paragraph">Methods can perform operations, manipulate data, and they may or may not return a value depending on their implementation. As for what a method should return, this depends largely on whether the method will be completed in one scan or not. For example, commanding a conveyor to move 10 feet will take more than one scan. However, determining the value of a sensor only takes one scan.</p>



<p class="wp-block-paragraph">In addition, there are different access modifiers for methods, with the two main ones being <strong><code>PUBLIC</code></strong> and <strong><code>PRIVATE</code></strong>. Public versus private determines whether the method can be called outside of the program or function block.&nbsp;There are two additional modifiers:&nbsp;<strong><code>PROTECTED</code></strong>, which allows any function block that inherits the function block&nbsp;to access the method&nbsp;(more on that in future blogs) and <strong><code>INTERNAL</code></strong>, which restricts access to objects in the library.</p>



<p class="wp-block-paragraph">In the example of commanding a conveyor to move 10 feet, the method may return a standard response that can be used in&nbsp;an application. This should be public because function blocks outside of the conveyor will need to call this.</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">ST</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>
TYPE ST_Response 
STRUCT
    bComplete : BOOL;
    bError : BOOL;
END_STRUCT
END_TYPE
</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>
<span class="line"><span style="color: #569CD6">TYPE</span><span style="color: #D4D4D4"> ST_Response </span></span>
<span class="line"><span style="color: #D4D4D4">STRUCT</span></span>
<span class="line"><span style="color: #D4D4D4">    bComplete : BOOL;</span></span>
<span class="line"><span style="color: #D4D4D4">    bError : BOOL;</span></span>
<span class="line"><span style="color: #D4D4D4">END_STRUCT</span></span>
<span class="line"><span style="color: #D4D4D4">END_TYPE</span></span>
<span class="line"></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(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">ST</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>
METHOD PUBLIC MoveDistance : ST_Response
VAR_INPUT
    Distance : LREAL; // feet 
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>
<span class="line"><span style="color: #569CD6">METHOD</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">PUBLIC</span><span style="color: #D4D4D4"> MoveDistance : ST_Response</span></span>
<span class="line"><span style="color: #D4D4D4">VAR_INPUT</span></span>
<span class="line"><span style="color: #D4D4D4">    Distance : LREAL; </span><span style="color: #6A9955">// feet </span></span>
<span class="line"><span style="color: #D4D4D4">END_VAR</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">When the method has completed, the state machine can then be moved to the next step. If it encounters an error during the process, the application can enter its error handling sequence.</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">ST</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>
E_State.MOVE_CONVEYOR:
    respone := fbConveyor.MoveDistance(10); // move 10 feet
    
    IF respone.bComplete THEN
        eState := E_State.RUN_MACHINE;
    ELSIF respone.bError THEN
        eState := E_State.ERROR;
    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>
<span class="line"><span style="color: #D4D4D4">E_State.MOVE_CONVEYOR:</span></span>
<span class="line"><span style="color: #D4D4D4">    respone := fbConveyor.MoveDistance(</span><span style="color: #B5CEA8">10</span><span style="color: #D4D4D4">); </span><span style="color: #6A9955">// move 10 feet</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">IF</span><span style="color: #D4D4D4"> respone.bComplete </span><span style="color: #569CD6">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">        eState := E_State.RUN_MACHINE;</span></span>
<span class="line"><span style="color: #D4D4D4">    ELSIF respone.bError </span><span style="color: #569CD6">THEN</span></span>
<span class="line"><span style="color: #D4D4D4">        eState := E_State.ERROR;</span></span>
<span class="line"><span style="color: #D4D4D4">    END_IF</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">An example of a method that takes one scan is&nbsp;calculating the torque of the conveyor. For calculating torque, it is often useful to implement a moving average or filter to smooth out any noise in the data. For example, a&nbsp;method can do all of the math inside and return the value in terms of foot-pounds. This would be an example of a private method because only the conveyor function block should be calling this. The torque could be accessed outside of the function block via a property, for example:</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">ST</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>
// foot-pounds
METHOD PRIVATE CalculateTorque : REAL
VAR_INPUT
    rActualTorque : REAL; //0.1% of max torque 
END_VAR
VAR_INST
    fbMovingAverage : FB_MovingAverage;
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>
<span class="line"><span style="color: #6A9955">// foot-pounds</span></span>
<span class="line"><span style="color: #569CD6">METHOD</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">PRIVATE</span><span style="color: #D4D4D4"> CalculateTorque : </span><span style="color: #569CD6">REAL</span></span>
<span class="line"><span style="color: #D4D4D4">VAR_INPUT</span></span>
<span class="line"><span style="color: #D4D4D4">    rActualTorque : </span><span style="color: #569CD6">REAL</span><span style="color: #D4D4D4">; </span><span style="color: #6A9955">//0.1% of max torque </span></span>
<span class="line"><span style="color: #D4D4D4">END_VAR</span></span>
<span class="line"><span style="color: #D4D4D4">VAR_INST</span></span>
<span class="line"><span style="color: #D4D4D4">    fbMovingAverage : FB_MovingAverage;</span></span>
<span class="line"><span style="color: #D4D4D4">END_VAR</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">Another very common return type is simply a BOOL. Of course, a BOOL can mean many things (sensor state, method complete successfully, etc.), so be sure to comment on what the return value means if it is not obvious!</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">ST</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>
// true = enable successful, false = interlocks active 
METHOD PUBLIC Enable : BOOL
</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>
<span class="line"><span style="color: #6A9955">// true = enable successful, false = interlocks active </span></span>
<span class="line"><span style="color: #569CD6">METHOD</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">PUBLIC</span><span style="color: #D4D4D4"> Enable : BOOL</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">Methods can also serve as a way of organizing code and maintaining readability in application code. This is an example of when a return is not needed. The following excerpt is taken from the OOP Extended Sample.&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-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">ST</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>
// Call of actions

    // Init
    General_Init();

    // Mode and state requests
    General_Requests();
    
    // Enable for power supply, compressed air control and buttons
    General_Enable();
    
    // Input variables of separating and sorting modules
    General_ModuleInputs();
    
    // Output variables
    General_SetOutput();
    ...
</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>
<span class="line"><span style="color: #6A9955">// Call of actions</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Init</span></span>
<span class="line"><span style="color: #D4D4D4">    General_Init();</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Mode and state requests</span></span>
<span class="line"><span style="color: #D4D4D4">    General_Requests();</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Enable for power supply, compressed air control and buttons</span></span>
<span class="line"><span style="color: #D4D4D4">    General_Enable();</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Input variables of separating and sorting modules</span></span>
<span class="line"><span style="color: #D4D4D4">    General_ModuleInputs();</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Output variables</span></span>
<span class="line"><span style="color: #D4D4D4">    General_SetOutput();</span></span>
<span class="line"><span style="color: #D4D4D4">    ...</span></span>
<span class="line"></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(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">ST</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>
METHOD PRIVATE General_Init
</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>
<span class="line"><span style="color: #569CD6">METHOD</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">PRIVATE</span><span style="color: #D4D4D4"> General_Init</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">A really powerful feature of Beckhoff is the ability to <a href="https://infosys.beckhoff.com/content/1033/tc3_plc_intro/7145472907.html?id=6105454089919227750" target="_blank">call methods</a> via ADS. This, in turn, makes methods&nbsp;able to be called via OPCUA.&nbsp;Head on over to our <a href="https://static.dmcinfo.com/latest-thinking/blog/id/10396/getting-started-with-opc-ua-in-beckhoff-twincat-3">blog</a>&nbsp;about setting up an OPCUA server if you have not already done so!</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">ST</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>
{attribute 'TcRpcEnable'}
METHOD PUBLIC MoveDistance : ST_Response
</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>
<span class="line"><span style="color: #6A9955">{attribute &apos;TcRpcEnable&apos;}</span></span>
<span class="line"><span style="color: #569CD6">METHOD</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">PUBLIC</span><span style="color: #D4D4D4"> MoveDistance : ST_Response</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">Here, I am using UaExpert to call the method.&nbsp;</p>



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



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



<p class="wp-block-paragraph">This can make testing extremely efficient. No need to add debug bits to test your code, just call the method that is being tested!</p>



<p class="wp-block-paragraph">Another Beckhoff-specific implementation of a method is <a href="https://infosys.beckhoff.com/content/1033/tc3_plc_intro/5094414603.html?id=6967794353598129051" target="_blank" rel="noreferrer noopener">FB_init</a>. This allows for initialization of the function block before it is called. A simple use case for this is when project variants are used (another plug for one of our <a href="https://static.dmcinfo.com/latest-thinking/blog/id/10299/twincat-project-variants">blogs</a>!). Different initialized values can be used depending on the variant selected. For example, in the Simulation variant, the default conveyor speed is set to the maximum value to speed up any testing that is needed. Another common use case is initializing pointers and references to be used during runtime.</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">ST</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>
METHOD FB_init : BOOL
VAR_INPUT
    bInitRetains : BOOL; 
    bInCopyCode : BOOL;  
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>
<span class="line"><span style="color: #569CD6">METHOD</span><span style="color: #D4D4D4"> FB_init : BOOL</span></span>
<span class="line"><span style="color: #D4D4D4">VAR_INPUT</span></span>
<span class="line"><span style="color: #D4D4D4">    bInitRetains : BOOL; </span></span>
<span class="line"><span style="color: #D4D4D4">    bInCopyCode : BOOL;  </span></span>
<span class="line"><span style="color: #D4D4D4">END_VAR</span></span>
<span class="line"></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(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">ST</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>
{IF defined(Simulation)}
    lrSpeedSetpoint := MAX_SPEED;
{ELSE}    
    lrSpeedSetpoint := 100;
{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>
<span class="line"><span style="color: #6A9955">{IF defined(Simulation)}</span></span>
<span class="line"><span style="color: #D4D4D4">    lrSpeedSetpoint := MAX_SPEED;</span></span>
<span class="line"><span style="color: #6A9955">{ELSE}</span><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">    lrSpeedSetpoint := </span><span style="color: #B5CEA8">100</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #6A9955">{END_IF}</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">Obviously, this is just scratching the surface of what methods can do. There are varying schools of thought on how much logic a method should contain. Some implementations of methods simply move state machines from one state to another; other implementations may contain an entire sequencer inside a state. This depends on the architecture of the project.</p>



<p class="wp-block-paragraph">DMC is happy to discuss the implementation of your project and help decide which implementation of methods will work best for you!&nbsp;</p>



<h2 class="wp-block-heading" id="h-properties">Properties</h2>



<p class="wp-block-paragraph">Moving onto properties, a <a href="https://infosys.beckhoff.com/content/1033/tc3_plc_intro/2530335371.html?id=7678313929092874522" target="_blank">property</a>&nbsp;is an object attribute that <em>encapsulates </em>data and provides a controlled way to access or modify the data associated with it. Properties allow you to expose the internal state of an object while enforcing rules and logic for data access.</p>



<p class="wp-block-paragraph">Properties are implemented using getter and setter methods. A getter is a method used to retrieve the value of a private attribute of an object. A setter is a method used to modify the value of a private attribute of an object.</p>



<p class="wp-block-paragraph">Properties have&nbsp;the same access modifiers as the methods described above.</p>



<p class="wp-block-paragraph">A simple example of this would be the speed setpoint of the previously mentioned conveyor.</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">ST</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>
// ft/min
PROPERTY PUBLIC lrSpeedSetpoint : LREAL
</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>
<span class="line"><span style="color: #6A9955">// ft/min</span></span>
<span class="line"><span style="color: #569CD6">PROPERTY</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">PUBLIC</span><span style="color: #D4D4D4"> lrSpeedSetpoint : LREAL</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">The setter can have conditions to make sure the speed is set within the proper bounds. In this example, a negative number is rejected, and a speed greater than the maximum is set to the maximum speed. The getter simply returns the speed here; however, a getter could convert a raw signal into a useful value, for example:</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">ST</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>
// "Set"
IF lrSpeedSetpoint >= 0 THEN
    _lrSpeedSetpoint := SEL(lrSpeedSetpoint > MAX_SPEED, lrSpeedSetpoint, MAX_SPEED);
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>
<span class="line"><span style="color: #6A9955">// &quot;Set&quot;</span></span>
<span class="line"><span style="color: #569CD6">IF</span><span style="color: #D4D4D4"> lrSpeedSetpoint &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">    _lrSpeedSetpoint := SEL(lrSpeedSetpoint &gt; MAX_SPEED, lrSpeedSetpoint, MAX_SPEED);</span></span>
<span class="line"><span style="color: #D4D4D4">END_IF</span></span>
<span class="line"></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(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">ST</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>
// "Get" 
lrSpeedSetpoint := _lrSpeedSetpoint;
</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>
<span class="line"><span style="color: #6A9955">// &quot;Get&quot; </span></span>
<span class="line"><span style="color: #D4D4D4">lrSpeedSetpoint := _lrSpeedSetpoint;</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">To access properties, the following should be used:&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-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">ST</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>
// Access "Set" 
fbConveyor.lrSpeedSetpoint := 100; // 100 ft/min
</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>
<span class="line"><span style="color: #6A9955">// Access &quot;Set&quot; </span></span>
<span class="line"><span style="color: #D4D4D4">fbConveyor.lrSpeedSetpoint := </span><span style="color: #B5CEA8">100</span><span style="color: #D4D4D4">; </span><span style="color: #6A9955">// 100 ft/min</span></span>
<span class="line"></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(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">ST</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>
// Access "Get" 
lrConveyorSpeedSetpoint:= fbConveyor.lrSpeedSetpoint;
</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>
<span class="line"><span style="color: #6A9955">// Access &quot;Get&quot; </span></span>
<span class="line"><span style="color: #D4D4D4">lrConveyorSpeedSetpoint:= fbConveyor.lrSpeedSetpoint;</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">If a property does not need either the getter or the setter, it can simply be deleted.</p>



<p class="wp-block-paragraph">From my personal experience, I have not seen properties used a ton. There are some specific situations where they are useful, but often there are several different ways to achieve the same functionality. Methods, on the other hand, are essential to building an OOP-based project.</p>



<p class="wp-block-paragraph">Look out for part 2, interfaces, coming soon!</p>



<p class="wp-block-paragraph"><strong>Learn more about DMC&#8217;s&nbsp;<a href="/services/manufacturing-automation-and-intelligence/plc-programming/beckhoff-and-twincat-3-programming">Beckhoff and TwinCAT 3 programming</a>&nbsp;expertise and&nbsp;<a href="/contact">contact us</a>&nbsp;for your next project.</strong></p>
<p>The post <a href="https://static.dmcinfo.com/blog/17364/beckhoff-oop-part-one-methods-and-properties/">Beckhoff OOP: Part One &#8211; Methods and Properties</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Chicago LabVIEW User Group Meeting at DMC</title>
		<link>https://static.dmcinfo.com/blog/21364/chicago-labview-user-group-meeting-at-dmc/</link>
		
		<dc:creator><![CDATA[Darren Jones]]></dc:creator>
		<pubDate>Wed, 26 Jun 2019 12:52:04 +0000</pubDate>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Chicago]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[Locations]]></category>
		<category><![CDATA[Special Events]]></category>
		<category><![CDATA[Test and Measurement Automation]]></category>
		<category><![CDATA[CLUG]]></category>
		<category><![CDATA[Meeting]]></category>
		<category><![CDATA[National Instruments]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21364/chicago-labview-user-group-meeting-at-dmc/</guid>

					<description><![CDATA[<p>The Chicago&#160;LabVIEW&#160;Users Group (CLUG)&#160;met at DMCs&#160;Chicago office to discuss&#160;National Instruments Week&#160;2019, and package management systems from NI and JKI. These user groups meet regularly across the country to address various LabVIEW programming techniques, technologies, application design patterns, and much more.&#160; This meeting began with Pizza and networking between DMCers and LabVIEW users from the Chicagoland [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21364/chicago-labview-user-group-meeting-at-dmc/">Chicago LabVIEW User Group Meeting at DMC</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">The Chicago&nbsp;<a href="/services/test-and-measurement-automation/labview-programming">LabVIEW</a>&nbsp;Users Group (CLUG)&nbsp;met at DMCs&nbsp;Chicago office to discuss&nbsp;<a href="/latest-thinking/blog/id/9887/niweek-2019-highlights">National Instruments Week&nbsp;2019</a>, and package management systems from NI and JKI. These user groups meet regularly across the country to address various <strong><a href="https://static.dmcinfo.com/services/test-and-measurement-automation/labview-programming">LabVIEW programming</a></strong> techniques, technologies, application design patterns, and much more.&nbsp;</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/1-LabVIEW-Chicago_1.jpg"  /></figure>

<p class="wp-block-paragraph">This meeting began with Pizza and networking between DMCers and LabVIEW users from the Chicagoland area.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/2-LabVIEW-Chicago_1.png"  /></figure>

<p class="wp-block-paragraph">We kicked off the user group meeting by highlighting some of the most exciting features that were released at NI week this year.</p>

<p class="wp-block-paragraph"><strong><a href="//www.slideshare.net/DMCChicago/ni-week-2019-overview" target="_blank" title="NI Week 2019 Overview">NI Week 2019 Overview</a></strong></p>

<p class="wp-block-paragraph"><iframe allowfullscreen="" frameborder="0" height="485" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/key/4G2hUhgaIIPH53" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" width="595"></iframe></p>

<h2 class="wp-block-heading"><strong>DMC Presentations on LabVIEW Programming</strong></h2>

<p class="wp-block-paragraph">Systems Engineer Ryan Yu presented an overview of NI Package Manager, with content initially developed by National Instruments and presented by Allen Hsu.&nbsp; Yu showed LabVIEW users the workflow for installing, upgrading, and managing NI software. &nbsp;He then highlighted the workflow of both NI Package Manager and SystemLink, when used in conjunction with LabVIEW. Users exchanged ideas with Yu and asked questions on use cases, versioning, and SystemLink feeds.</p>

<p class="wp-block-paragraph"><strong><a href="//www.slideshare.net/DMCChicago/best-practices-for-building-and-distributing-componentized-lab-view-applications" target="_blank" title="NI Package Manager">NI Package Manager</a></strong></p>

<p class="wp-block-paragraph"><iframe allowfullscreen="" frameborder="0" height="485" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/key/pEv5LqGRLWFZh9" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" width="595"></iframe></p>

<p class="wp-block-paragraph">Systems Engineer Kyle Mitchell demonstrated JKI&rsquo;s VI Package Manager, a reasonably popular tool among the user group. Mitchell gave a walkthrough on&nbsp;how to build and deploy packages within LabVIEW, and users shared their experiences and tips about VIPM.</p>

<p class="wp-block-paragraph"><strong><a href="//www.slideshare.net/DMCChicago/vi-package-manager" target="_blank" title="VI package manager">VI package manager</a> </strong></p>

<p class="wp-block-paragraph"><iframe allowfullscreen="" frameborder="0" height="485" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/key/pYYPptQ1O4Kzqk" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" width="595"></iframe></p>

<h2 class="wp-block-heading"><strong>Sharing LabVIEW Stories</strong></h2>

<p class="wp-block-paragraph">This section of the meeting is devoted to&nbsp;short topics (max of 10 minutes) talking about a neat project, cool tool, or&nbsp;challenging problem users&nbsp;need help solving.&nbsp;</p>

<p class="wp-block-paragraph">Users shared stories about creating a custom VI to update UI elements through property nodes more effectively, warned&nbsp;about big arrays affecting the search feature, and one&nbsp;user shared a story about how to do LabVIEW translations effectively.</p>

<figure class="wp-block-image"><img decoding="async" alt="" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/3-LabVIEW-Chicago.jpg"  /></figure>

<p class="wp-block-paragraph">There was also a shoutout to the&nbsp;<a href="https://labviewwiki.org/wiki/Home">LabVIEW wiki</a>&nbsp;that the community is currently constructing.</p>

<p class="wp-block-paragraph">Thanks to our friends in the LabVIEW user group who made it to the event!</p>

<p class="wp-block-paragraph"><a href="https://static.dmcinfo.com/about/partners/ni-alliance-partner">Learn more about DMC&apos;s partnership with National Instruments.</a></p>
<p>The post <a href="https://static.dmcinfo.com/blog/21364/chicago-labview-user-group-meeting-at-dmc/">Chicago LabVIEW User Group Meeting at DMC</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The Basics of Siemens S7 PLC I/O Addressing</title>
		<link>https://static.dmcinfo.com/blog/29080/the-basics-of-siemens-s7-plc-i-o-addressing/</link>
		
		<dc:creator><![CDATA[Nick Shea]]></dc:creator>
		<pubDate>Wed, 21 Mar 2012 09:22:50 +0000</pubDate>
				<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Siemens]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/29080/the-basics-of-siemens-s7-plc-i-o-addressing/</guid>

					<description><![CDATA[<p>Are you a new user of Siemens PLCs&#160;a and wondering what terms like &#8220;process image&#8221; and &#8220;peripheral address&#8221; mean? What does the &#8220;P&#8221; in &#8220;PIW&#8221; stand for? Are you an experienced user and are too embarrassed to ask? Or, maybe you are like me and just need refresher every once in a while? Fortunately, the [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/29080/the-basics-of-siemens-s7-plc-i-o-addressing/">The Basics of Siemens S7 PLC I/O Addressing</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Are you a new user of <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming"> Siemens PLCs&nbsp;</a>a and wondering what terms like &#8220;process image&#8221; and &#8220;peripheral address&#8221; mean? What does the &#8220;P&#8221; in &#8220;PIW&#8221; stand for? Are you an experienced user and are too embarrassed to ask? Or, maybe you are like me and just need refresher every once in a while?</p>



<p class="wp-block-paragraph">Fortunately, the Siemens support website has a great article that explains these different ways to access I/O for Siemens S7-300 and 400 PLCs. Here are some summary thoughts and highlights that I&#8217;ve picked out.</p>



<p class="wp-block-paragraph">Here are the basics:</p>



<ul class="wp-block-list">
<li>Process Image
 
 
<ul class="wp-block-list">
<li>The only way to access I/O bits</li>



<li>Values are &#8220;buffered&#8221; in between scans</li>



<li>Limited address space for some CPU models</li>



<li>Notation:
  
  
<ul class="wp-block-list">
<li>Bool &#8220;I 0.0&#8221;, &#8220;Q 0.0&#8221;</li>



<li>Byte &#8220;IB 10&#8221;, &#8220;QB 10&#8221;</li>



<li>Word &#8220;IW 16&#8221;, &#8220;QW 16&#8221;</li>



<li>Double Word &#8220;ID 24&#8221;, &#8220;QD 24&#8221;</li>
</ul>
</li>
</ul>
</li>



<li>Peripheral Address
 
 
<ul class="wp-block-list">
<li>All addresses outside of the process image</li>



<li>Cannot access I/O bits this way</li>



<li>The actual values are immediately read and written to physical I/O from user program</li>



<li>Notation:
  
  
<ul class="wp-block-list">
<li>Byte &#8220;PIB 10&#8221;, &#8220;PQB 10&#8221;</li>



<li>Word &#8220;PIW 16&#8221;, &#8220;PQW 16&#8221;</li>



<li>Double Word &#8220;PID 24&#8221;, &#8220;PQD 24&#8221;</li>
</ul>
</li>
</ul>
</li>
</ul>



<p class="wp-block-paragraph">As a general rule, I use the process image for all my bit logic and the peripheral addresses for my analog values.</p>



<p class="wp-block-paragraph">For more information, <a href="https://support.automation.siemens.com/WW/llisapi.dll?func=cslib.csinfo&amp;objId=24148871&amp;load=treecontent&amp;lang=en&amp;siteid=cseus&amp;aktprim=0&amp;objaction=csview&amp;extranet=standard&amp;viewreg=WW" target="_blank"> check out the article </a> .</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="699" src="https://static.dmcinfo.com/wp-content/uploads/2012/03/image-25-1024x699.png" alt="" class="wp-image-34951" srcset="https://static.dmcinfo.com/wp-content/uploads/2012/03/image-25-1024x699.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2012/03/image-25-300x205.png 300w, https://static.dmcinfo.com/wp-content/uploads/2012/03/image-25-768x525.png 768w, https://static.dmcinfo.com/wp-content/uploads/2012/03/image-25.png 1300w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Learn more about&nbsp;<a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/plc-programming">DMC&#8217;s PLC Programming services</a>&nbsp;and&nbsp;<a href="https://static.dmcinfo.com/contact">contact us</a>&nbsp;to get started on your next PLC Programming project.<strong> </strong></p>
<p>The post <a href="https://static.dmcinfo.com/blog/29080/the-basics-of-siemens-s7-plc-i-o-addressing/">The Basics of Siemens S7 PLC I/O Addressing</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
