DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a channel that is made up of specific data from other channels?

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

0 Kudos
Message 1 of 3
(3,271 Views)

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")

The error0 channel is 101 elements in length.  Any thoughts?
 
0 Kudos
Message 2 of 3
(3,264 Views)

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")

Hope that helps,
Brad Turpin
Product Support Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,253 Views)