<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CmpIecVarAccess to get name of a type, not of a variable (instance)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cd6efbff69/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cd6efbff69/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/cd6efbff69/</id><updated>2020-02-27T14:11:38.975000Z</updated><subtitle>Recent posts to CmpIecVarAccess to get name of a type, not of a variable (instance)</subtitle><entry><title>CmpIecVarAccess to get name of a type, not of a variable (instance)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cd6efbff69/?limit=25#846a" rel="alternate"/><published>2020-02-27T14:11:38.975000Z</published><updated>2020-02-27T14:11:38.975000Z</updated><author><name>berendej</name><uri>https://forge.codesys.com/u/berendej/</uri></author><id>https://forge.codesys.com6df2e285fc4e5b3e55f4bda5447f184153256486</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I just got quick response from CoDeSys support ( thank you guys ! ).&lt;br/&gt;
solution is :&lt;/p&gt;
&lt;p&gt;IecVarAccGetTypeName( hInterface, hTypeNode, &amp;amp;result)  &lt;/p&gt;
&lt;p&gt;problem is solved.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CmpIecVarAccess to get name of a type, not of a variable (instance)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cd6efbff69/?limit=25#ebc6" rel="alternate"/><published>2020-02-27T14:11:37.878000Z</published><updated>2020-02-27T14:11:37.878000Z</updated><author><name>berendej</name><uri>https://forge.codesys.com/u/berendej/</uri></author><id>https://forge.codesys.comecb00b9de374d93e09c4ebf19df3060a34c17de4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a type (structure) in my IEC application&lt;/p&gt;
&lt;p&gt;TYPE composite_t :&lt;br/&gt;
STRUCT&lt;br/&gt;
                m_i : INT;&lt;br/&gt;
                m_f : REAL;&lt;br/&gt;
END_STRUCT&lt;br/&gt;
END_TYPE&lt;/p&gt;
&lt;p&gt;And somewhere in application I have an instance of this type: &lt;br/&gt;
&lt;strong&gt;ct1&lt;/strong&gt; : composite_t := ( m_i := 1, m_f := 2 );&lt;/p&gt;
&lt;p&gt;I write component which uses CmpIecVarAccess interface, I'd like to get type information.&lt;/p&gt;
&lt;p&gt;I browse to "&lt;strong&gt;ct1&lt;/strong&gt;" ( hNode is a handle to variable "ct1" ) and then I call:&lt;/p&gt;
&lt;p&gt;TypeDescAsUnion &lt;strong&gt;typeDesc&lt;/strong&gt;;&lt;br/&gt;
hTypeNode = IecVarAccGetTypeNode3(hInterface, hNode, &amp;amp;VarInfo, &amp;amp;result);&lt;br/&gt;
IecVarAccGetTypeDesc(hInterface, hTypeNode, &amp;amp;&lt;strong&gt;typeDesc&lt;/strong&gt;);&lt;/p&gt;
&lt;p&gt;And as a result I have a valid &lt;strong&gt;typeDesc&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;So the question is: Is it possible having &lt;strong&gt;typeDesc&lt;/strong&gt; to get the name of the type ( i.e. "composite_t" ) ? &lt;br/&gt;
Not the name of a variable ( "ct1" ) , but the name of a type?&lt;/p&gt;
&lt;p&gt;I tryed:&lt;br/&gt;
     char *szTypeName = CAL_IecVarAccGetNodeName(hInterface, hTypeNode, &amp;amp;result);&lt;br/&gt;
But it doesn't work.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>