Measure

cancel
Showing results for 
Search instead for 
Did you mean: 

histogram resetting

Solved!
Go to solution

I've created a histogram by making a large array with 600 elements for each of the bins. The histogram is working in that it collects the data, but it doesn't retain it through the program. It resets after a while and returns to zero and continues counting. I need it to be count the entire run time. Any ideas as to the problem?

0 Kudos
Message 1 of 4
(6,561 Views)

Here is the code that I am using with some descriptions of what each part is doing. histogram pic.png

0 Kudos
Message 2 of 4
(6,552 Views)

Hi sssmcd,

 

It appears the histogram array is continuously being added to.  How many iterations is the outside while loop performing before the data reset to zero?  How long does this take before it is reset to zero?  It is possible that you could be reaching the numeric limits of a 32-bit integer if you have this code running for a very long time.  How much data are you working with?

| Zach J. | Systems Engineer, HIL and Test Cells | National Instruments |
0 Kudos
Message 3 of 4
(6,549 Views)
Solution
Accepted by topic author sssmcd

BluesKnight,

 

I seem to have fixed the problem by taking the output of the histogram array and adding it to the shift register. I will have to keep in mind the limits of a 32-bit integer, because it will be running for some time.

 

Thank you for your assistance in this matter.

 

ssmcd

0 Kudos
Message 4 of 4
(6,530 Views)