09-13-2011 06:26 PM
I want to be able to control histogram properties(number of bins, max, min, etc.) from controls on the front panel.
The General Histogram.vi suits this need very well.
Also, I want to get a set of data from a subvi each time a loop executes and accumulate it with the existing histogram.
The Create Histogram Express vi works well for this need.
I am having trouble getting both features to work simultaneously.
I have tried using sending my data set to a buildarray and concatenating inputs with a shift register to make a large array before histogramming.
This works, but not well - the array quickly becomes too large and I have trouble with execution speed.
I have also tried using a shift register to add the results of the histogram to the previous result - but it does not seem to work (see attached - the x inputs for the histogram is really an array of ~ 5000 values comming from a subvi that updates each time the loop runs).
There must be something obvious I am missing here.
Any Ideas?
(Using Labview 9.0.1)
Solved! Go to Solution.
09-13-2011 06:53 PM
Your shift register will always contain an empty array, because it it is not initialized. Adding any array to an empty array will result in an empty array.
Your loop spins at a near infinite rate. That does not seem reasonable.
Do you really want to change the histogram parameters while it is accumulating. What should happen if you change from 20 to 25 bins or change the boundaries? The results will become meaningless.
You need to initiaize the shift register with a zeroed array of the correct size or bypass the ADD operation on the first iteration using a case structure, for example.
12-07-2011 04:57 AM
I am very surprised, that the function for caculate the histogram of images in the NI VDM has a so high speed, It only needs several microseconds to caculate a whole image. When I what to program a same function in VS2008, I found I con not make it as fast as NI VDM .
.How can this be?