From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to correctly set relative Waveform Chart/Graph time to show TRUE seconds?

Hello everyone, 

 

I'm quite new to LabVIEW and I have read a lot of topics, watched YouTube videos, searched examples, but I still can't find solution so I need your help now. I am trying to plot a simple numeric floating-point data in Waveform Chart. I set time on X-axis to relative, but seconds on this axis are passing incorrectly - too slow or too fast, depending on my loop iteration time. I am trying to manually adjust X-axis scale multiplier to match seconds, but I know this won't fix the problem. How to make time on Waveform Chart X-axis go correctly and not dependent on my code execution time/sampling rate, etc.? Sorry, I can't upload .Vi because it's an one big mess. If you didn't understand my problem, I could make simple simulation .Vi

 

Thank you 

0 Kudos
Message 1 of 4
(929 Views)

Build your "simple numeric floating point" into a waveform where you have a T0 value of the current time.

 

Is your data regularly sampled?

 

You can set the the T0 and dT for a particular plot of a chart through a property node.

0 Kudos
Message 2 of 4
(920 Views)

Sorry if ''simple numeric floating-point data'' looked funny to you. I attached example. If you run program, you see that seconds pass slower. I don't know how to build waveform since it's Y input is array, and my data is numeric floating-point. And I don't know sample rate of my sensors, also I can't predict my code execution time as it depends on computer CPU, memory and other factors.

0 Kudos
Message 3 of 4
(909 Views)

If the loop rate is constant, you can do the following.

 

altenbach_0-1614712379811.png

 

If the loop rate is variable during the run, more code is needed because charts and graphs assume constant spacing.

 

If you read your sensor one point at a time (software timed), just define a sufficiently slow constant loop rate and the spacing will be constant.

 

0 Kudos
Message 4 of 4
(876 Views)