08-13-2019 08:13 AM
I am writing a script which will take one data channel which has a repeating test sequence of 90 cycles. I'd like to separate the data into 90 separate channels, one for each test cycle.
I've created the new channels and copied the data, but when the data is copied into the new channel it overwrites the channel's name with the original channel name +1.
Is there a way of just copying the data, not the name as well?
Thanks
dim i, j, n
i=1
j=900
n=001
Call DataBlClpCopy("[1]/P3_CL 1 PRESSURE [Bar]",i,j)
Call Data.Root.ChannelGroups(1).Channels.Add("Clutch 1 -" &" " & n,DataTypeFloat64,30)
Call DataBlClpPaste("[1]/Clutch 1 -" &" " & n,1,j)
Solved! Go to Solution.
08-13-2019 10:25 AM - edited 08-13-2019 10:26 AM
dim i, j, n i=1 j=900 n=001 Dim newChnl, newChnlName newChnlName = "Clutch 1 -" &" " & n Call DataBlClpCopy("[1]/travel",i,j) Set newChnl = Data.Root.ChannelGroups(1).Channels.Add(newChnlName,DataTypeFloat64, 30) Call DataBlClpPaste("[1]/Clutch 1 -" &" " & n,1,j) newChnl.Name = newChnlName
Make sure your destination index (where you have "30") is good. I never use this parameter.
08-14-2019 03:53 AM
Thanks, that worked perfectly!
08-21-2019 06:25 PM
See the link below for examples of the DataBlCopy() command.
http://www.savvydiademsolutions.com/analysis.php?topic=NI-DIAdem-channel-data-manipulation-commands