From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial evaluation

Hello,

i have some problems to find a appropriate solution approach for serial evaluation.

I'm executing an advanced query to find spezific data files (all same type,properties, groups(names) and channels(names))

Then i'd run my analysis script and create report,

By now this works fine but only for one data file (I only load one (first) result in dataportal)

How can i manage same analysis and report for all my found data files (->serial evaluation)?

 

I see problems because the groupnames/channelnames are equal in each file,

Clearing dataportal after each file evaluation would "destroy" my report, because channels (also original data cahnnels) are shown in report

 

Thanks for any assistance

 

0 Kudos
Message 1 of 10
(6,244 Views)

Hi Andi,

 

If your data files contain exactly one Group each, which is common, then you should just be able to loop over all the files selected in your Search Results and load and graph each one as a {Group, REPORT sheet} pair.  Which part of this is giving you trouble?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 10
(6,230 Views)

Hello,

first I load all files i'd like to analyse in dataportal

my data files contain at least 10 groups (each with 2 channels), which are all common in each file.

I'm doing some mathematical operations, using the channelnames (equal in each file) for commands.

I also use the channelnames for creating my report via script

So, problem is to "tell" my script that i should use channelXY from data file 1,2,3,... and so on

0 Kudos
Message 3 of 10
(6,227 Views)

Hi Andi,

 

Have you used the Data.GetChannels() method before?  If the channel name by itself is unique within each file, that should give you exactly what you want.  If you need the group name as well as the channel name to uniquely specify a particular XY channel pair from all the files, then we'll have to think some more.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 10
(6,222 Views)

Hello Brad,

that's the point.Getting the right channel(name) is not the problme. But getting the channel of the right file/group i have loaded in dataportal is the crux of the matter.

For understanding: i load e.g. 5 files in dataportal (all equal, same groups(names), channel(names), but other values of course)

and i 'd like to evaluate(with report) them serial (file1,2,3,etc..)

 

What i need is kinda something that tells my script: now everything belongs to file 1 i have loaded, after evaluation now everything belongs to file 2 and so on

 

Thanks

0 Kudos
Message 5 of 10
(6,204 Views)

Hi Andi,

 

The Group names will actually not be the same once loaded into the Data Portal, they will sprout suffix indices in all but the Groups from the first file loaded.  Is it an option to have your script automate the loading of each file?  That would be the easiest way to store which Groups came from which file.  Alternatively, there are a couple of Channel properties DIAdem adds to mark what file and with which DataPlugin that Channel was loaded.

 

OrigFileName = Channel.Properties("sourcedatafilename").Value
OrigFileFold = Channel.Properties("sourcedatafilepath").Value
DataPlugin   = Channel.Properties("sourcetype").Value
OrigGroupName= Channel.Properties("sourceparentname").Value
OrigChannelName = Channel.Properties("sourceoriginalname").Value

If you choose the above Channel property approach, I'd recommend using a Dictionary object.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

 

0 Kudos
Message 6 of 10
(6,191 Views)

Hello Brad,

yes it is an option to have my script automate the loading of each file, actually i'm doing so. How would be the further proceed  then?

0 Kudos
Message 7 of 10
(6,187 Views)

Hi Andi,

 

Let's say you load X number of files that each have N Groups in them.  Each time you load N groups from a new file, you can store the reference for each Group in that file to N different arrays or collections.  At the end of loading all the data, you will have N arrays or collections that have X Group references in them.  So now you know exactly which Groups belong to which file, and you can loop over them at will.

 

What part of the remainder is difficult for you?

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 8 of 10
(6,168 Views)

Hello Brad,

thanks for your reply. Can you give me an example-code of what you described above please?! This sounds good for me (theoretically), but i'm not quite sure on the programming about that.

Thanks

0 Kudos
Message 9 of 10
(6,165 Views)

Hi Andi,

 

Here's the collection approach, which I prefer.

DataPlugin = "TDM"
ReDim DataFilePaths(4)
DataFilePaths(1) = "C:\Users\Public\Documents\National Instruments\DIAdem 2012\Data\TR_M17_QT_32-1.TDM"
DataFilePaths(2) = "C:\Users\Public\Documents\National Instruments\DIAdem 2012\Data\TR_M17_QT_32-2.TDM"
DataFilePaths(3) = "C:\Users\Public\Documents\National Instruments\DIAdem 2012\Data\TR_M17_QT_32-3.TDM"
DataFilePaths(4) = "C:\Users\Public\Documents\National Instruments\DIAdem 2012\Data\TR_M17_QT_32-4.TDM"
iMax = UBound(DataFilePaths)
ReDim GroupCollections(iMax)
Call Data.Root.Clear
Call Data.Root.ChannelGroups.Add("DeleteMe")
FOR i = 1 TO iMax
  Set GroupCollections(i) = DataFileLoad(DataFilePaths(i), DataPlugin)
NEXT ' i
Call Data.Root.ChannelGroups.Remove(1)
i = 1
Set FileGroups = GroupCollections(i)
MsgBox DataFilePaths(i) & vbCRLF & FileGroups.Count & vbCRLF & FileGroups(1).Name & vbCRLF & FileGroups(2).Name

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 10 of 10
(6,159 Views)