09-18-2025 11:35 AM
Adding multiple groups to an existing TDMS file using VBS causes DIAdem to crash while debugging script. Running script without debugging is fine.
Launch DIAdem
Load EXAMPLE.tdms file
Run below script using debug mode.
DIAdem Crashes
Call Data.Root.ChannelGroups.Add("Channel_group1", 1).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group2", 2).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group3", 3).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group4", 4).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group5", 5).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group6", 6).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group7", 7).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group8", 8).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group9", 9).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group10", 10).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group11", 11).Activate()
Call Data.Root.ChannelGroups.Add("Channel_grou5", 12).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group6", 13).Activate()
Call Data.Root.ChannelGroups.Add("Channel_group7", 14).Activate()
Has anyone else seen this issue and if so is there a work around?
12-15-2025 09:32 AM - edited 12-15-2025 09:33 AM
Hi Siriusly,
Long time no chat (was it Joe G.?). What version of DIAdem do you see this in? I just ran your 14 lines of code in my DIAdem 2025 Q2 version, both without debugging and with debugging, and I got no errors. I didn't have any break points set or anything, so help me match your situation if you done anything like that.
Update, I re-read your post and loaded Example.tdms into an empty Data Portal, then ran your 14 lines of code with debugging enabled, and my DIAdem did crash. I still want to know what version you're running, but I definitely see what you mean.
There really isn't a reason to Activate each group you add, one after the other, right? I'll bet it makes no difference in your error, but you might as well only activate the one you really want to be the Default Group at the end of your script.
I stripped off the Activate and also ditched the group index, and now the 14 lines don't seem to crash anymore.
Call Data.Root.ChannelGroups.Add("Channel_group1")
Call Data.Root.ChannelGroups.Add("Channel_group2")
Call Data.Root.ChannelGroups.Add("Channel_group3")
Call Data.Root.ChannelGroups.Add("Channel_group4")
Call Data.Root.ChannelGroups.Add("Channel_group5")
Call Data.Root.ChannelGroups.Add("Channel_group6")
Call Data.Root.ChannelGroups.Add("Channel_group7")
Call Data.Root.ChannelGroups.Add("Channel_group8")
Call Data.Root.ChannelGroups.Add("Channel_group9")
Call Data.Root.ChannelGroups.Add("Channel_group10")
Call Data.Root.ChannelGroups.Add("Channel_group11")
Call Data.Root.ChannelGroups.Add("Channel_grou5")
Call Data.Root.ChannelGroups.Add("Channel_group6")
Call Data.Root.ChannelGroups.Add("Channel_group7")
Do you really need to supply a group index in these commands? It looks like you're just adding the groups one after the other to the end of the Data Portal, in which case you can drop that parameter.
If you're really just setting up the Data Portal to export to file, then you don't actually care which group is the Default group, right?
Is this an acceptable workaround?
Brad Turpin
Principal Technical Support Engineer
NI / Emerson