<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/</id><updated>2020-07-12T20:34:12.745000Z</updated><subtitle>Recent posts to Access and modify variables with external application or script</subtitle><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#87f9" rel="alternate"/><published>2020-07-12T20:34:12.745000Z</published><updated>2020-07-12T20:34:12.745000Z</updated><author><name>JAPIB</name><uri>https://forge.codesys.com/u/japib/</uri></author><id>https://forge.codesys.com542642396f7e5d9a7d0ecda760ecc0f0453a710a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Sorry, I didn't pay attention to the client you were using.&lt;br/&gt;
The CoDeSys V2 OPC server works in OPC DA and the CODESYS V3 OPC server works in OPC UA.&lt;br/&gt;
I'm glad to have helped you. This is the purpose of the forum.&lt;br/&gt;
BR&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#848f" rel="alternate"/><published>2020-07-11T11:03:13.708000Z</published><updated>2020-07-11T11:03:13.708000Z</updated><author><name>desanta</name><uri>https://forge.codesys.com/u/desanta/</uri></author><id>https://forge.codesys.com757feebe2e67b3728aad4a37bbcead162fb8b22f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey, at first I got confused because I didn't know the difference between OPC UA and OPC DA, so obviously my OPC UA client could not find anything running.&lt;/p&gt;
&lt;p&gt;It finally worked with the "MatrikonOPC Explorer" client for OPC DA, the OPC server showed up as "CoDeSys.OPC.02". In the next days I will experiment with some libraries to whip up an application to show and edit values.&lt;/p&gt;
&lt;p&gt;Thanks again for your help so far! I wouldn't have made any progress without your help!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#495f" rel="alternate"/><published>2020-07-04T20:15:50.899000Z</published><updated>2020-07-04T20:15:50.899000Z</updated><author><name>JAPIB</name><uri>https://forge.codesys.com/u/japib/</uri></author><id>https://forge.codesys.comd5e5cf22b158f972ec6babc4d990afbab5b5d067</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
The OPC Configurator is used to configure the OPC server. &lt;br/&gt;
As soon as you save the configuration this starts the OPC server and you can then close the configurator.&lt;br/&gt;
When you want to connect with your OPC client, you should see "CoDeSys OPC02" or "OPC Server for CoDeSys V2.0" which is the server on which to connect.&lt;/p&gt;
&lt;p&gt;Please note, I discovered that the name of your CoDesys project must not contain spaces. &lt;br/&gt;
And when you define this name in the OPC configurator, you only have to put the name, without extension.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#873e" rel="alternate"/><published>2020-07-04T13:42:44.809000Z</published><updated>2020-07-04T13:42:44.809000Z</updated><author><name>desanta</name><uri>https://forge.codesys.com/u/desanta/</uri></author><id>https://forge.codesys.coma6e580a711750322dd14366988456a27b53205b0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey again! Thanks a lot for your help so far! Somehow I had problems with the connection to PLCWinNT so I re-installed everything and now it works! I can load a program into PLCWinNT and start it, furthermore I can watch the variables change in CoDeSys.&lt;/p&gt;
&lt;p&gt;Finally I need to get the OPC connection to work. For now I wanted to use UaExpert to test the connection. Later I would like to use either a Python application with the "opcua" library or some C# application to read and write variables over OPC.&lt;/p&gt;
&lt;p&gt;Do I need to keep the "OPC Configurator" running or is it only needed to set the configuration once?&lt;/p&gt;
&lt;p&gt;I can't seem to find the connection URL for OPC.&lt;br/&gt;
I researched a bit and found some forms of &lt;br/&gt;
"opc.tcp://localhost:4840" or "opcua://localhost:4840" &lt;br/&gt;
but I'm not sure whether the OPC server is even running.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#bd73" rel="alternate"/><published>2020-06-28T00:23:13.769000Z</published><updated>2020-06-28T00:23:13.769000Z</updated><author><name>JAPIB</name><uri>https://forge.codesys.com/u/japib/</uri></author><id>https://forge.codesys.com27244cc4f8de924780f82e924ee867d51b61b08b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;PLCWinNT is a real soft PLC.&lt;br/&gt;
It is fully operationnal, but without licence it runs during two hours. &lt;br/&gt;
To test a program it is fully sufficiant.&lt;/p&gt;
&lt;p&gt;To use it, you need :&lt;/p&gt;
&lt;p&gt;1°) Choose PLCWinNT in Target Setting. (Ressources -&amp;gt; Target Setting)&lt;br/&gt;
2°) Uncheck the simulation option (Online Menu)&lt;br/&gt;
3°) Define Communication parameters (Online Menu)&lt;/p&gt;
&lt;p&gt;&lt;img src="./attachment/attachment.png" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;Address IP is Localhost (Internal IP addresse of your PC) or the real IP address of your PC.&lt;br/&gt;
4°) Start PLCWinNT&lt;br/&gt;
5°) Login (Online Menu), if there is no program on the controller, you can download the new program.&lt;br/&gt;
6°) Start the PLC (Online Menu --&amp;gt; Run)&lt;br/&gt;
7)) You can test your program in the same way you used with simulation mode.&lt;br/&gt;
The difference is, when you logout Soft PLC still running, so when you login &lt;/p&gt;
&lt;p&gt;You have to start OPC Configurator to set and start the CODESYS OPC server running on your PC (installed wiht CoDeSys).&lt;br/&gt;
After you need an OPC Client (for example your own application) to test communication.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#9228" rel="alternate"/><published>2020-06-26T08:42:10.342000Z</published><updated>2020-06-26T08:42:10.342000Z</updated><author><name>desanta</name><uri>https://forge.codesys.com/u/desanta/</uri></author><id>https://forge.codesys.com0ae19c09eaf9e8a845639ef297ad740e377d2def</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey, thanks a lot for your answer and interest!&lt;/p&gt;
&lt;p&gt;If I understand correctly, PLCWinNT is like a virtual PLC running on my machine, right?&lt;br/&gt;
When started, a TPC/IP-address and a RS232-address is displayed.&lt;br/&gt;
Which configuration do I need to change in CoDeSys to be able to use PLCWinNT?&lt;/p&gt;
&lt;p&gt;Finally, how would I be able to communicate with PLCWinNT? You mentioned OPC. In this case, would PLCWinNT provide the OPC server and my own application would be the OPC client?&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#7ee8" rel="alternate"/><published>2020-06-23T21:25:23.666000Z</published><updated>2020-06-23T21:25:23.666000Z</updated><author><name>JAPIB</name><uri>https://forge.codesys.com/u/japib/</uri></author><id>https://forge.codesys.com62eaa6decfecedd9444c7a56d3f852ad3eff14cf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In simulation mode there is not any communication between your CoDeSys application and outer.&lt;br/&gt;
You must use the soft PLC (PLCWinNT, installed on your PC with CoDeSys) ) to communicate with another application. (OPC server, ...) &lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Access and modify variables with external application or script</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/2795d0f25c/?limit=25#e4e4" rel="alternate"/><published>2020-06-20T15:39:40.804000Z</published><updated>2020-06-20T15:39:40.804000Z</updated><author><name>desanta</name><uri>https://forge.codesys.com/u/desanta/</uri></author><id>https://forge.codesys.comb2424a8aa18922ebf21cd3095f8634b7c8790429</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Greetings, I'm currently working with CoDeSys V2.3. During simulation I want to be able to read and write variables with an external application or script (e. g. a Python script). Both CoDeSys and the external application should be running on the same local machine. No external hardware should be involved in the scenario.&lt;/p&gt;
&lt;p&gt;To be more specific, I want to simulate a controller. The user should be able to write a program to set some variables (output), the external application would read those variables and set some other variables (input) in return.&lt;/p&gt;
&lt;p&gt;Example:&lt;br/&gt;
&lt;img src="./attachment/plc_prg.png" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;The program simply increments a counter variable on each cycle, now the variable named "ACTIVE" should be modified by an external application and the result should be shown in CoDeSys. Therefore the counting should start or stop depending on the external application or script.&lt;/p&gt;
&lt;p&gt;I'm not sure whether there is an API or communication protocol available that could allow this scenario.&lt;/p&gt;
&lt;p&gt;Best regards!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>