06-08-2021 10:14 AM
Hi,
I am working on a procedure that only load only some channels (to save time, I'm given acqusitions with hundred of channels).
In DIAdem doc, DataFileLoadSel is usually called with an index, but I want it to be like:
dd.DataFileLoadSel(datFileFull, 'MDF3', '*/XTEMP', 'LoadImmediately|ChnXYRelation')
dd.DataFileLoadSel(datFileFull, 'MDF3', '*/XFLOW', 'LoadImmediately|ChnXYRelation')
It works. Unfortunately, that code also loads XFLOW1 and XFLOW2 (it seems all channels whose names start with XFLOW are loaded).
XTEMP is ok because I don't have any variables called XTEMP1, XTEMP2, etc.
Although it looks a harmless behaviour, for some reasons I have to check the imported variables names, and having that extra channel gives me a hard time. I'm able to bypass the problem with some nasty tricks, but my code would be much cleaner if I could get rid of unwanted channels. Do you know if there is a way to do it?
06-17-2021 07:33 AM
Use the 'or' pipe | character between multiple channels to load. Unfortunately you cannot use the "*" character for the channel group.
DataFileLoadSel(sDataFilePath, sDataPlugin,"[1]/Time | EXAMPLE/Torque")
DataFileLoadSel(sDataFilePath, sDataPlugin,"[1]/*| EXAMPLE/*")
I wrote function oLoadNavDataFileByChnNames() to solve the problem of loading specific channels using DataFileLoadSel() by name rather than index. See http://www.savvydiademsolutions.com/navigator.php?topic=Load-specific-channels-from-DataFinder-DataS...
06-17-2021 12:31 PM
Thank you for your reply, I appreciate.
At the end of the day, I've decided to upload the extra channels and manage them the way I'd manipulate the "right" channels.
It slows down my code, but we are talking about fractions of a second..
The "|" operator and is nice, and I often use it. But this time I found it more convenient to load the channel separately (I didn't put the whole code in my previous post, but I have a list of variables and a for cycles that load once at a time).