02-27-2014 09:44 AM - edited 02-27-2014 09:46 AM
Hi,
I am fairly new to LabView but I went through the Forums and googled a lot and didn't find a solution. I have this problem:
I have an analog signal obtained from my NI DAQ USB6009. I want to take the signal I obtained 2 seconds ago and substract its value from the present value. And I want to do it countinously.
My data are acquired 1 sample on demand by NIDAQ Assistant in while loop.
Result signal should be something like:
Y(t) = y(t) - y(t-2), where Y is a result and y is a signal from NIDAQ.
Can You help me or specify anything else You need to know to help me? Thanks.
Solved! Go to Solution.
02-27-2014 10:33 AM
What do you have so far? How often are you sampling?
The simple solution is to just put your values into a shift register. You can then subtract the value in the shift register from the newly read value to get your output.
02-28-2014 01:26 AM - edited 02-28-2014 01:33 AM
Hi,
in case your sampling frequency is 1 S/s stacked shift register is definitely the easiest way how to implement given formula. It can look like this:
Regards,
Ondřej K.
NIEE AE
02-28-2014 03:25 AM
I have daq assistant (1 sample on demand) in while loop. That's it. There is no "wait" or "delay" in that loop. To tell You the truth I am not sure how can I determine the sampling frequency in this case, but when I store measured data in file it looks like the sampling frequency is 42-43S/s.
That would make 84 shift registers for two seconds, wouldn't it? That seems not the best solution to me. Even more when I want to be able to change the delay time somehow easily.
What I have done so far? I have quite a bit of code, which does some stuff for me. I think the relevant code is only the one in red square:
02-28-2014 06:35 AM - edited 02-28-2014 06:37 AM
You would use a ring buffer instead of the shift register.
Your signal source should be configured to read continously (take more readings (best would be multiples of line periode) and mean)
02-28-2014 08:33 AM
Thank You for Your answers.
Henkrik, please, can You describe at least the main parts of Your project. I didn't catch what it does at all, probably because of my poor knowledge. I would appreciate Your help very much.
Thanks
02-28-2014 09:57 AM - edited 02-28-2014 10:00 AM
@zipac wrote:
Hi,
I am fairly new to LabView but I went through the Forums and googled a lot and didn't find a solution. I have this problem:
[...]
Can You help me or specify anything else You need to know to help me? Thanks.
Well even If I did already most of your homework 😉 bevore googleing and forum readings comes LabVIEW tutorials!
REading a book and reproduce the examples can help too.
When I find time I will write some comments on my 5min (8min with cleanup) work, but some basic understanding of dataflow, loops, shift register, datatypes,... is needed
02-28-2014 12:31 PM
Thank You for doing my homework. I'll do my best to find out whats going on by myself.
Don't bother yourself with doing anything else, please. It would be more educative for me to learn the basics by myself.
Thanks