LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

12 hour chart

I am looking for an example vi showing a 12 or 24 hour time scale. Showing the real time in hours and minutes.I'll be collecting temperature data and will need to view it over a 12 to 24 hour period.
0 Kudos
Message 1 of 7
(4,145 Views)
Look in the Time & Dialog palette for a variety of functions dealing with time. What do you want to do? Show a time string? allow the user to select between a 12H and a 24H clock? Read hours and minutes as numbers?

Look at the attached 6.1 example using Format Date/Time String.
0 Kudos
Message 2 of 7
(4,145 Views)
Not looking for string info at all. I'm trying to create a chart. A chart with a X scale that represents real time with the ability to have 12 or 24 hours of data displayed. I want the X axis to be in 1 hour increments.
0 Kudos
Message 3 of 7
(4,145 Views)
Look at the example that shipped with Labview: Cont Acq&Chart (immediate).vi. You can find it (in LabView 6.1) by selecting Help >> Find Examples >> Search >> Type a keyword to find: chart.

You can change the format of the X Scale to show a time format by right clicking on the chart, then selecting X Scale >> Formatting >> Format >> Time&Date. You can then select details about the Time and Date format (including changing Custom Date Format to Date Unused if you don't want to show the date). You can also on the Formatting page set a Xo to set your initial time, depending on what your data looks like.

You can also programmatically set the format and Xo using a Property node. (Or an Attribute node in version 5.x). Right click on chart, select Cr
eate >> Property node. Then, on diagram, right click on the property node and select Change to Write. Right click again and select Properties >> X Scale >> Format&Precision >> Format or Properties >> X Scale >> Range >> Minimum. If your data starts at t=0 but you want to start time when you start taking your data, use the Get Date/Time in Seconds function from the Time&Dialog palette and wire that output to a write property node for XScale.Minimum. It's probably easier to set the format non-programmatically (right click on the chart on the front panel) and set Xo = XScale.Minumum programmatically.
0 Kudos
Message 4 of 7
(4,145 Views)
The following program uses an xy graph to plot data having a timestamp. This is important because other graphs have a fixed time step between measurments. The xy graph allows the user to plot data with differing dt with the proper x placement.

The attached VI simulates data to an XY graph. Code was added to make the graph scroll like a chart. Also it gives the user an option to a window size and alows for the user to scroll to previous data.
Message 5 of 7
(4,145 Views)
Thank You Jeremy this is a great idea. I'm gonna work with this one a bit to see if It will work for me. Do you see any problem making the window size hours long though?
0 Kudos
Message 6 of 7
(4,145 Views)
There should not be a problem. Remember the time is represented in seconds, so you would use n hours X 3600.
0 Kudos
Message 7 of 7
(4,145 Views)