From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform buffer size with muliple data plots unsynchronize timestamps

I am trying to set the buffer size of my waveform graph to display 5 minutes of data. My data is coming from a different while loop. the data is fed into a queue and I dequeue it in this loop shown in the picture. I modify the waveform circular buffer.vi to change the buffer size of my data and plot it. keep in my data is flowing as waveform (1D array ), 3 elements (t0, dt,y). I have different channels that shows different plot. My problem is if I select more that one channels they dont start at the same time. does anyone know why and possibly helo me fix that issue.

pics of the code and my display is attached

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 1 of 14
(3,543 Views)

I forgot to attach the VI.

see attached

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 2 of 14
(3,509 Views)

When you say you did some modifications to the waveform circular.vi, what were them?

0 Kudos
Message 3 of 14
(3,487 Views)

Is the first image an image of Circular Buffer?  Please don't attach images -- we can't "play" with them, test them, fix them.  Attach code (VIs, ZIP, or Snippets).

 

Your code is clearly not doing what you want it to do.  Without looking at your code, can you please write a brief description (but not too brief -- it may take a dozen sentences or so, but it will be worth the modest effort) to describe what you are trying to do?  The top loop is clearly for data generation:  describe the data well enough that someone (like me) could write a tiny function to simulate/generate the data.  we need to know the nature of the data, the sampling rate, the number of samples, and how much is going on the Queue how often.  

 

The lower loop is for display and processing -- again, what parameters are there to the display, such as Every Point, decimated points, etc.  Is it a Chart or a Graph?  What do you want to do (other than plot it) with the data?  What's with the Circular Buffer, what are you trying to accomplish there?

 

Once we understand what you want to do, we will have a better understanding of what you did do, and why it isn't working the way you hoped.

 

Bob Schor

0 Kudos
Message 4 of 14
(3,472 Views)

The top loop is for data generation. The data type is a cluster of timestamps (to), sampling time  interval( dt), and 2D array single precision (Y). d is set to 1/100 fixed. number of samples is 2000, data size is 3 x 2000. Naturally all of the 2000 samples go thru the queue every 1000 ms.  But I do want the data to flow thru the queues at 100 samples every 1/10th of a sec. havent tried that yet.

The second loop used the same data parameters as the first loop for every points. no decimation and data is displayed via a waveform graph. I want to control the amoount of data displayed on the graph thats when the circular buffer comes in. I tried to use it to have about 5 min buffer long of data displayed. that's the goal.

Since I am working with multiple channels (columns) in my 2D array of data. If I ever select more that one channel (column) to display, I notice that they do not start at the same time on the graph. I notice each channel start about a couple seconds before the others.

My first time working with buffering data, if there is a simpler way I'd go for it.

Hope I was clearer this time around

0 Kudos
Message 5 of 14
(3,442 Views)
I am not sure if you were able to see my last comment
0 Kudos
Message 6 of 14
(3,391 Views)

You are using the circular buffer incorrectly.  It only stores one set of data, but you are using it to store data from three different sources.  Each time you add data to the circular buffer, regardless of the source, the buffer puts the new data at the end of its existing data.  Your program does the following:

 

  1. Add data from source 1
  2. Get all data and plot it
  3. Data from souce one is shown

 

  1. Add data from source 2
  2. Get all data and plot it
  3. Data from souces one and two are shown

 

  1. Add data from source 3
  2. Get all data and plot it
  3. Data from sources one, two, and three are shown

 

This is why it appears that data source three is starting earlier than the others.  You are actually showing more data, which puts the start of the data closer to the front of the buffer.

 

0 Kudos
Message 7 of 14
(3,380 Views)
Ah thank you. It makes much more sense now. I'm still in the dark on how to modify it and make it takes more than one set of data.
0 Kudos
Message 8 of 14
(3,374 Views)

There are several ways to buffer multiple data sources at that same time.  One solution is to to make a circular buffer class, then create an instance of that class for each data source.  I have attached an example of what I mean.

 

Cheers,

   Jordan.

0 Kudos
Message 9 of 14
(3,350 Views)
Thanks for the directions but I can't open it. Would you mind posting that in labview 12.0 please
0 Kudos
Message 10 of 14
(3,333 Views)