LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Chart History Length in code

I need to set programatically the chart history length of both waveform charts and intensity charts. I am reading waveforms from file and want to be able to create enough buffer space on my charts in order to load all the file's data and be able to scroll through it all once it loads it. I read from a datalog file in a loop to load the data. My min/max of the X scale are set to a fixed 20sec window which is what is used to view the data but once it scrolls off I need to be able to scroll back to that past data which right now I am losing. I read another thread with the same topic but I beleive they were addressing a different issue that doesn't serve my problem. Of course the "Chart Histry Length" property settable in design time is not availabe on a property node so I don't know how to do this otherwise in run time. Thanks.
0 Kudos
Message 1 of 8
(5,385 Views)
Hi

If you are reading data from a file, why don't you use a graph instead of a chart? In the graph-control you can see all data and you can also set a scrollbar for if you use a different x-scale.

Hope this helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 8
(5,374 Views)
The chart history is not settable during runtime. I agree with becktho, use a graph instead of chart, you are looking at a complete data set instead of data stream. You can show the horizontal scroll bar (in case the graph is zoomed in, the data can be scrolled by the bar). To see the scroll bar, right click on the graph, Visible Items >> x scrollbar .

-Joe
0 Kudos
Message 3 of 8
(5,364 Views)
Thanks for the suggestions. I did consider that as the better option but unfortunately its not going to work for me. My intensity charts are used for a spectrograph representation of the analog data. Therefore I need to build that chart with the FFT of each time interval window from the data I read from the file. I can't read the whole file and do the FFT on the whole data since that will only give me one single time point in my intensity chart. Hope I explained my situation clearly. Hope someone has a new idea for this. In lack of such I guess I can set in design time the chart history length the the max expected measurment length but I am concerned on the memory use will be too large if the charts allocate that non-dynamically. If it uses that specified memory buffer as it fills up then it might be ok. Suggestions?
0 Kudos
Message 4 of 8
(5,357 Views)
Hi

There's another thread about chart history length. Maybe you want to look at it.

I would not set the history length to the maximum. Is it not possible to process your data as needed and instead of writing it to the chart build up an array which than can be passed to a graph-control?

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 5 of 8
(5,349 Views)
That is one of my backup ideas. I could build the array but I'd still have to pass it to an intensity chart since there is no intensity graph control that I know of. Then to scroll through the chart I could re-draw the chart everytime from the array but it seemed somewhat unelegant way to code it. I just wanted to see if there was another way to approach the issue. If not, which it seems so, I may have to move that way. I just don't like it since I have several of these intensity charts displaying info on several channels and not sure how smooth the UI would be.
0 Kudos
Message 6 of 8
(5,346 Views)
But there is an intensity graph control.
In the graph palette you have an intensity chart control but also an intensity graph control.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 7 of 8
(5,338 Views)
Well, guess who feels like a donkey? 🙂
Anyhow, the other thread you mentioned wasn't too helpfull except for that KB example that I hadn't reviewed before:

http://digital.ni.com/public.nsf/websearch/E9784F413A2269E086256F3A0064C8BB?OpenDocument

It includes an exapmple VI that does the trick I was looking for. Anyhow, now that my mind has been cleansed of the blinding spot to the fact that there is actualy an Intensity Graph control (I think I dismissed it before due to the fact that I couldn't use it on my acquisition VI and had to use the chart instead for proper visualization updates) now I can work with building my arrays and then displaying the graphs as a whole.

Thanks!
0 Kudos
Message 8 of 8
(5,315 Views)