<?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>Isabelle Chan, Author at DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/author/isabellec/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Wed, 19 Aug 2026 20:14:38 +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>Isabelle Chan, Author at 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>Ignition Perspective Tricks: Embedded Views in Tables Cells</title>
		<link>https://static.dmcinfo.com/blog/43002/ignition-perspective-embedded-views-tables-cells/</link>
		
		<dc:creator><![CDATA[Isabelle Chan]]></dc:creator>
		<pubDate>Thu, 23 Apr 2026 13:22:00 +0000</pubDate>
				<category><![CDATA[Ignition]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/?p=43002</guid>

					<description><![CDATA[<p>Ignition Perspective’s Table component offers great flexibility when designing powerful user interfaces, including the ability to display other views within table cells. In this article, we’ll cover how to configure a table cell to use an embedded view, allowing us to build screens that make it easier for users to understand and interact with the [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/43002/ignition-perspective-embedded-views-tables-cells/">Ignition Perspective Tricks: Embedded Views in Tables Cells</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Ignition Perspective’s Table component offers great flexibility when designing powerful user interfaces, including the ability to display other views within table cells. In this article, we’ll cover how to configure a table cell to use an embedded view, allowing us to build screens that make it easier for users to understand and interact with the data.</p>



<h2 id="h-the-example" class="wp-block-heading">The Example</h2>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-0e47273b wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:40%">
<p class="wp-block-paragraph">For this example, let us imagine there are simple weather stations across the country reporting the communication status, the type of weather (represented by an integer), and temperature. Each city is set up with User Defined Types (UDT) containing this information [Figure 1]. We will then use this information to build an interface to allow users to individually enable and disable weather stations and view their statuses.</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" width="2100" height="866" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-1.jpg" alt="Ignition Perspective user defined types (UDT)" class="wp-image-43261" style="aspect-ratio:2.4250297715708564;width:643px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-1.jpg 2100w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-1-300x124.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-1-1024x422.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-1-768x317.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-1-1536x633.jpg 1536w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-1-2048x845.jpg 2048w" sizes="(max-width: 2100px) 100vw, 2100px" /><figcaption class="wp-element-caption"><em>Figure 1</em></figcaption></figure>
</div>
</div>



<h2 id="h-setting-up-the-table" class="wp-block-heading">Setting Up the Table</h2>



<p class="wp-block-paragraph">First, we will add a table to a Perspective screen and bind the table’s data property to the tags. To do this, we look through the Cities folder and parse the tag values into a JSON format [Figure 2].</p>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)">This method is preferred for its scalability, as new cities added to the tags will automatically appear on the screen. This results in a table with the raw tag data.</p>



<figure class="wp-block-image aligncenter size-large is-resized" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)"><img decoding="async" width="1024" height="979" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-2-2-1024x979.jpg" alt="Ignition Perspective 'CITIES' folder in JSON format." class="wp-image-43257" style="width:730px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-2-2-1024x979.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-2-2-300x287.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-2-2-768x734.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-2-2.jpg 1082w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Figure 2</em></figcaption></figure>



<figure class="wp-block-image aligncenter size-large is-resized"><img decoding="async" width="1024" height="712" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-3-1024x712.jpg" alt="Weather Table" class="wp-image-43071" style="width:730px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-3-1024x712.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-3-300x208.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-3-768x534.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-3.jpg 1180w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Figure 3</em></figcaption></figure>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-0e47273b wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<h2 id="h-column-configuration" class="wp-block-heading" style="padding-top:var(--wp--preset--spacing--30)">Column Configuration</h2>



<p class="wp-block-paragraph">But how do we make the data easier for users to quickly understand? We can do that by enhancing the table by configuring the five columns to have the following display:</p>



<ol start="1" class="wp-block-list">
<li>City: the name of the city</li>



<li>Enabled: a toggle switch controlling if a weather station is enabled or disabled</li>



<li>CommsStatus: an icon indicating if a weather station is communicating properly</li>



<li>Temperature (F): the last reported temperature</li>



<li>Weather: an icon based on an enumeration</li>
</ol>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)">The end goal is to have a table that looks like this.</p>



<figure class="wp-block-image aligncenter size-full is-resized"><img decoding="async" width="1175" height="715" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5.png" alt="Configured weather table." class="wp-image-43276" style="width:1050px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5.png 1175w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5-1024x623.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5-768x467.png 768w" sizes="(max-width: 1175px) 100vw, 1175px" /><figcaption class="wp-element-caption"><em>Figure 4</em></figcaption></figure>
</div>
</div>



<h3 id="h-background-knowledge-passing-data-into-an-embedded-view-in-a-table" class="wp-block-heading" style="padding-top:var(--wp--preset--spacing--40)">Background Knowledge: Passing Data into an Embedded View in a Table</h3>



<p class="wp-block-paragraph" id="h-before-discussing-the-detailed-process-for-configuring-each-column-let-s-first-explain-how-to-transfer-data-into-embedded-views-in-tables-as-this-understanding-is-crucial-for-our-example-to-start-the-perspective-table-component-has-a-set-of-properties-per-cell-the-full-list-is">Before discussing the detailed process for configuring each column, let&#8217;s first explain how to transfer data into embedded views in tables, as this understanding is crucial for our example. To start, the Perspective table component has a set of properties per cell. The full list is:</p>



<ul class="wp-block-list">
<li><code>:column</code> : the current column name</li>



<li><code><strong>columnIndex</strong></code>: index of the current column</li>



<li><code><strong>row</strong></code>: index of the current row</li>



<li><code><strong>rowData</strong></code>: table data for the current row in a JSON format</li>



<li><code><strong>rowIndex</strong></code>: the displayed index of the current row (if only a select number of rows are displayed at a given time)</li>



<li><code><strong>value</strong></code>: the value being passed into the cell</li>
</ul>



<p class="wp-block-paragraph">The table component also has a <code>columns</code> property, where for each column you can set the <code>viewPath</code> to be a path to another Perspective View. This is how you configure a view to be embedded in a table. Now the problem is, how do you pass information from your table into this embedded view?</p>



<p class="wp-block-paragraph">The answer is to set the embedded view&#8217;s parameters to match the names of the table properties. For example, if you want to pass in the name of the current column into your embedded view, you would add a parameter called <code>column</code> to your embedded view.</p>



<p class="wp-block-paragraph">You can also add custom properties under <code>columns.viewParams</code> to pass into the embedded view. Similar to the built-in Ignition cell properties above, once an input parameter with the same name as the new custom property is set up on the embedded view, that value will be passed in from the parent.</p>



<h3 id="h-column-enabled" class="wp-block-heading">Column: Enabled</h3>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--40)">Now that we have the background knowledge of how to pass information into an embedded View, let’s use that to configure the Enabled column. The first step will be to create a view called <strong>EnabledView</strong> that contains a toggle switch component and link the view path to the Enabled column’s <code><strong>viewPath</strong></code> property [Figure 5]. By adding an input param called <code><strong>value</strong></code> to <strong>EnabledView </strong>[Figure 6], the enabled status will be passed automatically into <strong>EnabledView</strong>.<a id="_msocom_1"></a></p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-0e47273b wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:33.33%">
<figure class="wp-block-image aligncenter size-full is-resized"><img decoding="async" width="438" height="561" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-5-3.jpg" alt="Enabled column's viewPath property." class="wp-image-43079" style="aspect-ratio:0.780751814403573;object-fit:contain;width:312px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-5-3.jpg 438w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-5-3-234x300.jpg 234w" sizes="(max-width: 438px) 100vw, 438px" /><figcaption class="wp-element-caption"><em>Figure </em>5</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:66.66%">
<figure class="wp-block-image aligncenter size-full is-style-default"><img decoding="async" width="1634" height="830" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-gif-1.gif" alt="Enabling different parameters in weather table." class="wp-image-43137" style="aspect-ratio:1.968431730574153;object-fit:contain"/><figcaption class="wp-element-caption"><em>Figure </em>6</figcaption></figure>
</div>
</div>



