<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/</id><updated>2020-02-27T14:45:35.497000Z</updated><subtitle>Recent posts to Co-Programming or Co-processing with python or C</subtitle><entry><title>Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/?limit=25#c366" rel="alternate"/><published>2020-02-27T14:45:35.497000Z</published><updated>2020-02-27T14:45:35.497000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comc342c2a8b73c2916a25e3ff9a857d1a95b65ae9c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; M.Schaber&lt;/p&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;haoming hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
For These, I'd like to ask, the codesys do has a main Task, how does python work in the LOOP. Can it work in the main Task, so that one can Change the variables in real time? Or it can work in multi-thread. Are there any systematic Tutorien in the Forum or Webinar?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Just an additional note to make it clear:&lt;/p&gt;
&lt;p&gt;The python scripts are running in the CODESYS IDE, not on the PLC. They use the monitoring mechanism to read and write variables.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/?limit=25#f614" rel="alternate"/><published>2020-02-27T14:45:33.912000Z</published><updated>2020-02-27T14:45:33.912000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.comadb34c27bf834673b32be836178b31324f455d76</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi FWosniak.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;FWosniak hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Good evening, I am trying to execute a python script but I keep getting "'LightException' object has no attribute 'GPIO'" error message. Am I missing some kind of configuration or something?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Can you show me your code or at least which the line of code which causes the exception?&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/?limit=25#6281" rel="alternate"/><published>2020-02-27T14:45:33.310000Z</published><updated>2020-02-27T14:45:33.310000Z</updated><author><name>FWosniak</name><uri>https://forge.codesys.com/u/fwosniak/</uri></author><id>https://forge.codesys.com5cf9c7795b746f2c0191b5f09430cf04f167d352</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Good evening, I am trying to execute a python script but I keep getting "'LightException' object has no attribute 'GPIO'" error message. Am I missing some kind of configuration or something?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/?limit=25#1c74" rel="alternate"/><published>2020-02-27T14:45:32.544000Z</published><updated>2020-02-27T14:45:32.544000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com4685f319aff207b3bff5c2cd0828850e6890ae39</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Haoming.&lt;/p&gt;
&lt;p&gt;We have some examples in the CODESYS Online Help. Search for "Executing Scripts".&lt;/p&gt;
&lt;p&gt;The Scripting API is documented in the ScriptEngine.chm in the sub directory OnlineHelp of the CODESYS installation. Search for "Tips for Python Programmers regarding .NET API Documentation" to find some help how to read the Scripting API documentation.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;haoming hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
For These, I'd like to ask, the codesys do has a main Task, how does python work in the LOOP. Can it work in the main Task, so that one can Change the variables in real time? Or it can work in multi-thread. Are there any systematic Tutorien in the Forum or Webinar?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The scripts are executed in the main thread of CODESYS. The methods, which require the message loop to be processed, take care of that themselves.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/?limit=25#f584" rel="alternate"/><published>2020-02-27T14:45:30.832000Z</published><updated>2020-02-27T14:45:30.832000Z</updated><author><name>haoming</name><uri>https://forge.codesys.com/u/haoming/</uri></author><id>https://forge.codesys.com21fe76bab24c4779818897b22067046a521930bb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hallo Martin,&lt;/p&gt;
&lt;p&gt;I am writing the PLC now, and I've just found that there is no way to use the dynamic Array such as which in C++ STL according to DIN 61131-3, for the question how to use the C Code in PLC I've found a Webinar on your Website, and about the python I do have no idea, how does python work with codesys, as I see, there are couple use of Python which were be postet by Markus in the Forum, they may be:&lt;br/&gt;
1. starting the Project in Codesys&lt;br/&gt;
2. creating a Project in Codesys&lt;br/&gt;
3. test and Export the .XML data using python from codesys&lt;/p&gt;
&lt;p&gt;For These, I'd like to ask, the codesys do has a main Task, how does python work in the LOOP. Can it work in the main Task, so that one can Change the variables in real time? Or it can work in multi-thread. Are there any systematic Tutorien in the Forum or Webinar?&lt;/p&gt;
&lt;p&gt;I am so sorry for These silly queastions. And thank you a lot.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/?limit=25#5856" rel="alternate"/><published>2020-02-27T14:45:30.224000Z</published><updated>2020-02-27T14:45:30.224000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.come98b05b0df5037019a1db8348306d4dd04c72321</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Haoming.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;haoming hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I am fresh man hier with SPS, and I just Need to use the dynamic date type such as "Array" in C to get a Analysis of a System structure in real time in order to calculate the Safety intergrity in Codesys.&lt;br/&gt;
Can you please tell me, how can I use the python script or C Modul in Codesys, so that a cooperation between the codesys and the script can be organised.  I've no idea how works the scriping language and the c Modul with the SPS-Tasks. It is so Kind of you, if you can Show some examples for me.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I'm a bit confused. Do you want to test the IDE or the runtime of CODESYS? Or do you want to test your PLC application on the runtime?&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Co-Programming or Co-processing with python or C</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d3bbcd7e0/?limit=25#36b0" rel="alternate"/><published>2020-02-27T14:45:29.565000Z</published><updated>2020-02-27T14:45:29.565000Z</updated><author><name>haoming</name><uri>https://forge.codesys.com/u/haoming/</uri></author><id>https://forge.codesys.com3f84e961aadcdd3be12e7f7cbd4d7d47de292255</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am fresh man hier with SPS, and I just Need to use the dynamic date type such as "Array" in C to get a Analysis of a System structure in real time in order to calculate the Safety intergrity in Codesys.&lt;/p&gt;
&lt;p&gt;Can you please tell me, how can I use the python script or C Modul in Codesys, so that a cooperation between the codesys and the script can be organised.  I've no idea how works the scriping language and the c Modul with the SPS-Tasks. It is so Kind of you, if you can Show some examples for me.&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;/p&gt;
&lt;p&gt;Beste regards.&lt;/p&gt;
&lt;p&gt;Haoming&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>