DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get a plugin script to set the Root.Name to a value

I am experimenting with trying to build a data plugin. One of the things I discovered doesn't work is when I try to set the name of the Root to a string of my choice, like

 

Root.Name = "My Data"

 

Instead, it seems DIAdem always sets the name of the root to the name of the log file instead.

 

I tried turning on the script recorder and doing the change manually, and it recorded the code line Data.Root.Name = "My Data" but if I try to use that line of code in my plugin DIAdem reports a scripting error and says it cannot find 'Data'.

 

What I am doing wrong?

0 Kudos
Message 1 of 5
(3,958 Views)

I assume you are right. DIAdem replaces the the root property name by the filename on loading the file.

So it would be better to assign your info to another property.

 

Root.Properties.Add "myName", "My Data"

 This is only true for the root property name.

0 Kudos
Message 2 of 5
(3,949 Views)

Regarding your scripting error, you mixed up DIAdem objects with the VBS DataPlugin API.

The Data object you refer to in "Data.Root.Name" is DIAdem specific and cannot be used in DataPlugin code. This is because DataPlugins are generic and can also be used in other National Instruments software products like LabVIEW.

 

Switching the syntax in DIAdem Script (File->Change Syntax) to "VBS DataPlugin" should help to write DataPlugin scripts. E.g. "Data.Root.Name" should not be recognized by DIAdems Syntax Highlighting.

0 Kudos
Message 3 of 5
(3,922 Views)

Hi All,

 

Nevertheless, as of DIAdem 2011, the Root.Name property assignment still has no affect.  You can accomplish something similar with a custom load event, but my guess is that it isn't that important.

 

The DataPlugin API simply doesn't rename the Root,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 5
(3,906 Views)

OK - thanks for the information. You are correct - it is not all that important, just a nice to have as the root name becomes confusing when multiple files are loaded.

0 Kudos
Message 5 of 5
(3,904 Views)