07-15-2005 05:36 PM
How do I index a specific element of a channel? Specifically, if I have a channel of data that is 100 elements in length. Can I create a new channel that is the sum of the 2nd, 10th, and 19th elements of my original channel?
Thanks,
Matt
07-15-2005 07:38 PM
After searching the message boards I came across this reply:
Dave,
I had previous built an example to perform the data reduction of every Nth point. As Otmar points out, it does have to be done in a script, but this example should simplify things for you:
Reducing a Channel in DIAdem by Pulling Every Nth Point
If you have any questions about this, please let us know. Thanks and have a good one.
Adam B.
Applications Engineer
National Instruments
I downloaded the script, and extracted the useful information. However, when I execute my new script I recieve the error:
Error in ReducChannelTest2 ... Unknown Runtime Error
The code I am executing is
Call ChnAlloc("Newerror0")
Call ChnAlloc("Newerror1")
chd(1,"Newerror0") =chd(21,"error0")
chd(2,"Newerror0") =chd(41,"error0")
07-18-2005 12:44 PM
Hi Matt,
You should specify the maximum allowable length of the new channel in the "ChnAlloc()" command, and you then also need to set the actual length of that new channel to the desired (non-zero) length you want to fill-- in the below example that's at least 2 cells.
Call ChnAlloc("Newerror0", 2)
ChnLength("Newerror0") = 2
chd(1,"Newerror0") =chd(21,"error0")
chd(2,"Newerror0") =chd(41,"error0")