Quantcast
Channel: DIAdem topics
Viewing all articles
Browse latest Browse all 3213

Load Data selectively in an ANP (Analysis Automation Procedure)

$
0
0

Hi,

 

When I want to load some channels from file in a DIAdem script, I am used to writing:

dd.DataFileLoadSel(MyFile, "TDM", "*/MyChan1 | */XX | */t10", "LoadImmediately|ChnXYRelation")

It works great, only the selected channels (MyChan1, XX, and t10 in the example above) are loaded, and it saves me a lot of time (less than a second vs 1 minute), since I'm often dealing with files with hundred of channels, most of which are not necessary for the tests I want to perform.

 

Now I want to automatise it through SystemLink; I've created a Data Index, and my acquisitions are stored there.

Of course I can load the acquisitions as follows:

def On_Run_AnalysisProcedure(oContext): dd = DIAdem.Application dd.ApplicationSetLocale("english") # Please enter your code sequences here. # -------------------------------------- for link in oContext.DataLinks: elements = dd.Navigator.LoadData(link) oContext.LogWarning("Loaded elements: "+str(elements.Count))

 

Unfortunately, I haven't found a way to selectively load channels. I saw a procedure called dd.Navigator.LoadChannelsByName that was promising, but I'm not able to make it work.

 

Is there a way to selectively load channels from a Data Index structure? If not, any workaround?

 

Remarks. I'm working with DIAdem 2020SP1 and use Python scripts, but I can also go with VBA if requested.


Viewing all articles
Browse latest Browse all 3213

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>