LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Actual timestamp in waveform graph.vi

Solved!
Go to solution

Hi all,

 I am doing a very simple program to create an array and see the data in waveform graph. the data will be on y-axis and the time in x-axis. For the time I have problem with the actual time ,the system time for labview is 07:00:00 pm . My question is that how I can change the system time to the actual time or how can I have actual real time in the x-axis.Thank you all in advance. 

0 Kudos
Message 1 of 14
(9,347 Views)

Hi Ziad,

 

use a waveform instead of a plain array for your data. Put the needed timestamp into the waveform…

 

I have problem with the actual time ,the system time for labview is 07:00:00 pm . My question is that how I can change the system time to the actual time

Please explain the terms "actual time" and "system time". Why are they different?

Best regards,
GerdW


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

Thank you GredW

can you please attach a screenshot of how to do it.

0 Kudos
Message 3 of 14
(9,324 Views)

Hi Ziad,

 

check.png

Reading a waveform from a DAQmx channel…

 

Maybe you should attach YOUR VI and explain the problem you have.

I still don't know anything about your "system time" vs "actual time" issue…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 14
(9,320 Views)

I need to plot N distinct plots on the same graph where the x-axis is the host system (computer clock) time. My issue is the waveform indicator displays the wrong time (7:00 pm when it's 9:00 am ) when set to absolute time.

0 Kudos
Message 5 of 14
(9,311 Views)
0 Kudos
Message 6 of 14
(9,276 Views)

This is my vi

0 Kudos
Message 7 of 14
(9,269 Views)
Solution
Accepted by topic author ZiadAlkhoury

I see, the chart does not automatically update its reference time, which is something like Jan 1, 1903. What you can do is use a property node at the start of your program to adjust the x-axis offset. Also, to make sure it keeps track of time correctly, you'll want to change the multiplier as well, since the default is 1 second. It looks like you're getting 10 pts per second so we can make it 0.1s = 100ms.

temp.PNG

My preferred method is actually to use an XY graph instead of a chart. In that case I would update the data like this:

temp2.PNG

Feel free to use whichever way is more intuitive to you.

Message 8 of 14
(9,265 Views)

The time shown on the chart isn't wrong, it's just showing the default time.  If you changed the options to show the date you would see it's Jan. 1, 1903 (standard start of epoch time).

 

The chart doesn't know what real-time is unless you tell it but in your case there's really no such thing.  An array of doubles has no embedded timing info (initial time or delta time) so there's no reason to display absolute time as it would just cause confusion.  Basically you would just be using your chart as a clock so what's the point?  If you really want to do it just follow the code for the chart in this link:

http://digital.ni.com/public.nsf/allkb/0A4899EF6D01B9C5862568B70074F989

 

Also take a look at some of the examples (Help > Find Examples...) for arrays.  You're really doing things the hard way.  You can generate a 1D arrays by auto-indexing your for loop for instance.  I don't know what you were trying to do with the 2D array so post back if I'm missing something.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 9 of 14
(9,260 Views)

Hi Ziad,

 

I already suggested to use waveforms some days ago. Why didn't you even try to use them?

check.png

It's so easy…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 14
(9,252 Views)