DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Many Python code examples in Diadem help are incorrect

I love the fact that Python has been added for automating Diadem. However, I have noticed in transition that, annoyingly, many of the Python code examples in Diadem help are incorrect!

 

I am going to go out on a limb here and say that it seems like NI wrote a VBScript to Python translator for their help examples, and the translator does not work properly.

 

Worse yet, these example Python scripts must not have been validated. If they were reviewed, loaded into a decent IDE, or run through software testing these errors would have been found. Providing incorrect examples to new Diadem and Python users is a recipe for user frustration.

 

Here is one example, there are many others scattered throughout the help:

 

Diadem 2022 Q2 help file, Command: FileNameGet 

 

Selecting several files for any follow-up actions:  (two errors, lines 2 and 3):

dd.FileNameGet("ANY", "FileRead", dd.DataReadPath, "TDM data (*.tdm),*.tdm", "All.lst", True, "Data selection") 
MyFileNames = Split(dd.FileDlgFileName,"|") 
for iCount in range( 0, len(MyFileNames) + 1): 
    dd.DataFileLoad(MyFileNames(iCount)) 

Corrected Python code:

dd.FileNameGet("ANY", "FileRead", dd.DataReadPath, "TDM data (*.tdm),*.tdm", "All.lst", True, "Data selection") 
MyFileNames = dd.FileDlgFileName.split("|") 
for iCount in range(len(MyFileNames)): 
    dd.DataFileLoad(MyFileNames[iCount]) 

 

Please address these issues in your help files.

 

Respectfully,

 

Jim

0 Kudos
Message 1 of 4
(1,555 Views)

Mark,

 

Thanks for your reply. I have already used your website as a reference!

 

Do you know if there is an official path to submitting a bug report?

 

Thanks,

 

Jim

0 Kudos
Message 3 of 4
(1,482 Views)

Hi carowip,

 

Yes, you are right, many of the code snippets in the DIAdem help are not working correct. (The installed example files for Python are OK.) I have informed R&D about that. Their feedback is to fix that, but because of the huge number of code snippets it may take more than one release.

 

Greetings

Walter

0 Kudos
Message 4 of 4
(1,472 Views)