02-14-2013 06:21 AM
If I run the following two commands:
Dim oMyList : Set oMyList = Data.CreateElementList Call oMyList.Add(DataFileLoad("C:\Program Files (x86)\National Instruments\DIAdem 2012\Examples\Data\Example_data.TDM", "TDM", "Load"))
with the Run Script button I get that error message:
"The DataElement argument of the Add method must be Element<Data>."
Running it as Debug/Continue Script, it works perfectly.
Why?
02-14-2013 08:10 AM
The helps says, that Add only acceps a single elment.
Dim oMyList : Set oMyList = Data.CreateElementList dim elems : set elems = DataFileLoad("C:\Program Files (x86)\National Instruments\DIAdem 2012\Examples\Data\Example_data.TDM", "TDM", "Load") dim elem : for each elem in elems Call oMyList.Add(elem) next
should work. On my machine DIAdem 2012 your code fails in each mode.
02-14-2013 08:48 AM
Strange that the code fails on your machine but not on mine.
Nevertheless I meanwhile applied the same solution you suggested, athough in my specific case it is only a single ChannelGroup that is being loaded into the DataPortal each time. As the ReturnValue of DataFileLoad then contains only one element of type ChannelGroup, I supposed that the Add method works directly, but it doesn't.