LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time x- axis in waveform chart

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.

 

0 Kudos
Message 1 of 5
(494 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(478 Views)

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. 

0 Kudos
Message 3 of 5
(412 Views)

Hi Soumya,

 


@Soumya06 wrote:

Sorry for the inconvenience.


See this simplified suggestion:

 

On your VI:

  • You really should learn how to use a LabVIEW project to organize your main VI and it's subVIs!
  • When you need to duplicate code then you should use subVIs and/or loops!
  • All your serial communication is set to use a TermChar, but on the other hand you use BytesAtPort before each VISARead!? Watch this video!
  • Lots of other Rube-Goldberg stuff, like several IndexArray nodes where you only need one…
  • NEVER delete the label of frontpanel elements…
  • Your VI is missing the main loop: using the RunContinuously button is ONLY meant for debugging purposes!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(405 Views)

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

0 Kudos
Message 5 of 5
(398 Views)