DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Python vs VBS

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(1,712 Views)
Solution
Accepted by topic author ChrisESchmidt

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.

Walter_Rick_0-1664173440669.png

Greetings

Walter

Message 2 of 3
(1,673 Views)

Hello Walter,

 

Thank you for your detailed response.

 

Thanks

Chris

0 Kudos
Message 3 of 3
(1,660 Views)