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

Create a function block in a specific folder

2019-04-10
2019-04-12
  • Victor Kulikov - 2019-04-10

    Dear forum experts!

    How can I create a function block in a specific folder?

    Not working example:

    proj = project.primary
    found = proj.find("Application", true)
    app = found[0]
    myfolder = app.create_folder("Myfolder")
    myfolder.create_pou("mypou")
    

    Regards, Victor

     
  • mkeller - 2019-04-11

    Hi.

    Your code had one syntax error and two Scripting error.

    Here is a working example:

    proj = projects.primary
    found = proj.find("Application", True)
    app = found[0]
    app.create_folder("Myfolder")
    found = app.find("Myfolder")
    myfolder = found[0]
    myfolder.create_pou("mypou")
    

    BR
    Martin

     
  • Victor Kulikov - 2019-04-12

    Hi, Martin!

    Many thanks for your help!

    Regards,
    Victor

     

Log in to post a comment.