<p class="wp-block-paragraph" style="padding-top:var(--wp--preset--spacing--30)">But how do you make sure the tag value is updated when the user presses the toggle button? There are a few different possible solutions for this:</p>



<p class="wp-block-paragraph"><strong>Option 1:</strong> Create a Message Handler to write to tags and refresh the table data. This is DMC’s recommended approach because it centralizes all tag reads in one place, which is more performant, especially for large datasets. It also ensures that the table data is always synchronous, which is necessary if the table has columns that rely on multiple tag values. For instance, in our example, the CommsStatus column relies on the Enabled column data. So when you update the Enabled column, you also want the CommsStatus column to update.</p>



<p class="wp-block-paragraph"><strong>Option 2: </strong>Pass in the tag path into the embedded view and do a bidirectional binding within the embedded view. While this approach may be more straightforward for smaller tables, it can negatively impact performance because tag reads occur in each cell rather than in a single table-level read. This method also does not automatically refresh the table data, which, in our example, would mean the CommsStatus column would not update to reflect the change in the Enabled column.</p>



<p class="wp-block-paragraph">And you might be thinking–why not just have <code>value</code> property in the <strong>EnabledView </strong>set to an in/out param? Despite being an in/out param, this will not actually write back to the desired tag. This is because the table cell is linked to the manually parsed dataset and is not bidirectionally linked to the original tag.</p>



