10-18-2012 01:08 PM
I have several channels that I would like to remove a fixed number of data points from the start of the channel, basically some data that is recorded during an initialization phase that I don't want included in the data. Is there an easy way to do this?
Solved! Go to Solution.
10-18-2012 04:38 PM
Hello Jordan,
There is a command that allows you to delete values from multiple channels called DataBlDel
Deletes a data block in channels.
Call DataBlDel(ChnNoStr, ChnRow, ValNo, [ValDelOnly])
ChnNoStr | Specifies one or more channels.
A channel list is a Channel or Channel list object, or a text that refers to one or several channels. |
||
ChnRow | Specifies the row number in a channel.
|
||
ValNo | Specifies the number of values in a channel.
|
||
[ValDelOnly] | Specifies whether DIAdem deletes only the channel values or also all properties when deleting all values. The default value is FALSE which specifies that DIAdem also deletes the properties. |
Examples are:
Call DataBlDel("'[1]/Noise_1' - '[1]/Noise_4'",1,7,1)
or
Call DataBlDel("1-4", 1, 7)
In both examples, seven lines of data are deleted from the first four channels in the Data Portal.
I hope that helps,
Otmar
10-23-2012 06:42 AM
Similar problem, but on several channel groups:
I try to use DataBlCopy (and other data block operations) to run over different channel groups. However, getting the channel strings right is cumbersome. I try with
sChStrSource = "(CH([" & cstr(i) & "]/[" & "cstr(j) & "-CH""" & cstr(i) &"/[ etcetcetc
to get the desired channels j from each group i into a string like
CH(" '[1]/[2]' - '[1]/[5]' ")
to pass it to
Call DataBlCopy(sChstr, RowNo, ValNo, sChStrTarget
But I find myself hoping for a better approach. Maybe I was just to dumb to see something obvious.
Michael
10-23-2012 07:03 AM
see this thread: http://forums.ni.com/t5/DIAdem/Dynamical-Channel-Selection/m-p/2113396#M15388
Michael
10-24-2012 10:47 PM
Hi Michael,
You can see in the Help file for DataBlCopy an example of how they add channels that are hard coded. To get a better idea of how to do things programmatically, as you are, you can see the topic on GetChannels. I think the method you have come up with seems fine, but you are welcome to use the tools provided in the reference parameter of GetChannels.
In the future, please make a new forum thread and reference related posts instead of adding onto multiple threads which have already been marked as solved. It helps keep things less cluttered when people are trying to search in the future
Cheers,
10-25-2012 12:32 AM
Forgot to thank Otmar. That command slipped by me and was exactly what I was looking for. Thanks!