<?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>Recipe Management Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/tag/recipe-management/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Wed, 22 Jul 2026 19:30:29 +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>Recipe Management Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Dynamically Specifying the Folder for Importing &#038; Exporting Siemens HMI Recipes</title>
		<link>https://static.dmcinfo.com/blog/21522/dynamically-specifying-the-folder-for-importing-exporting-siemens-hmi-recipes/</link>
		
		<dc:creator><![CDATA[Zachary Gracia]]></dc:creator>
		<pubDate>Mon, 20 May 2019 13:42:40 +0000</pubDate>
				<category><![CDATA[PLC]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Recipe Management]]></category>
		<category><![CDATA[Scripting]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21522/dynamically-specifying-the-folder-for-importing-exporting-siemens-hmi-recipes/</guid>

					<description><![CDATA[<p>One way to implement tasks when using Siemens products is to utilize the built-in recipe functionality. For applications in which the same PLC/HMI code is used across multiple standalone projects, it can be useful to configure a recipe on one PLC and then transfer it to other devices. To effectively transfer recipes between the PLC [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21522/dynamically-specifying-the-folder-for-importing-exporting-siemens-hmi-recipes/">Dynamically Specifying the Folder for Importing &#038; Exporting Siemens HMI Recipes</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">One way to implement tasks when using Siemens products is to utilize the built-in recipe functionality. For applications in which the same PLC/HMI code is used across multiple standalone projects, it can be useful to configure a recipe on one PLC and then transfer it to other devices. To effectively transfer recipes between the PLC and HMI, please refer to <a href="/latest-thinking/blog/id/9770/importing-csv-recipe-files-into-siemens-hmi-and-iteratively-downloading-multiple-data-records-from-hmi-into-plc">this blog</a> instead. This blog will cover dynamically setting the location of import files and export folders.</p>



<p class="wp-block-paragraph"><strong>It is important to note that this implementation will not work with basic panels!</strong></p>



<h2 id="h-exporting-and-importing-files" class="wp-block-heading">Exporting and Importing Files</h2>



<p class="wp-block-paragraph">Siemens HMI’s have built-in functions for importing and exporting files that are relatively easy to implement. Both functions are triggered by events that are named<strong> ExportDataRecords</strong> and <strong>ImportDataRecords, </strong>which are built-in Siemens functions.&nbsp;The events can trigger on a large variety of actions, but for this example, I had them trigger on HMI button presses.&nbsp;</p>



<p class="wp-block-paragraph">These events can be set by going to a component&#8217;s properties and clicking on the events tab (shown below).&nbsp;</p>



<p class="wp-block-paragraph"><img decoding="async" alt="recipe components" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Recipes-4-R.png"><br>
<em><span style="font-size:12px">Component Properties on the HMI interface</span></em></p>



<p class="wp-block-paragraph"><img decoding="async" alt="Figure 1" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Recipes-1-R.png"><br>
<em><span style="font-size:12px">Sample Configuration for ExportDataRecords</span></em></p>



<p class="wp-block-paragraph"><img decoding="async" alt="Figure 2" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Recipes-2-R.png"><br>
<em><span style="font-size:12px">Sample Configuration for ImportDataRecords</span></em></p>



<p class="wp-block-paragraph">For both importing and exporting data records, the input that specifies the desired pathing is the <strong>filename</strong> input. This parameter is the system path to the file in the form of a string. The string containing the <strong>import</strong> variable, and the string containing the <strong>export</strong> variable can be set using the same built-in HMI event function called <strong>OpenFileBrowser</strong>. Note that for this implementation, the export path and the import will need to be held in separate variables.</p>



<p class="wp-block-paragraph"><img decoding="async" alt="Figure 3" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Recipes-3-R.png"><br>
<em><span style="font-size:12px">Sample Configuration for OpenFileBrowser</span></em></p>



<p class="wp-block-paragraph">This event lets the user navigate to a desired folder/file and save the computer pathing of that file to the tag passed into the Path input. In this application, a specific file is used for importing recipes, and a folder is specified for exporting recipes. To do this, toggle the file input of the open file browser event.</p>



<p class="wp-block-paragraph">When this parameter is set to true, the file browser will return a path to a file, when it is false it will return the path to a folder. When this field is set to true, you can also mask the browser to only show specific file extensions such as .csv or .ap by using the mask field. This can be useful for ignoring irrelevant files.</p>



<p class="wp-block-paragraph">The event that exports recipes needs a file pathing to export, and since our file browsing event is grabbing a folder pathing, some basic scripting is needed to create an export file path we can use. The script below concatenates the folder pathing we got from the file browser with a name tag I created for the current recipe. This script should be triggered on the value change of either the folder path or the recipe name.</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">VB</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>Sub ExportPathing()

    HmiRuntime.SmartTags("sExportPath") = _
        HmiRuntime.SmartTags("sExportPathFolder") &amp; _
        HmiRuntime.SmartTags("dbRecipes_udtCurrentRecipe_sRecipeName") &amp; _
        ".csv"

End Sub</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">Sub</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">ExportPathing</span><span style="color: #D4D4D4">()</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    HmiRuntime.</span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;sExportPath&quot;</span><span style="color: #D4D4D4">) =</span><span style="color: #9CDCFE"> _</span></span>
<span class="line"><span style="color: #D4D4D4">        HmiRuntime.</span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;sExportPathFolder&quot;</span><span style="color: #D4D4D4">) &amp;</span><span style="color: #9CDCFE"> _</span></span>
<span class="line"><span style="color: #D4D4D4">        HmiRuntime.</span><span style="color: #DCDCAA">SmartTags</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;dbRecipes_udtCurrentRecipe_sRecipeName&quot;</span><span style="color: #D4D4D4">) &amp;</span><span style="color: #9CDCFE"> _</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&quot;.csv&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">End Sub</span></span></code></pre></div>



<p class="wp-block-paragraph">Once the correct path is specified for importing and exporting, the import and export event are ready to be triggered. By using the tips outlined for importing and exporting recipes, you should be able to specify computer locations for importing and exporting recipes easily. I hope this will help in your future endeavors.</p>



<p class="wp-block-paragraph">Learn more about DMC&#8217;s <a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming">HMI and SCADA Expertise</a> and our partnership with <a href="/about/partners/siemens-solution-partner">Siemens</a>.</p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://static.dmcinfo.com/blog/21522/dynamically-specifying-the-folder-for-importing-exporting-siemens-hmi-recipes/">Dynamically Specifying the Folder for Importing &#038; Exporting Siemens HMI Recipes</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
