LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to preload a historgram?

I have a VI that runs 24hrs/day and has a histogram.  Sometimes, the system has to be rebooted for various reasons and I loose the histogram.  I have figured out how to save the data but I'd like to "preload" the histogram with the previous data so it starts with the previously saved data.  Is this possible?  I'm using the histogram express vi. 
If not how can I combine the saved data into one histogram?  My save histogram code is attached.

-Keith
0 Kudos
Message 1 of 5
(2,576 Views)
I am not positive this is what you are looking for but its worth a try.  Conver the Express VI over to be a "typical" VI by right clicking on it and selecting Open Front Panel.  You will no longer be able to open the Express VI Configuration, so it may be worth saving a copy somewhere.  Once the Front panel is open you can then view the diagram, and notice that the Express VI basically consists of a SubVI.  Open that SubVI and save a copy somewhere else with a different name, so that you don't effect the Histogram Express VI.  Now in your original VI replace the Express VI with the one you just saved.  You can then modify that VI, and notice that it has a 2D Data array.  Simply add that to the connector pane, and you may need to create a Data output.  In your VI you can then pass the data around through a Shift register, and you can preload that Data array with the saved data.
 
Let me know if that helps, if not we can look at other steps.
0 Kudos
Message 2 of 5
(2,568 Views)

Hi Keith,

I would recommend saving the histogram data to a file within your application. Then, whenever your program starts you can read the most current histogram data from disk and write that data to your front panel graph using a property node.

Specifically, right click on your histogram indicator (a Waveform Graph) within the block diagram and select Create >> Property Node >> Value. Writing data to this property node when your application begins will preload the histogram.

I hope this helps!

Casey Weltzin
Applications Engineer
National Instruments

0 Kudos
Message 3 of 5
(2,546 Views)
This looks like it might work. I'll give it a try and see how it goes.

Thanks for the reply!
0 Kudos
Message 4 of 5
(2,546 Views)
That will just show the old data until you get new data. It will not add the new data to the old histogram.
 
I think you should do the histogram manually in a shift register by incrementing elements according to an index calculated by the current value. Save it after the loop, and initialize the shift register with it before the loop starts again. 🙂
0 Kudos
Message 5 of 5
(2,535 Views)