02-09-2015 08:59 AM
Dear,
My problem is simple. I my code I use DataFileLoadSel(..,...,..., "register") to load selectively channels from tdms file. However, from one file to another the channel I want to load amy exist or not. How can I check this. In fact, if the channel does not exist then it generates an error message and my program ends.
Thank you for your help,
Best regards,
Louval
02-10-2015 08:13 AM
Hi Louval,
If you want to load the channel if it exists each time, then I'd just put error handling around that call. There are other options, but they're more complicated.
On Error Resume Next Call DataFileLoadSel(DataFilePath, ...) ErrNum = Err.Number On Error Goto 0 IF ErrNum = 0 THEN ' Success ELSE ' failure END IF ' selected channel loaded
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-12-2015 04:34 AM
Hi Brad,
All I needed, as usual. This is great thank you so much.
Cheers,
Louval
02-18-2015 07:39 AM
Hi Louval,
you can also check the Dataportal for existing channels, if you know the groupname or index of the group:
data.Root.ChannelGroups(Gruppenindex als Zahl).Channels.Exists("Name")
Kind Regards,
Philipp
AE | NI Germany