06-16-2012 09:21 AM
Have an annoying problem that I'm sure there is a simple solution to. So here goes..
This is the current setup which works as desired
I have a producer loop that continually spits out an array of data (the array is continually overwritten every loop iteration). The elements of the array are numeric and can be a be a range of numbers or all zeros.
I have a consumer loop which plots the data from the producer loop when the array elements do not equal zero.
This is my desired behaviour which I can't seem to program
I wish to add functionality to the same consumer loop. I want to build an array of the data from the producer loop only when the data is non-zero while still maintaining the plot functionality. I've tried loops with shift registers combined with case statements however the loops hold the data flow meaning the producer doesn't get serviced.
Note: I can't really upload the vi as it's part of a large library which isn't solely mine so I hope i've provided enough info.
Strokes
06-16-2012 11:14 AM - edited 06-16-2012 11:15 AM
Your post is very vague and I don't think you give enough information to really help.
I am pretty familiar with LabVIEW, but terms like "spit out", "get serviced", and "continuously" have very little meaning without much more details.
If you only plot the data if they are nonzero, you must already have a case structure. To build an array, all you need is a shift register initialized with zero and a build array node in one of the cases (the array is wired through unchanged in the other case). Make sure to select "concatenate array" mode for "build array". Of course if you continously append data, you will very quickly run out of memory, so you probably need some mechanism to deal wit that scenario. Do you want to only plot the current data or the entire accumulated array?
I have no idea how the consumer loop can hold up the dataflow in the producer loop. Where is the dependency coming from?
You don't need to upload a huge project. I am sure you can reduce it to a simple VI with two small loops and some random number generator. This would be enough to show the basic architecture you are using. Thanks!