<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/68f5a8e190/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/68f5a8e190/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/68f5a8e190/</id><updated>2020-02-27T21:28:27.073000Z</updated><subtitle>Recent posts to convert string to actual io?</subtitle><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#089a" rel="alternate"/><published>2020-02-27T21:28:27.073000Z</published><updated>2020-02-27T21:28:27.073000Z</updated><author><name>sarathbabu</name><uri>https://forge.codesys.com/u/sarathbabu/</uri></author><id>https://forge.codesys.com585b649b86316c1a5e7a862758f8026bb695bb07</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Am gonna create a function to do this stuff &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#3a32" rel="alternate"/><published>2020-02-27T21:28:25.614000Z</published><updated>2020-02-27T21:28:25.614000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com936485ba58aec8316be2e2092243c071a7db6f1a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;no what you are trying is not possible, however you can use an array if it are a lot of bools.&lt;br/&gt;
like test&lt;span&gt;[1]&lt;/span&gt;:=true;&lt;br/&gt;
etc.&lt;br/&gt;
but you have to make it in advance as it is impossible to change the variable list in a running program&lt;/p&gt;
&lt;p&gt;however i/o must be in global list with all %QX0.0 in writing.&lt;br/&gt;
(you can automate this with a textmaker.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#d632" rel="alternate"/><published>2020-02-27T21:28:20.733000Z</published><updated>2020-02-27T21:28:20.733000Z</updated><author><name>sarathbabu</name><uri>https://forge.codesys.com/u/sarathbabu/</uri></author><id>https://forge.codesys.com1322d5ef7e96f6d063fc83ada2e0608260ef3540</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Actually I want to use&lt;/p&gt;
&lt;p&gt;Test1:bool&lt;br/&gt;
Test2:bool&lt;br/&gt;
Test3:bool&lt;/p&gt;
&lt;p&gt;to &lt;/p&gt;
&lt;p&gt;for i=1 t0 3&lt;br/&gt;
test:=concat('Test'+int_to_string('i'))&lt;br/&gt;
end_for&lt;/p&gt;
&lt;p&gt;i do not want to use if else statement&lt;/p&gt;
&lt;p&gt;its compiling yet am not seeing any output&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#863b" rel="alternate"/><published>2020-02-27T21:28:19.086000Z</published><updated>2020-02-27T21:28:19.086000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comd139928e8389937b9a217734749e1567084383b0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;NO, you can not make variablenames inside your code, as the code is compiled all this info is lost again.&lt;/p&gt;
&lt;p&gt;however you can make a automatic declarationtable (in any textmaker like NPP).&lt;br/&gt;
sorry for the misunderstanding.&lt;/p&gt;
&lt;p&gt;what are you trying to do?&lt;br/&gt;
look for data types here you can make types and structures&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#5c92" rel="alternate"/><published>2020-02-27T21:28:14.864000Z</published><updated>2020-02-27T21:28:14.864000Z</updated><author><name>sarathbabu</name><uri>https://forge.codesys.com/u/sarathbabu/</uri></author><id>https://forge.codesys.com703a20edadbc4633b264d8d0e5c8dfce6ffd062e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Is there no way to convert a string to the desired variable name we declare no matter what sort of declaration it is&lt;/p&gt;
&lt;p&gt;for eg: r_codesys:real;&lt;br/&gt;
          b_codesys:bool;&lt;br/&gt;
          i_codesys:int;&lt;/p&gt;
&lt;p&gt;string_to_real('r_codesys')&lt;br/&gt;
string_to_bool('b_codesys')&lt;br/&gt;
string_to_int('i_codesys')&lt;/p&gt;
&lt;p&gt;is not the above things possible?&lt;/p&gt;
&lt;p&gt;Are need to write my own code to make it work like this?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#7571" rel="alternate"/><published>2020-02-27T21:28:13.385000Z</published><updated>2020-02-27T21:28:13.385000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com94d6786ed0cd0318dcb39a83e073085b98f99fb4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;so &lt;br/&gt;
check :STRING(30):='23.45';&lt;br/&gt;
check2:REAL;&lt;/p&gt;
&lt;p&gt;use oscat.de FLOAT_TO_REAL function&lt;br/&gt;
check2:=FLOAT_TO_REAL(check);&lt;br/&gt;
however no output is in real, but you can use REAL_TO_WORD.&lt;/p&gt;
&lt;p&gt;in boolean it is simpler&lt;br/&gt;
IF (check= '23.45') THEN heateron:=TRUE;END_IF&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#4e53" rel="alternate"/><published>2020-02-27T21:28:09.312000Z</published><updated>2020-02-27T21:28:09.312000Z</updated><author><name>sarathbabu</name><uri>https://forge.codesys.com/u/sarathbabu/</uri></author><id>https://forge.codesys.comd07f3ad26b00309e8b140cd607ca5c70a9d0c361</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;well then for bool&lt;/p&gt;
&lt;p&gt;eg heateron: bool(&lt;em&gt;This boolean not from hardware&lt;/em&gt;) &lt;/p&gt;
&lt;p&gt;check:=concat('heater'+'on')&lt;br/&gt;
check2:=string_to_real(check2);&lt;/p&gt;
&lt;p&gt;Is it possible?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#d951" rel="alternate"/><published>2020-02-27T21:28:07.817000Z</published><updated>2020-02-27T21:28:07.817000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com8afdeb3e122b196c3b99ca60cb893642268d9d0b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;you have a WORD not a REAL coming from the inputcard.&lt;br/&gt;
there are no direct inputs with real.&lt;br/&gt;
conversion is possible with word_to_real (value is 10 times the measured value)&lt;br/&gt;
so your setpoint is a real, not a string.&lt;br/&gt;
and you can not have 1 var (check2) double declared&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>convert string to actual io?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/68f5a8e190/?limit=25#dcbd" rel="alternate"/><published>2020-02-27T21:28:06.270000Z</published><updated>2020-02-27T21:28:06.270000Z</updated><author><name>sarathbabu</name><uri>https://forge.codesys.com/u/sarathbabu/</uri></author><id>https://forge.codesys.comabd20ea34439cf37130a2ac9b6206c65b45a90b9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;am trying to convert string to an Io&lt;/p&gt;
&lt;p&gt;eg heatertemperature %iw23 real&lt;/p&gt;
&lt;p&gt;check:=concat('heater'+'temperarture')&lt;br/&gt;
check2:=string_to_real(check2);&lt;/p&gt;
&lt;p&gt;Is it possible?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>