LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting a particular sample and then subtracting from previous sample

Here is the library with others files as well. From the block diagram, it is under All functions, Analyze, PointbyPoint.
0 Kudos
Message 11 of 17
(1,141 Views)

Thanks a lot unclebump.I figured it out.I could use a queue of sample length 1 and subtract the previous queue from the current queue.But there's one problem.The queue accepts only element data type and I am not able to give the array data type as an input.Is there any way that I can convert the array data type into an element data type?

Thanks

 

0 Kudos
Message 12 of 17
(1,137 Views)
You could wire the array into a For loop with indexing enabled, then add each element into the queue inside the for loop.
0 Kudos
Message 13 of 17
(1,133 Views)
I'm not sure, but this may be close to what you need.
0 Kudos
Message 14 of 17
(1,129 Views)

Hi unclebump,

                      Thanks a lot for the reply.When I just calculate the difference between the array points and divide them I get a whole lotta noise.I have attached my VI.I am not sure how I can incorporate the vi you sent me into that.Can you please have a look at my VI and let me know what I should do?The for loop I used in my VI  is autogrow.SO I am not sure how to implement the one you sent me in my VI.

Thanks

 

0 Kudos
Message 15 of 17
(1,121 Views)
Hi Guys,
             I am trying to use the peak of every 1000 samples of 2 signals that I am acquring and then divide them and dsiplay them..But I dont get any waveform when I divide the peaks.I dont think it even detects the peaks because it shows the error -20013 which is width must be between 0<w<samples...I have atatched the VI...Please have a look and help me out..
 
Thanks
0 Kudos
Message 16 of 17
(1,109 Views)

You are using the VI AI Sample Channels to perform a single read on the specified channels. This means that each channel contains a single-point waveform, though you are asking the peak detector to evaluate 1000 points. This explains the error you are receiving.

Try using AI Acquire Waveforms.vi instead. Then you can specify to read 1000 samples per channel.

Jarrod S.
National Instruments
0 Kudos
Message 17 of 17
(1,098 Views)