LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i set the time frame of a waveform chart programmatically to be a 30 sec window or a 24 hour window

i'm using LV7.0 and what i need to do is to be able to set the time frame or range of a waveform chart programmatically before i start taking and plotting data. sometimes this window needs to be 30s wide and sometimes it needs to be 24 hrs wide. (in the first reference, i need the chart to fill up with 30s of historical data then the whole chart scrolls with each new data point). the data acquisition records data at a rate of once per second. i've tried to use the chart properties of XScale.offset, XScale.Range.Minimum and XScale.Range.Maximum but no matter what i do the time-stamp on the x-axis is always "00:00:00 PM" and "MM/DD/YYYY" even though values are seen being plotted on the right side of the chart as expected.
0 Kudos
Message 1 of 8
(6,085 Views)
I think that the problem is that your conversion from a timestamp to a dbl will not work with a X-axis that is formated for a waveform, ie the graph is expecting something like HR:MIN:SEC and it is getting 10 or something.

Since you are wanting to change the time window for the data anywany, I would get rid of the timestamp to dbl and replace it with a control that is formatted as %<%H:%M:%S%0u>t (Under the properties > formatiing tab and then change it from default to advanced editing mode).  The user can then select the window that they want to view and the control will send the window as a time.  The control will be wired to a XScale.Maximum property node.

Kenny
Kenny

0 Kudos
Message 2 of 8
(6,064 Views)
Hi. I'm trying to do almost the same thing but I guess I don't understand what your recommending.

I want to programmatically control the strip chart x-axis (time) window that is displayed. I have a numeric control that specifies the integer number of seconds I want for width. I don't really care how the scale reads, right now I've got it at HH:MM:SS. I can interactively get the result I want by manually changing the time presented in the leftmost x-axis label - if I want a 10 second window I change the left value to be 10s smaller than the rightmost value. This is exactly what I'd like to do programmatically.

Thanks. Sorry if this addressed elsewhere as I must have missed it.
0 Kudos
Message 3 of 8
(6,046 Views)
Okay, there seems to be some confusion here -- the X axis values are of type double, but they can be represented in the HH:MM:SS MM:DD:YYYY format if you want in which case it interprets the floating point as the number of seconds since 6pm Dec 31, 1903. 

You can programmatically set this value using the XScale.Minimum and XScale.Maximum properties, but note that if you wire a waveform to the chart after setting these values the t0 parameter will override what you set using the property node for XScale.Minimum.  If instead you leave the t0 parameter empty you can use the XScale.Offset property and wire the same value in that you wire to XScale.Minimum.  Changing the amount you add to XScale.Minmum to obtain what you wire into XScale.Maximum will determine the time window size.


Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 4 of 8
(6,018 Views)

Did you notice the post was 14 years old? How did you even find a post this old? I mean bravo on your willingness to help though 🙂

0 Kudos
Message 6 of 8
(3,344 Views)

I did but I am a newish user and I was excited that I had found the answer I was looking for!!

0 Kudos
Message 7 of 8
(3,341 Views)

Well far be it for me to discourage you. Glad you got what you needed 🙂

0 Kudos
Message 8 of 8
(3,336 Views)