10-29-2013 10:03 AM
I have seen multiple posts on how to concatenate channels and tdms files external of Diadem. Here is my problem I would appriciate any help/comments.
I have 5 groups that have been seperated by a script for me for other purposes and I would like to merge them all into one group (MasterDealer). These 5 groups have all the same channel names but different lengths to them. I would also like to keep the original 5 groups and they are always the last 5 groups in the dataportal.
10-29-2013 11:27 AM
Hello J,
you should also attach the TDX file, there are stored the real data...
As long as the groups have the same channels (same names and number) and the length is constant for all channels in one group, the example "ChnConcatenation_Main.VBS" could help. It sticks the channels with the same name together and create by this a new group wich concatenated channels. What you need then is to move this group to the first place...
10-29-2013 11:51 AM
Isn't the installed "Concatenate Channels" example what you are looking for.
10-29-2013 12:04 PM
The Channel Lengths are not the same between the groups and I only want Groups 8 - 12 Concatenated. What you mentioned to me, I tried and it will take the wrong groups and concatenates them.
10-30-2013 01:26 AM
If you are little familiar with VBS you can adjust the example to your needs.
It contains a worker class: ChnConcatenation_Libr.vbs
The method
cChnConcatenate.RunConcatenation
contains the method that extracts the channels to be concatenated:
54: set oSChns = Data.GetChannels("*/" & oChnGroupElem.Name)
In the following code the channels in oSChns are concatenated based on different rules.
If you have no special needs you could just write a script using
Call ChnConcat("Group/SourceChannel","Group/TargetChannel")
that will do the job.
10-30-2013 10:09 AM
Hi J,
The ChnConcatenate() command is definitely what you want to concatenate channels of differing lengths (but the same data type). If you don't want to write or edit the VBScript yourself, you could use this one that I created a long time ago. You can change the "StartGroup" variable/parameter to the index of the first of your last 5 groups, or you can select those 5 groups and run "Concat Groups (Sel).VBS" with no changes. Both VBScript files must be in the same folder.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-01-2013 02:20 PM
I believe you are correct Brad, this is what I am looking for. I am not that familiar with VB scripting to make the changes needed, however I do not want to have to select the last five groups manually as this will be all running for me Automatically on a machine to process the information.
The groups i want to Concatenate will be index 8-12(happens to be the last one. Below is the dataset I am working with.
11-04-2013 10:06 AM
Hi J,
In that case you just need to edit the "Sel" script to ignore the Data Portal selection and instead just concatenate all groups starting with group index 8, like this:
StartGroup = 8 ConcatGroupIdxs = ConcatAllGroups(Xchannel, X_Overlap, ShortChans, NoValueRow, AddDateTime, GroupDelete, X_Relative, StartGroup)
Brad Turpin
DIAdem Product Support Egnineer
National Instruments
11-04-2013 10:47 AM
Ok, I changed the script and it runs correct when the value for the "GroupDelete" is set to "True". If I change that to keep my original data then I get a property error message.
GroupDelete = FALSE ' Whether to delete the original data Groups after concatenation
Error in <Concatenate Groups.VBS> (Line: 471, Column: 13):
Error message from the DIAdem command kernel :
Cannot write the property value.
Command: "ChnPropSet(354,"implicit_start","10890")"
Error number: -212
12-06-2013 08:16 AM
Brad,
I am still struggling with gettting this to concat right. Could you have a look? I posted the current data set.
I want to concat group 8 - 12 into a New Group 13 named TopFiveDealers and keep the original data as is. Can that be done with the scripts you gave, I can get it to work right. I either get a Type Mismatch error or
Error in <Concatenate Groups.VBS> (Line: 211, Column: 13):
Incorrect instruction or user command.
In <DataFileHeaderAccess.VBC> (line: 1328, column: 5):
A global error has occurred.