CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Jul 21, 2019 1:03 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Apr 10, 2019 12:18 pm 
Offline

Joined: Thu Nov 01, 2018 12:32 pm
Posts: 8
Dear forum experts!

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

Not working example:

Code:

proj = project.primary

found = proj.find("Application", true)

app = found[0]

myfolder = app.create_folder("Myfolder")

myfolder.create_pou("mypou")



Regards, Victor


Top
   
PostPosted: Thu Apr 11, 2019 9:05 am 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 244
Hi.

Your code had one syntax error and two Scripting error.

Here is a working example:
Code:
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

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Fri Apr 12, 2019 9:35 am 
Offline

Joined: Thu Nov 01, 2018 12:32 pm
Posts: 8
Hi, Martin!

Many thanks for your help!

Regards,
Victor


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited