SashaSasha hat geschrieben:
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 hat geschrieben:
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 which contains methods to open dialogs.
Here some example 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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I have some question about python for CodeSys:
How can I read all structure without knowledge of fields inside this structure using python?
Does CodeSys has some alternatives for tkFileDialog library? How can I create some dialog boxes for opening/clothing files?
Hi SashaSasha.
What do you mean with "read all structure..."? Read the online value through Monitoring or finding and reading the DUT objects?
Look in the Scripting API documenation for the interface/class which contains methods to open dialogs.
Here some example 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