<p class="wp-block-paragraph">For this example, we will implement a Message Handler. The first step <span style="box-sizing: border-box; margin: 0px; padding: 0px;">in imple</span>menting this is to add another input, called <code>row</code>, to <span style="box-sizing: border-box; margin: 0px; padding: 0px;">the</span>&nbsp;<strong>EnabledView</strong>. This will inform the Message Handler what index of the data array to use. Notice that <code>row</code>, not <code>rowIndex</code><em>,</em> is used since <code>rowIndex</code> only uses the rows that are displayed. If there were more cities, this number would differ from <code>row</code> as it would change depending on which page is being viewed.</p>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--40)">Then, on the toggle switch’s component event, we will add a script to trigger the Message Handler being sent [Figure 7]. Finally, on the main table, we will add a Message Handler that takes in the payload and uses that to both write to the tag and refresh the entire table [Figure 8]. After making those changes, toggling the switches writes to the respective tag!</p>



<figure class="wp-block-image aligncenter size-full" style="margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50)"><img decoding="async" width="1961" height="608" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-7-1.jpg" alt="Event Configuration on ToggleSwitch." class="wp-image-43081" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-7-1.jpg 1961w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-7-1-300x93.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-7-1-1024x317.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-7-1-768x238.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-7-1-1536x476.jpg 1536w" sizes="(max-width: 1961px) 100vw, 1961px" /><figcaption class="wp-element-caption"><em>Figure </em>7</figcaption></figure>



<figure class="wp-block-image aligncenter size-full is-resized" style="margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50)"><img decoding="async" width="1834" height="771" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-8.jpg" alt="Script Configuration on Table." class="wp-image-43082" style="aspect-ratio:2.3817580504786773;width:1198px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-8.jpg 1834w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-8-300x126.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-8-1024x430.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-8-768x323.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-8-1536x646.jpg 1536w" sizes="(max-width: 1834px) 100vw, 1834px" /><figcaption class="wp-element-caption"><em>Figure 8</em></figcaption></figure>



<figure class="wp-block-image aligncenter size-full is-resized has-custom-border" style="margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50)"><img decoding="async" width="1634" height="830" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-gif-2.gif" alt="Selecting and deselecting parameters in Weather Table." class="wp-image-43158" style="border-top-left-radius:20px;border-top-right-radius:20px;border-bottom-left-radius:20px;border-bottom-right-radius:20px;aspect-ratio:1.9692580386074723;object-fit:contain;width:981px;height:auto"/><figcaption class="wp-element-caption"><em>Figure </em>9</figcaption></figure>



<h3 id="h-column-commsstatus" class="wp-block-heading">Column: CommsStatus</h3>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)">This column will use an icon to indicate the communication status based on both the <code>rowData.CommsStatus</code> and <code>rowData.Enabled</code> properties. To pass that information into the embedded view, we will add <code>rowData</code> as a param to the View [Figure 10].</p>



<figure class="wp-block-image aligncenter size-full is-resized"><img decoding="async" width="867" height="763" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-10-1.jpg" alt="Perspective Property Editor table." class="wp-image-43087" style="width:730px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-10-1.jpg 867w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-10-1-300x264.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-10-1-768x676.jpg 768w" sizes="(max-width: 867px) 100vw, 867px" /><figcaption class="wp-element-caption"><em>Figure 10</em></figcaption></figure>



<p class="wp-block-paragraph" style="padding-top:var(--wp--preset--spacing--30)">The bindings on the icon property are set up such that:</p>



<ol start="1" class="wp-block-list">
<li>A gray <strong>material/wifi_off </strong>icon indicates the station is disabled.</li>



<li>A gray <strong>material/wifi</strong> icon indicates comms are good and the station is enabled.</li>



