<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Using the same variables for recipes and communication</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21f213adbb/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21f213adbb/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/21f213adbb/</id><updated>2020-02-27T14:07:42.686000Z</updated><subtitle>Recent posts to Using the same variables for recipes and communication</subtitle><entry><title>Using the same variables for recipes and communication</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21f213adbb/?limit=25#5496" rel="alternate"/><published>2020-02-27T14:07:42.686000Z</published><updated>2020-02-27T14:07:42.686000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com57b2310c46d665810549239fe2d932c6acd017db</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; scott_cunningham&lt;/p&gt;
&lt;p&gt;You should be able to use the same variables for the recipe values and to send those values over the communication channel.  However, you may want to use a set of temporary variables for loading your recipe to preview it or alter it before going "live" with the values.  Otherwise, a user cannot change his mind (the old recipe values are lost as soon as you load one).&lt;/p&gt;
&lt;p&gt;It may be seen as duplication or wasteful, but I prefer to define an array specifically for the communication channel and create one Program that is called every PLC scan that maps program variables to/from the array (especially for Modbus).  That way, I am sure of my data order (data&lt;span&gt;[1]&lt;/span&gt;, data&lt;span&gt;[2]&lt;/span&gt;, etc) while still using descriptive variables in my code (CmdSpeed, ActSpeed, FeedRate, etc).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Using the same variables for recipes and communication</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21f213adbb/?limit=25#ce58" rel="alternate"/><published>2020-02-27T14:07:42.377000Z</published><updated>2020-02-27T14:07:42.377000Z</updated><author><name>razmis</name><uri>https://forge.codesys.com/u/razmis/</uri></author><id>https://forge.codesys.comd32d64bc1acb8a0fcede0289a04a1ee3e47e6cfa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In my project I have many parameters that needs to be in a recipe and also to be transferred via communication (Ethernet/IP) to slave devices.&lt;br/&gt;
Is it OK to use the same variables for both the recipe and the communication or should I use two different sets of variables (one for the recipe and one for the communication)?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>