LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add date and time to the Ox axis?

Solved!
Go to solution

Good afternoon
Help me figure out the program, I'm still a newbie. I have a data file where the first column is time (format: day.month.year space hours:minutes). I need to plot a parameter versus time. I was able to add a graph on which you can switch parameters and was able to display the date in a separate part, but I can’t figure out how to make this date appear on the Ox axis.

Please tell me. (For example, Ox - time, Oy - temperature, etc.).

senyakhokhlinmailru_1-1712747597394.png

 

Download All
0 Kudos
Message 1 of 6
(266 Views)

You want the X axis to be time.  Your first two columns are Date (in the format DD.MM.YYYY) and Time (in the format HH:MM) (note I'm using MM to mean "month in two letters" in Date, and to mean "minutes in two letters" in Time -- LabVIEW has a specific format specifier, you should look it up, for month and minute).

 

What you need to do is to take those two Strings and convert them into a LabVIEW "Time" representation.  You can use the Time functions, or you can use "Format into String" (which is probably what I'd try).  That gives you (from the first two columns of text) a single TimeStamp that you plot as the X coordinate.

 

Another way to attack this situation is to look at your data, as a whole, and observe that the data start at a particular LabVIEW Time (midnight, January 24, 2023) and are every 3 hours.  LabVIEW has a data type, called a "Waveform", for such "sampled data".  In the place of putting a time point (that has to be parsed) for every data point, it reduces the "time" axis to two numbers:  t0, the LabVIEW Timestamp for the starting time (midnight, January 24, 2023) and dt, the "sampling interval" (15 minutes).  This certainly makes great sense when using DAQmx with sampling frequencies of 1 kHz (or higher), might not be as useful for your sampling frequency of 1/9000 Hz (that's 1 divided by 15*60 seconds).

 

Bob Schor

0 Kudos
Message 2 of 6
(244 Views)

Choose this on your chart properties

 

LFBaute_0-1712752027122.png

 

CLA, CTA
Message 3 of 6
(228 Views)

Sorry, I'm still just getting started. Could you show me how to do this?

0 Kudos
Message 4 of 6
(224 Views)
Solution
Accepted by topic author senya.khokhlin@mail.ru

senya.khokhlin@mail.ru wrote:

Sorry, I'm still just getting started. Could you show me how to do this?


Probably this small snippet will be helpful for you for understanding:

DateTimeSnippet.png

and result:

Screenshot 2024-04-10 15.50.46.png

Example in Attachment (LV2018)

Message 5 of 6
(183 Views)

Thanks a lot! I felt like I was somewhere close, but missing just a little. I couldn't have done it without you.

Message 6 of 6
(153 Views)