Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I graph a Digital frequency input and analog input synchronize together

I am trying to graph 2 inputs, first an analog input, the second a digital frequency input from an USB-6210 DAQ.  I can get them to plot together but it does not look like they are synchronized together.  The analog input is a 5 second curve but the digital is shown by the number of samples it has captured and I do not know what the timebase is.  Is there any way of doing this?  Thanks for any help.
0 Kudos
Message 1 of 4
(3,119 Views)

Hello dwatts. 

As I understand your post, both the analog input and the digital frequency input are being acquired on the USB-6210 using DAQmx.  You are plotting them on the same graph, but the x scale is different on the two plots.  What kind of graph are you using (mixed signal graph, waveform graph, xy graph)?  Are you sampling both inputs at the same frequency?  You also state that the analog input is a 5 second curve.  Does this mean that the analog input stops after 5 seconds, is sampled every 5 seconds, or has a period of 5 seconds?  A better picture of how your code is constructed would be very useful for answering your question more completely.  Is it based off of an example program provided by NI or was it built from scratch? 

Taking a step back, is this the end goal of your application or is it an intermediate step to some larger application of the 6210?  Knowing more about the desired end product would also be valuable in providing constructive comments over this medium.   

Have a great day!

Brian F
Applications Engineer
National Instruments

0 Kudos
Message 2 of 4
(3,100 Views)
Hi Brian I hope this helps,
 
I am using the mixed signal graph.  The analog input stops after 5 seconds, that is the total amount of time required to get the entire pressure curve that I want to analyze.  During the time that I am getting to pressure curve I want to know what the frequency curve is. 
 
I just want to graph the 2 inputs for now.
 
I am attaching my project, please keep in mind that I am new at this and do not really know what I am doing. 🙂
 
I guess what I am asking is how to sample the frequency at the same time as the pressure curve.
 
Thanks
 
 
0 Kudos
Message 3 of 4
(3,093 Views)
Hello dwatts.  From reading your previous posts, it seems like you are able to see the two signals that you desire to plot on your mixed signal graph.  The question that you have is how to have both signals acquire at the same rate.  The analog input signal is currently configured to acquire at a rate of 1 kHz.  However, the frequency measurement is going to acquire at a different rate.  In order to calculate the frequency, our software first finds the period of the signal (and then inverts it to find frequency).  This is done by creating a signal with a known frequency and finding how many periods the known frequency completes in a period of the unknown signal.  Because of this, the frequency measurement isn't of a deterministic length and will not be able to be synchronized with another acquisition. 
 
Is there a particular reason that you need these two plots to sample at the same rate, or is it just for aesthetic purposes?
 
Let me know and we will do our best to help you out!
 
Brian F
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,066 Views)