Showing results for 
Search instead for 
Did you mean: 

Jitter(shift left and right) in waveform graph and data.

Go to solution

Good morning, I am making a LabVIEW program using the NI 6363 USB X. The program basically reads 9 analog channels simultaneously while outputting an analog output that is a triangle wave every 100ms. All inside a while loop where I also record the data read into a binary file. But for some reason, the graph jitters (shifts left and right) on the x axis every cycle. I am using a sampling rate of 50000, and the analog output should take 100ms.  Any idea of why this happens? Or how to make the graph stop jittering?

0 Kudos
Message 1 of 11

First of all, it helps if you clean up your block diagram before posting. It's very unorganized with lots of unnessecary sequence diagrams, wire bends and local variables. 


Can you make video what you mean? I ran your code and I don't see what you describe. The video shows some random data of a DAQmx device I had lying around.


If you mean that the axes themselves are moving around you can right-click a graph go to advanced and disable Auto Adjust Scales.



0 Kudos
Message 2 of 11

Hi, sorry for the clutter, it is my first post here. In the video below if you look at the triangle waveform it is shifting left and right. That is what I want to stop. Because I want each cycle to be the same. So that the triangle always starts at 30ms for example. I am using min(V) = -0.2, max(V) = 0.6, and Ramp rate = 300 on the analog output tab.


Thank you in advance and have a nice day.

0 Kudos
Message 3 of 11

Apparently the attachment didn't stay. Here is the video.

0 Kudos
Message 4 of 11

This behaviour happens because you aren't using any kind of hardware trigger. The software can jitter for all kinds of reasons, it'll never be exactly timed.


I'm not sure what you need to do with your software. But you need to at least synchronize the output and input by, for example, setting the analog input to start reading on the analog write start trigger.

0 Kudos
Message 5 of 11

Ok, so is there a way to make it so when the analog output reaches -0.1V for example, it would read some samples before and after that? I was reading this page after what you said. Or how would you do it if your interest is to just read the waveform? Because the other thing I am doing because of the jitter is to use threshold detection to know when the triangle starts.

0 Kudos
Message 6 of 11
Accepted by topic author Camilo4600

As I understood from your program, you want to peridiodically send a triangle and then measure the response. You can use this simple triggered measurement where reading is synchronized with writing.

Simple Triggered Measurement.png


The data to write can be like this, where you can modifiy the time before and after the triangle.



Consider that both in your example and mine, the periodicity will not be exactly peridiodic, since there is still the software starting and stopping of the tasks. If you want exact perdiodicity, modifiy the above code with this:

Exact peridiodicity.png


Hope this helps, if you have more question, I'd be happy to answer them.



Message 7 of 11

You really should clean up your diagram, it's 90% empty space.


And what is this monstrosity?



0 Kudos
Message 8 of 11

@AeroSoul wrote:

You really should clean up your diagram, it's 90% empty space.


And what is this monstrosity?



You know, we all started somewhere, he mentioned that this is his first post. Constructive criticism is good, but just saying that his code is bad doesn't help at all and discourages people from coming back to this forum.


With experience comes better code.

0 Kudos
Message 9 of 11

Kudos for the really nice illustration from Basjong53!


Tidbit: because the tasks share a sample clock (and are started in the correct sequence), there's no need for the start trigger.  It doesn't hurt, but you'll find that if you remove it you get the exact same sync & behavior.



-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 10 of 11