Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
[WARNING]    Python2printstatementfound.ForPython3compatibility,use'from __future__ import print_function'andtheprint()functioninstead.inScript'C:\Users\and-work\Desktop\1.py',Line'5'Column'1'[INFORMATION]  1.py(1):Beginscript[INFORMATION]  1.py(1):proj=projects.primary[INFORMATION]  1.py(3):found=proj.find("Application",True)[INFORMATION]  1.py(4):app=found[0][INFORMATION]  1.py(5):printapp        ScriptObject{NoDeviceObject,NoExplicitConnectorObject,NoLibManObject,LibManObjectContainer,ScriptNoProjectInfoMarker,ScriptApplication,NoScriptApplicationComposerObject}(Project=0,Name=Application,guid=5a9278fe-989c-4674-9101-b9726dbde107)[INFORMATION]  1.py(6):printdir(app)        ['__class__','__delattr__','__doc__','__format__','__getattribute__','__hash__','__init__','__new__','__reduce__','__reduce_ex__','__repr__','__setattr__','__sizeof__','__str__','__subclasshook__'][INFORMATION]  1.py(9):mypou=app.create_pou("MyPou")[INFORMATION]  1.py(9):exception(<type'exceptions.AttributeError'>,AttributeError("'ScriptObject' object has no attribute 'create_pou'",),<tracebackobjectat0x000000000000002B>)[INFORMATION]  1.py(9):mypou=app.create_pou("MyPou")[INFORMATION]  1.py(9):exception(<type'exceptions.AttributeError'>,AttributeError("'ScriptObject' object has no attribute 'create_pou'",),<tracebackobjectat0x000000000000002C>)[INFORMATION]  1.py(9):mypou=app.create_pou("MyPou")[INFORMATION]  1.py(9):returnfromscript[INFORMATION]  1.py(9):mypou=app.create_pou("MyPou")
Looks like there is no create_pou method in application object.
Could anybody help me with this issue?
Regards,
Victor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I'm trying to create POU using python script in Codesys 3.5 SP5:
But I get the following error:
Looks like there is no create_pou method in application object.
Could anybody help me with this issue?
Regards,
Victor