LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to enforce a measurement

I need to measure a voltage with a oscilloscope every second. During this second I have to process and save this value. There my question: Exists in LV 7.1 a possibility to enforce a measurement? Is this enforcement still possible if the processing of this data is not fast enough?

Thanks for help.
mara
0 Kudos
Message 1 of 4
(2,584 Views)
Hi,
I think you're looking for some sort of parallel loop architecture, where one loop would be doing the talking to the oscilloscope, and one would be doing the anaylysis, with the data passed through some sort of queue, or handshaking.
The tricky part is that if your processing is taking longer than your re-acquisition time, then you're building up a permanent backlog of data. This obviously cannot go on forever, so you would have to make a decission to either stop acquiring, or dump some of the data to play catchup. (Another possibility would be to analyse a larger chunk of data in one go, but that might not be appropriate)
A second is quite a long time when it comes to code execution.
Have a look here for information on optomising your code.
http://z
one.ni.com/devzone/learningcenter.nsf/webmain/5E017F18A8D3FCEA86256EE80056C707?opendocument&node=200064_us
http://zone.ni.com/devzone/learningcenter.nsf/03f7c60f17aad210862567a90054a26c/d4708bc2f1e4100586256c2c00505344?OpenDocument&node=200064_us

Hope that helps
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 4
(2,584 Views)
The thing with the queue sounds good. Have you any examples?

You are right, a seconds seems to be a enough long time when it comes to code execution. But if you receive up to two million sample points to handle with, it doesn't need a lot to need more than one second.

Thank you for the information on optimising my code. Unfortunately my vi was not so bad programmed.
0 Kudos
Message 3 of 4
(2,584 Views)
Hi,
a very simplified example is attached.
I wouldn't recommend this for very large amounts of data, but you could use a large array for storage, like a fifo, and an array where you store the list of indices that new data went in at instead.

Hope this helps
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 4
(2,584 Views)