<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to change the variable in the structure after the point mark?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/afdcb1d639/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/afdcb1d639/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/afdcb1d639/</id><updated>2021-02-19T12:50:40.405000Z</updated><subtitle>Recent posts to How to change the variable in the structure after the point mark?</subtitle><entry><title>How to change the variable in the structure after the point mark?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/afdcb1d639/?limit=25#3857" rel="alternate"/><published>2021-02-19T12:50:40.405000Z</published><updated>2021-02-19T12:50:40.405000Z</updated><author><name>mysticbaklava</name><uri>https://forge.codesys.com/u/mysticbaklava/</uri></author><id>https://forge.codesys.comdc1d8da9b1902ed1365a1a29c97b4f96886574f6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;So I'm writing a basic modbus rtu program.&lt;/p&gt;
&lt;p&gt;I have defined a structure. It's like this,&lt;br/&gt;
**TYPE DataArray :&lt;br/&gt;
STRUCT&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;Refperc&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;KW&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;UINT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;HZ&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;UINT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Freqperc&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;UINT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Volt&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;UINT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Speedperc&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_STRUCT&lt;br/&gt;
END_TYPE**&lt;/p&gt;
&lt;p&gt;When applying this to the modbus data input. I have defined an array which is,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;INSERTDATA: ARRAY &lt;span&gt;&lt;span&gt;[1..6]&lt;/span&gt;&lt;/span&gt; OF DataArray;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To change the variables while reading ad writing I've made a slave counter and used in it. When I apply it, it looks like this,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;INSERTDATA&lt;span&gt;&lt;span&gt;[slavecounter]&lt;/span&gt;&lt;/span&gt;.refperc&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So I want to be able to change the variable after the point mark. Like, switching it to KW,HZ,Freqperc, Volt using another counter. How can I do this?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>