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.
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.
07-13-2017 01:38 AM
Hi,
I have a small question about histogram. It may be simple but I don’t have the solution.
I have a value Avg_Energie_3 that I want to insert into a histogram.
As you can see, the value is inserted into an array. This array is plot into a histogram.
Each loop, ‘Avg_Energie_3’ change and the size of the array is +1, so the time to calculate the histogram will be longer with time.
I saw that the size of the upper histogram is 16384 and the size of the lower is 0 !
What is the solution to keep good performance
Thanks for help
Solved! Go to Solution.
07-13-2017 02:05 AM
@Minikisscool wrote:
I saw that the size of the upper histogram is 16384 and the size of the lower is 0 !
What is the solution to keep good performance
Do you have problems with the range or problems with performance? Your values are U16, so their range is somewhat limited.
For the lower histogram, you need to initialize the feedback node with an zeroed array of the correct size. Yours starts out with an empty array, so any addition of any size array will end with an empty array.
Your picture is useless to us, because we don't know what the values of the various controls and arrays are. Can you attach the actual VI? There is also no reason for the local variables. Place the terminals outside the case structure and branch the wires to the two locations they are needed.
I don't quite understand the reason for most of your code constructs. can you explain what you are trying to do? Where does the data come from?
07-13-2017 02:07 AM
Hi Minikisscool,
make your own histogram function without using big arrays!
I guess your "Avg Energie" range is known before the measurement. So set up your histogram (range and number of bins). With each new "Avg Energie" value you only need to increment the corresponding bin…
07-13-2017 03:02 AM
My problem is performance for solution 1.
Each mean are put into an 1D array. With time, the size of the array is big (more > 100k or more)
It's right that input is U16 <0 - 65536> and i want to fit theses values into a 16k or 32k histogram. 16k first.
and my input values will varies between 0 and 65536, so all range of U16
I can't attach my VI, because values comes from a FIFO from FPGA.
make your own histogram function without using big arrays! - how do it ?
07-13-2017 03:10 AM - edited 07-13-2017 03:11 AM
07-13-2017 03:39 AM
Many Thanks, it works fine 🙂
It's the first time, I use this structure