<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Pointer und Struct</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/15f538c40f/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/15f538c40f/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/15f538c40f/</id><updated>2020-02-28T06:02:12.425000Z</updated><subtitle>Recent posts to Pointer und Struct</subtitle><entry><title>Pointer und Struct</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/15f538c40f/?limit=25#9661" rel="alternate"/><published>2020-02-28T06:02:12.425000Z</published><updated>2020-02-28T06:02:12.425000Z</updated><author><name>mde</name><uri>https://forge.codesys.com/u/mde/</uri></author><id>https://forge.codesys.com8bdfc424ed60e3683198ad4dbd4cc8c9d481bbcc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hab es schon gelöst.&lt;/p&gt;
&lt;p&gt;Hatte den ^-Operator an der falschen Stelle.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;pt&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;POINTER&lt;/span&gt; &lt;span class="nt"&gt;TO&lt;/span&gt; &lt;span class="nt"&gt;Struct1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;test&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;test&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;pt&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;P1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So geht es.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Pointer und Struct</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/15f538c40f/?limit=25#fe83" rel="alternate"/><published>2020-02-28T06:02:10.276000Z</published><updated>2020-02-28T06:02:10.276000Z</updated><author><name>mde</name><uri>https://forge.codesys.com/u/mde/</uri></author><id>https://forge.codesys.com50427de5c6ddfb5b147e8d778e77ae21a2fd8554</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hallo,&lt;/p&gt;
&lt;p&gt;ich habe folgendes Problem, ich habe einen Pointer auf eine Struktur. Jetzt möchte ich auf die Parameter der Struktur zugreifen um z.b. den Inhalt des Parameters P1 an die Variable test zu übergeben.&lt;/p&gt;
&lt;p&gt;Struktur:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;TYPE&lt;/span&gt; &lt;span class="nt"&gt;Struct1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="nt"&gt;STRUCT&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;P1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;P2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;P3&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_STRUCT&lt;/span&gt;
&lt;span class="nt"&gt;END_TYPE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Programm:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;pt&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;POINTER&lt;/span&gt; &lt;span class="nt"&gt;TO&lt;/span&gt; &lt;span class="nt"&gt;Struct1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;test&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;test&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;pt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;P1&lt;/span&gt;&lt;span class="o"&gt;^;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Ich bekomme immer die Fehlermeldungen&lt;/p&gt;
&lt;p&gt;Fehler 4001: ... Variable 'P1' nicht deklariert&lt;/p&gt;
&lt;p&gt;Fehler 4120: ... Vor dem '.' muß eine Strukturvariable stehen&lt;/p&gt;
&lt;p&gt;In Ansi C würde ich diesen Zugriff über den Pfeil-Operator -&amp;gt; machen.&lt;/p&gt;
&lt;p&gt;Danke.&lt;/p&gt;
&lt;p&gt;mde&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>