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 Wed Apr 24, 2019 3:00 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Sep 14, 2015 4:19 pm 
Offline

Joined: Fri Aug 14, 2015 12:43 pm
Posts: 3
Is it possible to determine the of objects in the project tree while iterating over them?
I need to distinguish between POUs and Visualization objects for example.

Code:
    
for child in folderobject.get_children():
        if child.is_folder:
            print ('Found folder: {}'.format(child.get_name()))
            export_folder(child)
        else:
            print(child.type)


child.type() will only return these guid, but from my current understanding i have no way tell what kind of object that is?

Thanks in advance
Florian


Top
   
PostPosted: Mon Sep 14, 2015 5:32 pm 
Offline
Frequent User
Frequent User

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

What's the use case behind your question?

Some objects, which are supported by the ScriptEngine, have a special property. For example, the device object has the property "is_device".

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: Tue Sep 15, 2015 8:12 am 
Offline

Joined: Fri Aug 14, 2015 12:43 pm
Posts: 3
Yes so i saw the functions for testing for folder and devices.
The use case is exporting of the project, but on a per-file basis.
I basically need to have one POU/Visualisation in one exported file.

This is also why i am not using the recursive export on the project, because it will stop exporting when encountering a subfolder of project. I have this working already for everything code related by using PLCOpenXML-files.
Visualisations do not export to PLCOpenXML though at all as it seems?
So the idea is to export them seperately in native format.


Top
   
PostPosted: Tue Sep 15, 2015 9:27 am 
Offline
Frequent User
Frequent User

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

FloWil wrote:
I basically need to have one POU/Visualisation in one exported file.

For POUs you could check the object for the property "has_textual_declaration" because all POU objects have an textual declaration.

FloWil wrote:
Visualisations do not export to PLCOpenXML though at all as it seems?

I think it is not part of the PLCopenXML specification.

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: Wed Apr 10, 2019 10:47 am 
Offline

Joined: Thu Sep 21, 2017 3:13 pm
Posts: 4
Hi Martin,

M.Keller wrote:
For POUs you could check the object for the property "has_textual_declaration" because all POU objects have an textual declaration.

BR
Martin


Is there a property than can be checked for Visualizations?

Regards,
Daniel


Top
   
PostPosted: Thu Apr 11, 2019 7:36 am 
Offline
Frequent User
Frequent User

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

dbarral wrote:
Is there a property than can be checked for Visualizations?

Sorry, but no.

We have Scripting API for Text List and Image Pool but not for the Visual objects.

BR
Martin

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

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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 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