07-27-2023 04:37 AM
I'm trying to get real time in x-axis for this attached graph with date(DD/MM/YY) but this is not showing proper date and time(of the same date) what should I do.
07-27-2023 04:59 AM
Hi Soumya,
@Soumya06 wrote:
I'm trying to get real time in x-axis for this attached graph with date(DD/MM/YY) but this is not showing proper date and time(of the same date) what should I do.
At first you should clear up your wording: the message title is about "chart", the message text mentions a "graph". Those are different items for LabVIEW! Both support to show date/time on the X axis(with different capabilities).
Then you should attach (real) code, not just an image of code (or in your case an image of a frontpanel): we cannot edit/debug/run images with LabVIEW!
Do you use waveforms when plotting your data?
Do you even supply the current time to your chart/graph???
Can you provide an example VI to demonstrate your problem?
07-28-2023 06:08 AM
Sorry for the inconvenience. I have attached my VI, please help me.
I want current time in the axis as today is 28/07/2023 and 16:38pm.
07-28-2023 06:27 AM - edited 07-28-2023 06:29 AM
Hi Soumya,
@Soumya06 wrote:
Sorry for the inconvenience.
See this simplified suggestion:
On your VI:
07-28-2023 07:10 AM
As usual, @GerdW beat me to it! The "thing you did correctly" was to set the Chart Display Format for Time to "Absolute Time" (which means Date and Clock Time, as opposed to "Time in seconds, starting from 0". But nowhere did you set the "starting time" to anything specific (like "The Time right now!"), so it took the default of 0, which is Midnight (UTC), January 1, 1904, which is 7 pm (EST) of the day before.
So you need to provide LabVIEW's Chart with the Starting Time. The usual way to do this is to use the Waveform data type, which combines a Time-Stamp for the first data point being plotted (t0), the time, in seconds, between samples (dt), and an Array (!) of data samples (Y) to be plotted. GerdW provided you with code to do this, and also pointed out other issues you should correct.
Bob Schor