LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter-reset VI

Solved!
Go to solution

To make it simpler.

The data type I need to store is extended (at least 5 decimal digits), and I need it circular because I need continuous acquisition during several hours.

0 Kudos
Message 11 of 13
(961 Views)
Solution
Accepted by ManuP

Hi ManuP,

 

I think that there is a simple way that you can get 2 buffers to work using the downloaded circular buffer. It says in the help that you cant have 2 buffers of the same type. As you are only saving a 10 bit value, which can be held in a U16 you can have 2 buffers, one using the U16 version and one using the DBL. Just convert to DBL before entering and if needed (which i dont think it will be) convert back to U16. Thats one way to go about it.

 

Personally i wouldnt use that buffer, it looks over-complicated and not well written, after benchmarking it proved to be slow also. Most probably adequate for your needs but i just dont like it. Benchmarking a million writes and reads the downloaded version you have took 25 seconds whereas the version i will attach only takes 4. Im absolutely sure that mine isnt the most efficient either but it's still better then the other one. I had a look at what you need and re-wrote a circular buffer i had written a while back to best suit your needs. I made the input a DBL so it is flexible for different data types. I made 2 copies for you 'Circular Buffer' and 'Circular Buffer B'.

 

In the folder there is a vi called 'circular buffer example 2', have a look at this. From what you are describing im not even sure if you need a circular buffer. If all you are using the circular buffer for is to buffer the last seconds worth of data so you can display it on a graph then i think that a chart would better suit your needs. Also with a chart you will see the time scroll across the bottom, as it currently stands you only ever see 0-1. In this vi i have shown 2 ways that you can use the circular buffer and also how to use the chart to show your data. I have also placed the benchmarks in the folder for your interest.

 

Hope this is of some help to you. 

 

Rgs,

 

Lucither.

 

 

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 12 of 13
(946 Views)

Wow Lucither that was really great, thank you so much for the hard work you put into this issue.

 

You were right about the chart. I think I don't need the buffer to plot the signal, actually I'm using two charts to show the data and it seems to work just fine.

At the same time I use the buffer VIs you gave me to build a waveform using 200 samples and then analyze it (I need frequency and peak detection).

So it looks like you solved all my problems so far. Again, thank you.

 

This is the first time I use the NI Forum and I don't know what the Kudos are, but I'll give you as many as you need. 

0 Kudos
Message 13 of 13
(938 Views)