<li style="padding-bottom:var(--wp--preset--spacing--50)">A red <strong>material/wifi_off</strong> icon indicates that comms bad and station is enabled.</li>
</ol>



<figure class="wp-block-image aligncenter size-large is-resized"><img decoding="async" width="1024" height="660" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-11-1024x660.jpg" alt="Perspective Expression Structure table." class="wp-image-43088" style="width:730px" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-11-1024x660.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-11-300x193.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-11-768x495.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-11.jpg 1113w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Figure 11</em></figcaption></figure>



<p class="wp-block-paragraph" style="padding-top:0;padding-bottom:var(--wp--preset--spacing--50)">Then the color property has the following binding, where the color codes are hardcoded. If you would like to do more advanced CSS handling of the color animations, check out DMC&#8217;s <a href="https://static.dmcinfo.com/blog/17916/custom-css-in-ignition-perspective-getting-started-with-the-stylesheets/">blog on CSS styles</a>.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="1548" height="714" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-12.jpg" alt="Perspective Property Editor window." class="wp-image-43089" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-12.jpg 1548w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-12-300x138.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-12-1024x472.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-12-768x354.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-12-1536x708.jpg 1536w" sizes="(max-width: 1548px) 100vw, 1548px" /><figcaption class="wp-element-caption"><em>Figure 12</em></figcaption></figure>



<h3 id="h-column-weather" class="wp-block-heading">Column: Weather</h3>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)">The Weather column will be set up similarly to CommsStatus, but we’ll add an additional input param called <code>color</code>, which is bound to the icon&#8217;s color property [Figure 13]. In the table, in the Weather column, add a&nbsp;<code>viewParam.color</code>&nbsp;and bind it to a new field where users can specify the color of the weather icons [Figure 14].</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-0e47273b wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:66.66%">
<figure class="wp-block-image aligncenter size-full is-resized"><img decoding="async" width="624" height="295" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-13-2.jpg" alt="'Color' input parameter in Weather column." class="wp-image-43094" style="aspect-ratio:2.115331288601319;width:783px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-13-2.jpg 624w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-13-2-300x142.jpg 300w" sizes="(max-width: 624px) 100vw, 624px" /><figcaption class="wp-element-caption"><em>Figure 1</em>3</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:33.33%">
<figure class="wp-block-image aligncenter size-full is-resized"><img decoding="async" width="433" height="526" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-14-1.jpg" alt="'viewParam' icon color property." class="wp-image-43095" style="aspect-ratio:0.8232120082409496;width:305px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-14-1.jpg 433w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspective-embedded-tables-image-14-1-247x300.jpg 247w" sizes="(max-width: 433px) 100vw, 433px" /><figcaption class="wp-element-caption"><em>Figure 1</em>4</figcaption></figure>
</div>
</div>



<h2 id="h-conclusion" class="wp-block-heading" style="padding-top:var(--wp--preset--spacing--30)">Conclusion</h2>



<p class="wp-block-paragraph" style="padding-bottom:var(--wp--preset--spacing--50)">With the customization now finalized, the table provides users with a straightforward method for enabling/disabling each city, alongside clear graphical representations for efficient data interpretation. This enhancement streamlines user interactions and helps increase the functionality of the Ignition system.</p>



<figure class="wp-block-image aligncenter size-large"><img decoding="async" width="1024" height="623" src="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5-1024x623.png" alt="Final configured table." class="wp-image-43276" srcset="https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5-1024x623.png 1024w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5-300x183.png 300w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5-768x467.png 768w, https://static.dmcinfo.com/wp-content/uploads/2026/04/ignition-perspectives-image-5.png 1175w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Figure 15</em></figcaption></figure>



