<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Automation Platform. Code source modification from C#</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0387efc243/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0387efc243/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/0387efc243/</id><updated>2020-02-27T15:05:34.098000Z</updated><subtitle>Recent posts to Automation Platform. Code source modification from C#</subtitle><entry><title>Automation Platform. Code source modification from C#</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0387efc243/?limit=25#64db" rel="alternate"/><published>2020-02-27T15:05:34.098000Z</published><updated>2020-02-27T15:05:34.098000Z</updated><author><name>r.evbatyrov</name><uri>https://forge.codesys.com/u/r-evbatyrov/</uri></author><id>https://forge.codesys.com93b035d59e4ddbc887023cbe076a831bbd39b66c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Dave,&lt;br/&gt;
sorry for misleading answer - there is actually no forum for Automation Platform.&lt;br/&gt;
Developer Network is a documentation/samples resource. &lt;br/&gt;
Just contact Support for AP questions; your inquiry will be directed to responsible person.&lt;/p&gt;
&lt;p&gt;Regards&lt;br/&gt;
Roman&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Automation Platform. Code source modification from C#</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0387efc243/?limit=25#754a" rel="alternate"/><published>2020-02-27T15:05:32.323000Z</published><updated>2020-02-27T15:05:32.323000Z</updated><author><name>davec</name><uri>https://forge.codesys.com/u/davec/</uri></author><id>https://forge.codesys.com904a96fed8366cb847af9836f361e6c16fb841bc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Roman,&lt;br/&gt;
thank you for clarification, I was really going the wrong way with LanguageModel.&lt;br/&gt;
As suggested, i'll ask help on the developer network&lt;/p&gt;
&lt;p&gt;Regards,&lt;br/&gt;
Dave&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Automation Platform. Code source modification from C#</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0387efc243/?limit=25#04b5" rel="alternate"/><published>2020-02-27T15:05:31.699000Z</published><updated>2020-02-27T15:05:31.699000Z</updated><author><name>r.evbatyrov</name><uri>https://forge.codesys.com/u/r-evbatyrov/</uri></author><id>https://forge.codesys.combeb0f6fe404a844d4e062cc53d777a46824307b0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Dave,&lt;/p&gt;
&lt;p&gt;please note, that CODESYS Forum is an end-user forum, where topics conserning the of CODESYS are discussed. Automation Platfrom is not an add-on or store product. It is not how to use CODESYS, but how CODESYS made of.&lt;/p&gt;
&lt;p&gt;The proper place for such discussions is &lt;strong&gt;Developer Network&lt;/strong&gt;&lt;br/&gt;
&lt;a class="" href="http://dn.codesys.com/" rel="nofollow"&gt;http://dn.codesys.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here just a short answer.&lt;br/&gt;
With language model expression visitor you can modify the language model (how the source is interpeted), but &lt;strong&gt;not &lt;/strong&gt;a source code itself.&lt;br/&gt;
If you want to modify a source code, you have to access the object (document AP_Concepts_LanguageModelManager is not about it at all).&lt;br/&gt;
If you want to mofify a language model:&lt;br/&gt;
1. Creare a pragma attribute statement using &lt;br/&gt;
IPragmaStatement ILanguageModelBuilder3.CreatePragmaAttributeStatement(IExprementPosition pos, string attributeName, string attributeValue)&lt;br/&gt;
2. The statement can be added/inserted with ISequenceStatement.AddStatemnt(IStatement) / ISequenceStatement.InsertStatement(int,IStatement) to desired part of language model tree.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br/&gt;
Roman&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Automation Platform. Code source modification from C#</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0387efc243/?limit=25#11b1" rel="alternate"/><published>2020-02-27T15:05:31.079000Z</published><updated>2020-02-27T15:05:31.079000Z</updated><author><name>davec</name><uri>https://forge.codesys.com/u/davec/</uri></author><id>https://forge.codesys.com14d8b460a1b321c7b4c8e52cd56a24de748d7723</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
we need to modify the source code of our Codesys project directly from C#.&lt;br/&gt;
I've done some search in the Automation Platform documentation, tried all examples but i'm stuck at the Visitor Pattern, I really don't know how to handle this.&lt;/p&gt;
&lt;p&gt;What we want to do is, from C#, we need to add parameter {attribute} before an object in Codesys project that can be of type GVL, POU, Function, Enum, etc.&lt;br/&gt;
In the document &lt;strong&gt;AP_Concepts_LanguageModelManager&lt;/strong&gt;(page 34) there is an example for Visitor Pattern. I'm able to get the CompilationContext, CompiledPou , i've created an instance of "ChangeStatement" (it's Private in the example but i guess it should be Public)  but I don't know how to visit each element.&lt;/p&gt;
&lt;p&gt;Do you have a source code of an actual example modifying Codesys project source code from C# ?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br/&gt;
Dave&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>