06-23-2011 12:50 PM
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?
06-24-2011 07:17 AM
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.
06-27-2011 03:35 AM
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.
06-27-2011 10:37 AM
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
06-27-2011 10:42 AM
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.