09-20-2022 02:32 PM
Hello,
We currently have some VBS scripts to process data and generate reports using Diadem.
I noticed the latest versions of Diadem allows Python as a scripting language.
Would there be any benefits in switching the code over to Python?
I mainly interested any any performance improvements and debugging advantages.
Thanks
Chris
Solved! Go to Solution.
09-26-2022 01:24 AM
Hello ChrisESchmidt,
Regarding the performance when automating DIAdem with VBS or Python, no significant differences are to be expected. The advantage with Python is the large community, and the many modules that can be used additionally.
For both VBS and Python, external debugging is supported and is recommended.
As far as performance is concerned, existing DIAdem commands should be used whenever possible, because they are always faster than the same functionality in VBS or Python. Example: if two channels are to be added, you can define this yourself in a loop. But much faster is the corresponding DIAdem command.
Also very advantageous when using the Script API's is the use of variables instead of the fully qualified expression. Example:
Slow:
Data.Root.ChannelGroups("MyGroup").Channels("MyChannel").Values(1) = 123
More performant is
Set oChn = Data.Root.ChannelGroups("MyGroup").Channels("MyChannel")
oChn(1) = 123
An advantage with VBS is the function "Script Profiler" which does not exist for Python.
The script profiler is an analysis tool with which you detect time-consuming commands and statements and which helps you optimize your script.
Greetings
Walter
09-26-2022 07:15 AM
Hello Walter,
Thank you for your detailed response.
Thanks
Chris