<p class="wp-block-paragraph" style="padding-top:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--60)">At DMC, we know how important it is to our clients to have easy-to-understand data visualization. Using embedded views in tables is just one of the many ways engineers at DMC leverage Ignition’s tools to build intuitive screens that provide value to our customers. For more tips and tricks, check out our other blogs where engineers explore more ways to use Ignition’s powerful features.</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 getting more out of Ignition Perspective? Talk with DMC&#8217;s experts.</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 DMC&#8217;s <a href="https://static.dmcinfo.com/our-work/category/service/manufacturing-automation-and-intelligence/ignition/" id="1296">Ignition Perspective</a> capabilities for your <a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/" id="420">Manufacturing &amp; Automation</a> operations. Learn how we can help 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/43002/ignition-perspective-embedded-views-tables-cells/">Ignition Perspective Tricks: Embedded Views in Tables Cells</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Migrating Tag History in Ignition&#8217;s Tag Historian</title>
		<link>https://static.dmcinfo.com/blog/18050/migrating-tag-history-in-ignitions-tag-historian/</link>
		
		<dc:creator><![CDATA[Isabelle Chan]]></dc:creator>
		<pubDate>Wed, 23 Nov 2022 15:12:12 +0000</pubDate>
				<category><![CDATA[HMI and SCADA]]></category>
		<category><![CDATA[Ignition]]></category>
		<category><![CDATA[ignition]]></category>
		<category><![CDATA[Tag Historian]]></category>
		<category><![CDATA[Tag History]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/18050/migrating-tag-history-in-ignitions-tag-historian/</guid>

					<description><![CDATA[<p>The Ignition Tag Historian module is a powerful tool that efficiently stores tag history in designated SQL tables. This data can be accessed through scripting, reporting, and historical bindings and has built-in features such as automatic purging and partitioning to avoid overloading the database. The module also allows for easy viewing of tag trends by [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/18050/migrating-tag-history-in-ignitions-tag-historian/">Migrating Tag History in Ignition&#8217;s Tag Historian</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">The Ignition Tag Historian module is a powerful tool that efficiently stores tag history in designated SQL tables. This data can be accessed through scripting, reporting, and historical bindings and has built-in features such as automatic purging and partitioning to avoid overloading the database. The module also allows for easy viewing of tag trends by allowing users to drag and drop tags on Vision&apos;s Easy Chart and Perspective&apos;s Power Chart components.</p>

<p class="wp-block-paragraph">Despite the great capabilities of the Tag Historian, the format in which data is stored can complicate the process of directly querying&nbsp;these tables. As a result, migrating tag history from one tag to another after say, renaming or moving a tag, may prove challenging. These types of migrations may need to be performed after reorganizing the tag structure of a project or replacing a sensor while maintaining continuous tag history data.</p>

<h2 class="wp-block-heading">The Example</h2>

<p class="wp-block-paragraph">For simplicity&apos;s sake, we will go over an example in which a new tag is added to a project under these conditions:</p>

<ol class="wp-block-list" type="1">
 <li value="1">The old and new tags are standalone tags not found in any UDTs.</li>
 <li>The tag group of the tags did not change.</li>
 <li>Neither the gateway nor the gateway name changed.</li>
 <li>Only one gateway is used.</li>
</ol>

<p class="wp-block-paragraph">It&apos;s worth noting that&nbsp;tag history can still be migrated when some or none of the above conditions apply! There are several nuances each of the conditions requires that one must consider when performing migration. Knowledge of all Ignition built-in historian tables is key to ensuring a successful migration for more complex conditions. Due to the simplicity of the example used, we will only focus on two tables.</p>

<p class="wp-block-paragraph">Let&apos;s start off with a single tag called &quot;<strong>TagX</strong>&quot;. We want to transfer the history of this tag to a new tag, &quot;<strong>TagY</strong>&quot;, that we&apos;ll introduce later. According to this Power Chart image, <strong>TagX</strong> has been active since at least 12:40PM and has been holding at a steady value of 2.</p>

<figure class="wp-block-image"><img decoding="async" alt="Power Chart displaying history for TagX" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/powerchart_TagX.png"  /></figure>

<h2 class="wp-block-heading">Tag Historian Tables</h2>

<p class="wp-block-paragraph">We can find this tag in one of Ignition&apos;s historian tables, <strong>sqlth_te</strong>. This contains all of the non-data information about a tag. The information in this table is a great starting point to understanding the other tables created by the historian. The most important columns are:</p>

<ul class="wp-block-list" type="disc">
 <li><strong>id</strong>: A&nbsp;unique identifier for a tag</li>
 <li><strong>tagpath</strong>: The tag path (without the provider), all lowercase</li>
 <li><strong>scid</strong>: id of the tag group that tag is in</li>
 <li><strong>created</strong>: An epoch timestamp of when the tag began storing tag history</li>
 <li><strong>retired</strong>: An epoch timestamp of when the tag stopped storing tag history or was deleted</li>
</ul>

<figure class="wp-block-image"><img decoding="async" alt="Database query browser displaying sqlth_te table" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/sqlth_te-TagX_1.png"  /></figure>

<p class="wp-block-paragraph">We also have the tables in which the history is actually stored. If monthly partitioning is set up, the name of the table will look something like <strong>sqlt_data_A_B_C</strong> where A is the driver id or gateway identifier, B is the year, and C is the month. In this example, our data table is <strong>sqlt_data_1_2022_11</strong>, so we know that this data was taken in November of 2022. The columns here log the actual values of the tags storing history. The columns in this table are:</p>

<ul class="wp-block-list" type="disc">
 <li><strong>tagid</strong>: The id from the sqlth_te table</li>
 <li><strong>___value</strong>: The value recorded for the tag</li>
 <li><strong>dataintegrity</strong>: The quality code of the value recorded</li>
 <li><strong>t_stamp</strong>: The epoch timestamp at which the value was recorded</li>
</ul>

<p class="wp-block-paragraph">We can also see <strong>TagX</strong>, which has a <strong>tagid</strong> of 5, started at a value of 0, and then transitioned to a value of 2 at 12:40PM.</p>

<figure class="wp-block-image"><img decoding="async" alt="Database query browser displaying data table" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/sqlth_data-TagX.png"  /></figure>

<h2 class="wp-block-heading">Adding TagY</h2>

<p class="wp-block-paragraph">Next, we introduce a new tag called &quot;<strong>TagY</strong>&quot;, assigned a <strong>tagid </strong>of 6 by Ignition, that begins collecting information at 12:52.</p>

<figure class="wp-block-image"><img decoding="async" alt="Database query browser displaying the sqlth_te table with TagX and TagY" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/sqlth_te-TagXY.png"  /></figure>

<p class="wp-block-paragraph">From 12:52 to about 12:53, both tags are reading a value of 2. The sensor for <strong>TagX</strong> goes offline just before 12:53, leaving only <strong>TagY</strong> online. At about 12:58, <strong>TagY</strong> then drops down to 1.</p>

<figure class="wp-block-image"><img decoding="async" alt="Power Chart displaying history for TagX and TagY" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/powerchart_TagXY.png"  /></figure>

<figure class="wp-block-image"><img decoding="async" alt="Database query browser displaying the data table for both TagX and TagY" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/sqlth_data-TagXY.png"  /></figure>

<h2 class="wp-block-heading">Performing the History Migration</h2>

<p class="wp-block-paragraph">To transfer the history of <strong>TagX</strong> to <strong>TagY</strong>, all we have to do is run a simple update query to replace the tagpath of <strong>TagX</strong> with the tagpath of <strong>TagY</strong>. The following script examples use Ignition&apos;s script console to query the database. Because these scripts are only querying the database, one may use whatever query tool they prefer.</p>

<figure class="wp-block-image"><img decoding="async" alt="Script console running a query " src="https://static.dmcinfo.com/wp-content/uploads/2025/05/query.png"  /></figure>

<p class="wp-block-paragraph">The <strong>sqlth_te</strong> table now looks like this.</p>

<figure class="wp-block-image"><img decoding="async" alt="Database query browser displaying the sqlth_te table for TagY" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/sqlth_te-TagY.png"  /></figure>

<p class="wp-block-paragraph">While <strong>sql_data_1_2022_11</strong> will still look the same, the tag history of <strong>TagX </strong>has transferred over to <strong>TagY</strong>. The history for <strong>TagY </strong>now goes beyond 12:52PM, its start time and <strong>TagX </strong>is no longer in the tag browser for the Power Chart component. We can also see that Ignition continues to collect and store history for <strong>TagY </strong>when the value rises to 3 at 1:11PM.</p>

<figure class="wp-block-image"><img decoding="async" alt="Power Chart displaying that TagX's history has been transferred over to TagY" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/powerchart_TagY3.png"  /></figure>

<p class="wp-block-paragraph"><strong>Learn more about DMC&apos;s&nbsp;<a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/ignition-programming">Ignition expertise</a>, and&nbsp;<a href="https://static.dmcinfo.com/contact">contact us</a>&nbsp;to get started on your next&nbsp;<a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming">HMI</a>,&nbsp;<a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming">SCADA</a>, or&nbsp;<a href="https://static.dmcinfo.com/services/manufacturing-automation-and-intelligence/manufacturing-execution-systems-services">MES&nbsp;</a>project!</strong></p>
<p>The post <a href="https://static.dmcinfo.com/blog/18050/migrating-tag-history-in-ignitions-tag-historian/">Migrating Tag History in Ignition&#8217;s Tag Historian</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
