LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi to buffer streaming data

Hey all,

 

I have data coming in via shared memory. This is "live" data, that so far I can plot on a chart, view, etc. But I also need to buffer a chunk of this data so I can process it further (avg, etc) What I want is to have a buffer fill up with say the latest 1000 values, and have those 1000 values available to manipulate just like I read them in from a text or other file. I would also like to be able to adjust the buffer size on the fly. This sounds straightforward enough that I thought there would be a single subVI available to do this, but no luck, and I can't seem to figure out *which* of the buffer-related vi's would work best.

 

Does anyone have a simple, straightforward solution? Seems kind of silly to reinvent the wheel if I don't need to.

 

Also, I saw some sub-vi's referencing "queues." As I understand them, this builds a buffer that you can thena access one element at a time. Is that correct?

 

 

Many thanks!

0 Kudos
Message 1 of 7
(3,145 Views)

It sounds like a very interesting project. Have you tried looking into the templates for Producer/Consumer Design Patterns? File » New... » VI » Frameworks » Design Patterns. Try fooling around with some of the example code and see if you have any specific questions. Yes, your understanding of the queue is correct. 

Ben D.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,110 Views)

...and if you don't like suggestion by Ben D AE you could go with

 

Ben plugs an AE (Action Engine see this Nugget).*

 

Ben

 

*again

 

** In one of my big SCRAMNet apps I use queues to move the data to the proper consumer and an AE to maintain the current state for display.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 7
(3,102 Views)

Hello,

 

I am trying to do the nearly same thing: storing 1000 data points from a while loop in a "buffer" of sorts. I then want to use this buffer as an array feed into a parallel while loop. Did you have any luck and create a VI that does this? Would you be willing to post your solution?

 

Thanks,

0 Kudos
Message 4 of 7
(3,065 Views)

Hello mkw21,

 

I've located a couple examples that use buffering and array operations.  Though neither of the examples perform the exact operation you describe, they should give you some ideas on how to set up and design some of the pieces of your program.

 

https://decibel.ni.com/content/docs/DOC-10781

 

https://decibel.ni.com/content/docs/DOC-3414

 

 

Matthew H.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(3,038 Views)

Before you spend time trying to code up a buffer, first investigate Queues.

 

They are fast!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 7
(3,033 Views)

Sygnal processing -> Point by point functions might help you.

0 Kudos
Message 7 of 7
(3,029 Views)