<?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>Custom Device Messaging Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/tag/custom-device-messaging/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Fri, 12 Jun 2026 14:38:17 +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>Custom Device Messaging Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Communicate with a VeriStand Custom Device Using LabVIEW</title>
		<link>https://static.dmcinfo.com/blog/18525/how-to-communicate-with-a-veristand-custom-device-using-labview/</link>
		
		<dc:creator><![CDATA[Eric Voigt]]></dc:creator>
		<pubDate>Wed, 11 May 2022 08:17:56 +0000</pubDate>
				<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[Custom Device Messaging]]></category>
		<category><![CDATA[NI]]></category>
		<category><![CDATA[TestStand]]></category>
		<category><![CDATA[VeriStand]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/18525/how-to-communicate-with-a-veristand-custom-device-using-labview/</guid>

					<description><![CDATA[<p>Table of Contents: Why Should We Configure Custom Device Messaging? Back to Table of Contents Creating Custom Devices in VeriStand is a powerful tool that allows developers to package and deploy code for a device simply by adding the Custom Device to a system definition file. There are two primary methods for transferring data to [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/18525/how-to-communicate-with-a-veristand-custom-device-using-labview/">How to Communicate with a VeriStand Custom Device Using LabVIEW</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph"><u><a id="Table of Contents" name="Table of Contents"></a>Table of Contents:</u></p>

<ol class="wp-block-list">
 <li><a href="#Why Should We Configure Custom Device Messaging?">Why Should We Configure Custom Device Messaging?</a></li>
 <li><a href="#How to Send Messages between a Custom Device and LabVIEW">How to Send Messages between a Custom Device and LabVIEW</a>
 <ol class="wp-block-list">
  <li><a href="#Step 1: Pass Engine Event Ref into Custom Device Engine">Step 1: Pass Engine Event Ref into Custom Device Engine</a></li>
  <li><a href="#Step 2: Create Event Structures in Asynchronous Loop to Receive Messages">Step 2: Create Event Structures in Asynchronous Loop to Receive Messages</a></li>
  <li><a href="#Step 3: Create LabVIEW Code Module to Send Message">Step 3: Create LabVIEW Code Module to Send Message</a></li>
 </ol>
 </li>
</ol>

<h2 class="wp-block-heading"><u><a id="Why Should We Configure Custom Device Messaging?" name="Why Should We Configure Custom Device Messaging?"></a>Why Should We Configure Custom Device Messaging?</u></h2>

<p class="wp-block-paragraph"><em><a href="#Table of Contents">Back to Table of Contents</a></em></p>

<p class="wp-block-paragraph">Creating Custom Devices in <a href="https://www.ni.com/en-us/shop/data-acquisition-and-control/application-software-for-data-acquisition-and-control-category/what-is-veristand.html?cid=Paid_Search-7013q000001UgkyAAC-Consideration-GoogleSearch_106892618128" target="_blank">VeriStand</a> is a powerful tool that allows developers to package and deploy code for a device simply by adding the Custom Device to a system definition file.</p>

<p class="wp-block-paragraph">There are two primary methods for transferring data to and from a custom device: channels and messages. Channels are typically used to read or write data in a control loop, and they can be interacted with by a user through a VeriStand screen once deployed. On the other hand, Messages generate events to configure and command custom device actions or properties.</p>

<p class="wp-block-paragraph">Messages to Custom Devices are sent through <a href="https://www.ni.com/en-us/shop/labview.html?cid=Paid_Search-7013q000001UgkyAAC-Consideration-GoogleSearch_102713974313&amp;s_kwcid=AL!6304!3!449107487685!e!!g!!ni%20labview&amp;gclid=CjwKCAjwve2TBhByEiwAaktM1AKnkuxVWP8HHCUrwBUDeFguaV8Lp2KOu7twThV-RJW1w0Wo02ojGhoCv3EQAvD_BwE#" target="_blank">LabVIEW</a> code modules. There are many advantages to communicating with a Custom Device using messages from LabVIEW:</p>

<ul class="wp-block-list">
 <li>Messaging data allows for more flexibility in the types of data sent to a Custom Device engine
 <ul class="wp-block-list">
  <li>VeriStand channels only support DBL numeric data, while messaging supports other data types</li>
  <li>The number of channels is fixed by the system definition file, so data structures, like arrays, need to have a fixed size</li>
 </ul>
 </li>
 <li>Because most Custom Devices are deployed through VeriStand onto RT systems, the ability to send messages between the Custom Device and LabVIEW allows for communication with a PC-based LabVIEW application</li>
 <li>LabVIEW code modules for Custom Device messaging can be used in TestStand steps to develop large sequencing and test applications with a Custom Device<br />
 &nbsp;</li>
</ul>

<h2 class="wp-block-heading"><u><a id="How to Send Messages between a Custom Device and LabVIEW" name="How to Send Messages between a Custom Device and LabVIEW"></a>How to Send Messages between a Custom Device and LabVIEW</u></h2>

<p class="wp-block-paragraph"><em><a href="#Table of Contents">Back to Table of Contents</a></em></p>

<h2 class="wp-block-heading"><u><a id="Step 1: Pass Engine Event Ref into Custom Device Engine" name="Step 1: Pass Engine Event Ref into Custom Device Engine"></a>Step 1: Pass Engine Event Ref into Custom Device Engine</u></h2>

<p class="wp-block-paragraph"><em><a href="#Table of Contents">Back to Table of Contents</a></em></p>

<p class="wp-block-paragraph">When messages are sent between LabVIEW and a VeriStand Custom Device, the Custom Device engine treats the message as a user event. Before handling this user event in the async loop(s) of the Custom Device, all asynchronous loops should be passed the reference to the Custom Device engine events. This reference contains the events associated with Custom Device messaging in the engine and can be obtained with<strong> NI VeriStand &#8211; Register Custom Device Events.vi</strong>. Below is an example implementation of <strong>RT Driver.vi</strong> with the engine event reference being passed as an initialization parameter into the code that starts the asynchronous Custom Device process.</p>

<p class="wp-block-paragraph"><figure class="wp-block-image"><img decoding="async" alt="Example implementation of RT Driver.vi with the engine event reference being passed as an initialization parameter into the code that starts the asynchronous Custom Device process" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Photo-1.png"  /></figure>&nbsp;</p>

<h2 class="wp-block-heading"><u><a id="Step 2: Create Event Structures in Asynchronous Loop to Receive Messages" name="Step 2: Create Event Structures in Asynchronous Loop to Receive Messages"></a>Step 2: Create Event Structures in Asynchronous Loop to Receive Messages</u></h2>

<p class="wp-block-paragraph"><em><a href="#Table of Contents">Back to Table of Contents</a></em></p>

<p class="wp-block-paragraph">Now that the Custom Device engine events reference is accessible from the asynchronous loops, event structures may be created to handle message events. There are two messaging events within the engine event reference: <strong>Message (String) </strong>and<strong> Message (Byte Array)</strong>. Both events contain a <strong>Command</strong>, <strong>Data</strong>, and a <strong>Response Event</strong>. The difference between the two user events is the format of <strong>Data</strong>.</p>

<ul class="wp-block-list">
 <li><strong>Command:</strong> the name or type of message being sent</li>
 <li><strong>Data:</strong> the data associated with the command</li>
 <li><strong>Response Event:</strong> an event reference to send back data to LabVIEW; consider using this to send back data processed by the Custom Device or a confirmation that the message was received</li>
</ul>

<p class="wp-block-paragraph">As shown below in the example code, a case structure may be implemented to handle each type of incoming message to the Custom Device. Each case contains logic to handle the message <strong>Data </strong>as well as generate a response and error message (if applicable). The response and error are bundled as a message response and sent back to LabVIEW through the <strong>Response Event</strong>.</p>

<figure class="wp-block-image"><img decoding="async" alt="Example code, a case structure may be implemented to handle each type of incoming message to the Custom Device" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Photo-2.png"  /></figure>

<p class="wp-block-paragraph">One limitation of messaging between VeriStand Custom Devices and LabVIEW is that messages can only be formatted as strings or byte arrays; however, messages of any type may be flattened to a text string and converted into a byte array. Below is an example of how message <strong>Data</strong> could be handled within a case to receive data of a type associated with the message <strong>Command</strong> and send any type of response data back to LabVIEW as a byte array. In LabVIEW, message <strong>Data</strong> and responses can be converted to or from a byte array in a similar manner.</p>

<figure class="wp-block-image"><img decoding="async" alt="An example of how message Data could be handled within a case to receive data of a type associated with the message Command and send any type of response data back to LabVIEW as a byte array" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Photo-3.png"  /></figure>

<h2 class="wp-block-heading"><u><a id="Step 3: Create LabVIEW Code Module to Send Message" name="Step 3: Create LabVIEW Code Module to Send Message"></a>Step 3: Create LabVIEW Code Module to Send Message</u></h2>

<p class="wp-block-paragraph"><em><a href="#Table of Contents">Back to Table of Contents</a></em></p>

<p class="wp-block-paragraph">After setting up event structures to handle messages sent to the Custom Device, the final step is to send messages and receive responses in LabVIEW. This is made simple by the <strong>Custom Device Communication Palette.</strong></p>

<ul class="wp-block-list">
 <li>First, use <strong>NI VeriStand &#8211; Open Custom Device Reference</strong> to open a reference to the Custom Device specified by <strong>Custom Device Path</strong> (also known as <strong>Node Path</strong>) and <strong>Gateway IP Address</strong> that can be used to send messages</li>
 <li>Next, call <strong>NI VeriStand &#8211; Send Custom Device Message</strong> to send the formatted message&rsquo;s <strong>Command </strong>and <strong>Data</strong>, ensuring that the <strong>Data </strong>sent is of the type expected by the engine</li>
 <li>When a response from the Custom Device is received, call <strong>NI VeriStand &#8211; Close Custom Device Reference</strong> to close the messaging reference.</li>
</ul>

<p class="wp-block-paragraph">.<figure class="wp-block-image"><img decoding="async" alt="Create LabVIEW Code Module to Send Message" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Photo-4.png"  /></figure></p>

<p class="wp-block-paragraph">Scripting VIs based on a VeriStand system definition file can programmatically obtain references to Custom Devices and return properties such as the <strong>Node Path</strong> which is used in the VeriStand messaging VIs to open a messaging reference to a Custom Device. Stay tuned for more VeriStand tutorials and blog posts &mdash; including how to create a system definition scripting library!</p>

<p class="wp-block-paragraph">Learn more about our <a href="https://static.dmcinfo.com/services/test-and-measurement-automation/labview-programming">LabVIEW Programming</a>, and <a href="https://static.dmcinfo.com/contact">contact us</a> today for your next project!</p>
<p>The post <a href="https://static.dmcinfo.com/blog/18525/how-to-communicate-with-a-veristand-custom-device-using-labview/">How to Communicate with a VeriStand Custom Device Using LabVIEW</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
