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: 

I do not take time to match data with the PC time

Hi

I have a question and do not know why I did not coincide with the time that stores a data graph with the time at which the data is stored on the PC should be every 0.5s and there values are 0 almost, 46s between data and information.

Attached is a picture and -vi.

By the way why do not load the stage number and always reads 0?

  Thanks for your help.

0 Kudos
Message 1 of 7
(2,748 Views)

1.JPG

0 Kudos
Message 2 of 7
(2,746 Views)

There are a lot of things wrong in your VI.  You have no data dependency between your simulated signal source and the operations you do with it, you are offsetting the t0 using a constant timestamp, and you are using a local variable to append data to Table Control.  I do not know why you have two tables at all.

 

 

However, to address your specific questions:

  • Your signal simulation is set for 20 Hz, which means 0.05 s period, NOT 0.5 s period.
  • Stage number is always zero because it is the iteration counter of the for loop, which always runs only once since the length of the Y array is always one.
  • I do not know what you mean by "46s between data and information".


0 Kudos
Message 3 of 7
(2,708 Views)

Hi Vltan.
I modified my vi.la simulation signal at 10 Hz and period 0.1s.
Where I have the problem is that when the pc was not increased in 0.1s.When the while loop period is 0.1s.

You can modify my vi.

3.JPG

0 Kudos
Message 4 of 7
(2,665 Views)

Note that with the "Simulate acquisition timing" checked in the Simulate Signal Express VI, you do not need the Wait Until Next ms Multiple in your loop; the Simulate Signal is controlling timing itself.

 

The loop period is nominally 0.1 s, but it will not be very well controlled on a non-real-time target.  Variations of several milliseconds are expected on a PC, with variations increasing more as depending on the amount of activity (more applications running, lots of GUI interaction and mouse movement, etc.).



0 Kudos
Message 5 of 7
(2,657 Views)

When you use a PC's time to timestamp values directly, you are at the mercy of the update rate of the Windows/PC clock.  I found that the update rate of that clock is about 1/60th of a second.  The timestamps generally jump about 16-17 millisecond steps.  You are probably seeing that effect here.

0 Kudos
Message 6 of 7
(2,642 Views)

Sample 1 sec. an loop T = 1 saves the data well.

Sample 2 sec. an loop T = 0.5 saves the data well.

Sample 4 sec. an loop T = 0.2 saves the data well.

Sample 5 sec. an loop T = 0.25 saves the data well.

 

It is the problem of PC / Windows clock ?

0 Kudos
Message 7 of 7
(2,622 Views)