CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sun Dec 17, 2017 1:10 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Oct 06, 2017 8:49 am 
Offline

Joined: Fri Oct 06, 2017 8:32 am
Posts: 1
Hi all,

I have some question about python for CodeSys:

1. How can I read all structure without knowledge of fields inside this structure using python?

2. Does CodeSys has some alternatives for tkFileDialog library? How can I create some dialog boxes for opening/clothing files?


Top
   
PostPosted: Mon Oct 09, 2017 3:08 pm 
Offline
Frequent User
Frequent User

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

SashaSasha wrote:
1. How can I read all structure without knowledge of fields inside this structure using python?

What do you mean with "read all structure..."? Read the online value through Monitoring or finding and reading the DUT objects?

SashaSasha wrote:
2. Does CodeSys has some alternatives for tkFileDialog library? How can I create some dialog boxes for opening/clothing files?

Look in the Scripting API documenation for the interface/class IScriptUI which contains methods to open dialogs.

Here some example code:
Code:
print("Now, the user can select files and directories")
res = system.ui.open_file_dialog("Choose multiple files:", filter="Text files (*.txt)|*.txt|Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*", filter_index = 0, multiselect=True)
print("The user did choose: '%s'" % str(res)) # res is a tuple as multiselect is true.

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  [ 2 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