I'm interested in the answer for this question as well. I'm trying to create a Program POU in FBD. I want to create instances of the FBs POUs in the PRG with the script.
I know it is possible as the following instruction works when I put language to None. I just seem not able to find the correct parameter to feed the language parameter. It should be a GUID value which I do not know how to generate.
Halim hat geschrieben:
I'm interested in the answer for this question as well. I'm trying to create a Program POU in FBD. I want to create instances of the FBs POUs in the PRG with the script.
I know it is possible as the following instruction works when I put language to None. I just seem not able to find the correct parameter to feed the language parameter. It should be a GUID value which I do not know how to generate.
mypou = app.create_pou(name="autoPRG", type=PouType.Program, language= '???', return_type=None, base_type=None, interfaces=None)
On our Web Help go to Scripting Engine -> IecLanguageObjectContainer and search in the page for "ScriptImplementationLanguage". The properties of that class return the necessary GUID for the different languages but as far as I know we only support to edit ST.
BR
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Martin for the reply. I tried it before posting the question but, it looks indeed that the fbd language is not supported. I will have to do it in ST then.
Maybe another off-topic question regarding the syntax of python. The chm file in the codesys online help folder is for c#. Is there a similar chm for python syntax? or an online place for findin the correct syntax for python scripts?
Thanks in advance for your reply.
BR,
Halim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Halim hat geschrieben:
Maybe another off-topic question regarding the syntax of python. The chm file in the codesys online help folder is for c#. Is there a similar chm for python syntax? or an online place for findin the correct syntax for python scripts?
The C# syntax in the CHM file for the Scripting API is historical because it was the easiest way to get some documentation. You get used to it but we have a new documentation which is based on a manually created python stub.
I know that we can create a declaration and also a program in Text ( ST ). But can we create POU in other languages and add or modify logic in it ?
Hello Codesys Support,
I'm interested in the answer for this question as well. I'm trying to create a Program POU in FBD. I want to create instances of the FBs POUs in the PRG with the script.
I know it is possible as the following instruction works when I put language to None. I just seem not able to find the correct parameter to feed the language parameter. It should be a GUID value which I do not know how to generate.
mypou = app.create_pou(name="autoPRG", type=PouType.Program, language= '???', return_type=None, base_type=None, interfaces=None)
Any advice?
BR,
Halim
Hi Halim.
On our Web Help go to Scripting Engine -> IecLanguageObjectContainer and search in the page for "ScriptImplementationLanguage". The properties of that class return the necessary GUID for the different languages but as far as I know we only support to edit ST.
BR
Martin
Thanks Martin for the reply. I tried it before posting the question but, it looks indeed that the fbd language is not supported. I will have to do it in ST then.
Maybe another off-topic question regarding the syntax of python. The chm file in the codesys online help folder is for c#. Is there a similar chm for python syntax? or an online place for findin the correct syntax for python scripts?
Thanks in advance for your reply.
BR,
Halim
Hi Halim.
The C# syntax in the CHM file for the Scripting API is historical because it was the easiest way to get some documentation. You get used to it but we have a new documentation which is based on a manually created python stub.
You find it on our web help under the topic Scripting Engine
BR
Martin
Thanks again Martin