<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to string &amp; variable questions</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9d20e81435/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9d20e81435/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9d20e81435/</id><updated>2020-02-27T19:30:20.236000Z</updated><subtitle>Recent posts to string &amp; variable questions</subtitle><entry><title>string &amp; variable questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9d20e81435/?limit=25#9061" rel="alternate"/><published>2020-02-27T19:30:20.236000Z</published><updated>2020-02-27T19:30:20.236000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.come89e179657c385c16131eba425fb835bb8b41416</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What PLC are you using? What communication buses are available? Where are you trying to read/write the values from? A PC connected to the PLC? I may have some solutions but more information is needed.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>string &amp; variable questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9d20e81435/?limit=25#8dad" rel="alternate"/><published>2020-02-27T19:30:16.757000Z</published><updated>2020-02-27T19:30:16.757000Z</updated><author><name>zebra</name><uri>https://forge.codesys.com/u/zebra/</uri></author><id>https://forge.codesys.com502af9332bcc479f23390242d48262aa54fad214</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your input.  I was trying to create my own retain variable save and restore programs.  But then I found the functions syssaveretains and sysrestoreretains.  These functions MOSTLY work.  I have started another post for the questions I have about implementing those function blocks.  If you have experience with those functions, please read and reply to that post! &lt;/p&gt;
&lt;p&gt;Thank you both for taking the time to consider and respond to my newbie question!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>string &amp; variable questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9d20e81435/?limit=25#1555" rel="alternate"/><published>2020-02-27T19:30:15.487000Z</published><updated>2020-02-27T19:30:15.487000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.com408529f0af860938af69c36a3c78d69bf4e9b21b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What are you ultimately trying to accomplish? You can use the CoDeSys gateway and DDE to accomplish communication to the PLC by directly read/write variables. Look at the CoDeSys manual under the DDE section. Otherwise you can point structures at memory addresses and you will only need to read/write the memory address.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>string &amp; variable questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9d20e81435/?limit=25#ed15" rel="alternate"/><published>2020-02-27T19:30:11.980000Z</published><updated>2020-02-27T19:30:11.980000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com455de86ff93ac2c4c522c63833b566cffde2bcea</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;you can not declare a variable inside a running program, however you can make a array with all the names inside and compare them to the incoming text,&lt;br/&gt;
like arraylong 1..1000 (name,type,variable)&lt;br/&gt;
find string inside your array and change the value.&lt;br/&gt;
if not found add string to array etc.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>string &amp; variable questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9d20e81435/?limit=25#b6c4" rel="alternate"/><published>2020-02-27T19:30:10.744000Z</published><updated>2020-02-27T19:30:10.744000Z</updated><author><name>zebra</name><uri>https://forge.codesys.com/u/zebra/</uri></author><id>https://forge.codesys.com2e0355bd6ffbe2b9eec6913c64dfc54ceff7bf2e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The PLC I am working with will receive a string of text.  The format of the text string is:&lt;br/&gt;
'variable_name,variable_type,variable_value'.&lt;/p&gt;
&lt;p&gt;What I need to do is to use the variable type and variable value information to update the variable that has the value 'variable_name'.  I can convert the variable_value string to a number based on the variable_type string, but when the variable name can be one of a thousand variables or more, then this becomes a real challenge.  &lt;/p&gt;
&lt;p&gt;Is there a way to convert a string to a variable?  For example, can I take the string value 'temperature_var' and change the value of the variable temperature_var?&lt;/p&gt;
&lt;p&gt;I don't see a function to do that and am not sure that it would be a great way to code the project anyway.  I haven't used structured programming like C or pascal in 15 years or more and am new to CoDeSys.  Any input from those who are wise would be greatly appreciated!&lt;/p&gt;
&lt;p&gt;Steve&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>