Acquire sine wave from DAQ

Hi
I am using DAQ to acquire sine wave from function generator to determine the fringes, phase and wavelength.
How can I build this VI?
Thank you

Mostly like the phase is being reported
from 0 to 180 or 0 to -180.  There is a VI to unwrap the phase.
I took a look at your code and I am a
bit confused about what you are trying to do. 
Right now it looks like you are gathering 100k samples at a sampling frequency
of 200k in a finite acquisition.
In your code, each iteration of the For
loop takes 100k samples and finds the number of peaks.  The Extract Single Tone Information.vi finds
the tone with the largest amplitude in the 100k samples and returns the
amplitude and phase.  The phase in this
case returns the absolute (start) phase of your detected sine tone, that can
also be viewed as the phase relative the beginning of your signal (in this case
the beginning of the 100k samples).
On the next iteration, the code takes a
new set of 100k samples and calculates the same information (again the phase is
based on the start of this new set of 100k samples).
What is your ultimate goal?  To continuously acquire data, find peaks and their
phase relative to the first sample collected? To acquire a finite set of data,
and find the phase of each peak relative to the first sample?  Get the relative phase between two different
peaks?  What are you using the phase
information for?  Are you using the phase
to count the number of cycles?  What kind
of signal is coming from your signal generator?
To compare the phase to the first sample
you will need to use some comparison vi’s as mentioned in another post.  Shift registers can be used to keep a “running”
total of the phase from the first sample.
Jared T.

Similar Messages

  • Analogy output a 5000 Hz sine wave from DAQ 6015

    Dear Friends,
    I am back again. Today I try to use the DAQ 6015 to generate an analogy output sine wave of 5000 Hz, it shows me underflow warning. I think it is because of the limit of the on board buffer size. However, I would like to ask for some advice from your experienced expert if there is any way I can make it.
    Many Thank
    dan 

    Hi Dan
    Just a few questions before I can help you. Are you using LabVIEW, if so which version. Are you using NI-DAQmx driver, again if so which version. When you receive the underflow warning do you also encounter an error code and description of the warning? Would it be possible to post the message and code in your next post.
    You can setup buffer size and sampling rate via LabVIEW. Using the DAQmx API makes this very easy using the DAQmx Timing.vi
    Kindest Regards
    Yatin | NIUK & Ireland

  • Acquire sine wave

    Hello,
    I'm trying to acquire a sine
    wave from my com1 via rs232. I don't have a DAQ, and that's where it's
    causing problems. I have a sine wave of around 200 hz going through an
    rs 232 cable into my computer. The frequency will shift between 0 and
    200 hz. I pretty much have tried looking everywhere but all of the
    solutions seem more complicated than they should be. I'm using LabVIEW
    8.2.1.
    I will upload my VI so you can see. In the end, I want to
    replace the "simulate sine wave" with the acutal sine wave coming from
    the RS232. It's an analog sine wave.
    Attachments:
    qcm.vi ‏98 KB

    I might be confusing analog and digital. My english is very bad especially when it's technical, and yes I have absolutely no academic background in either subjects.
    The signal coming in is in the form of a sine wave, and the sine wave is coming from 2 oscilators, which are oscillating at 9.2 megahertz and are powered by 9v batteries. One of the oscillator wires travels through a crystal which causes the frequency to shift. Then both of the wires go to a mixer, and the frequency coming out is the frequency difference between the sine waves. This frequency will always be between 200 hertz and 0. I have that connected to an rs232 which is connected to my computer.
    I can convert the signal to TTL if it comes down to it. I'd just rather not.

  • How to generate finite cycles of sine wave using daq mx in vc++

    Hi,
    How to generate finite cycles of sine wave or for finite duration in vc++ using hardware timer without any sleepfunction in the code.
    Thanks & Regards,
    satya

    Hello Elizabeth,
    Thanks for the response.
    1) I am using NI 6040E PXI.
    2) I am using NI-DAQMx 8.3
    3) Measurement Studio is 6.0.0.105
    4) Operating system is Windows XP.
    I want to generate sine wave for finite duration previously in traditional daq there was function called wave_op.In which we can mention number of cycles of sine wave we wanted to generate. That function is not available in DAQMx so we have to use sleep function to generate finite period. Any hardware control function to control generation of finite cycles please let me know.
    Thanks & Regards,
    satya

  • Acquiring a sine wave of 1KHz riding on a DC and Detecting its peak value through compact rio

    Dear LabView Programmers,
    We are trying to acquire a sine wave input through cRIO-9004 using I/O module cRIO-9215 which is a 16-bit ADC.
    We are able to acquire sine wave below 100Hz faithfully but not higher frequencies, the higher frequencies(1Khz) get distorted. How to acquire this sine wave of 1Khz faithfully through the above mentioned hardware.
    Regards
    LabView Lovers  

    Using LabVIEW 8.0, you will need to place the data from the 9215 into a dmaFIFO buffer, such that you do not need to poll the 9215.  It is the polled or the interrupt process that reduces the sample rate. 
    Hope this helps. 
    Preston Johnson
    Principal Sales Engineer
    Condition Monitoring Systems
    Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
    National Instruments
    [email protected]
    www.ni.com/mcm
    www.ni.com/soundandvibration
    www.ni.com/biganalogdata
    512-683-5444

  • How do I synchronize a pulse output to a sine wave input on a pci-6602 card?

    I have a sine wave from a function generator as the input on the source of a counter. Input frequencies vary from 2-60 kHz. I want to produce a pulse train at a different frequency (10 Hz), but in phase with the sine wave. I have only been using Labview 5.1 for a short time. I am using the PCI-6602 card with a SCB-68 connecting block.

    Hello;
    Unfortunately, you can't connect a analog sinewave to the counter source. Counters only work with digital TTL signal type. To accomplish that task, you will need a MIO board working in sync with the 6602 you already have.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • Synchronizing 2 sine waves

    I'm new to Labview and NI-FGEN so things are taking a bit longer than i think they should, the problem is im trying to synchronize sine waves from 2 PXI 5421 cards.
    what im fundamentally trying to do is have a slide bar and at one end of the bar one sig gen is at 5V and the other sig gen at 0.1V and when you slide it to the middle the amplitudes are both at 2.5v and at the other end of the scale the first siggen is at 0.1V and the second 5V.
    i can get this bit to work but when i connect the sig gens to a scope one signal is drifting.
    on another note if any one knows an easier way of creating the signals, I've "butchered" some examples. So there's probably loads of stuff that I don't need inthere.
    Attachments:
    test sine wave generator.vi ‏45 KB

    I do not have the FGEN VIs so my comments are general rather than specific.
    1. Unless the frequencies are EXACTLY the same, the signals will drift relative to one another. There are at least two frequencies involved for each generator, (a) the user-specified signal frequency and (b) the D/A clock frequency. Your front panel has two controls for frequency. If they are set the same, then the nominal signal frequencies will be the same. It is important to be very careful with fractional numbers because of the way they are represented in binary in the computer.  The clock frequencies will be nominally the same. Many devices use quartz crystal oscillators which have a frequency tolerance of +/-100 ppm (parts per million).  While 100 ppm is a small fraction, two signals gnereated by clocks which differ by that much will drift.
    Fixes: (a) Use only one frequency knob on the front panel and feed the value to both FGEN modules.
    (b) Use the same clock for both modules. I do not know whether these devices have a connection for an external clock. If they do not, you will never get perfect synchronization. Somewhere you will need to configure subVIs to tell the modules what clock to use.
    2. The Amplitude slider will be read only once at the beginning of your program. That value will be used throughout the run. Any changes made later will be ignored. This is due to LabVIEW's dataflow paradigm.
    Fix: The terminal needs to be indside a loop. Better fix: Learn about the Producer/Consumer (Events) Design Pattern. This will have a parallel loop with an event structure to handle the User Interface, in particular, the changes in the slider. It will send the new values to the FGEN loops via queues.
    3. Same as 2 for Frequency. 
    Lynn

  • How to output a TTL signal from a sine wave [Please Help]?

    Hi evryone!
    I am a bit lost...
    We make the acquisition of voltage (sine wave, 3Hz) which I simulated by a waveform generation in my VI. We want to convert this analog signal to a TTL and output it with a multifunction DAQ (6230).
    I only used Analog to Digital.vi and DAQmx write.vi and I can't get it to work... I get a TTL which is not 3Hz and only If I input a frequency like 3.07 and not 3.00 !!
    Did I forget something ?
    Thanks for helping
    Christophe
    Attachments:
    ADC.vi ‏26 KB

    In your vi, you don't have DAQmx Timing setup.  I don't know what the default value is.  But the timing determines how fast the DAQ will output values.  If not set correctly, you may see slight change in the output frequency.  Another thing is that the timing is based on a master clock, like 50MHz.  The clock gets divided down until it gets near the desired setting.  So it may not be able to achieve 3KHz exactly.  If you are getting 3.07KHz, this may be why.  I don't know if there is anything you can do about it.  Try using the timing vi and setting different sample rates.
    - tbob
    Inventor of the WORM Global

  • Will the Ipad power adapter operate safely from the modified sine-wave output from a 12VDC-240VAC inverter?

    Will the power adapter for the Ipad Air operate safely on the modified sine-wave output from a 12 VDC-240VAC inverter?

    I am not sure why you want to do that...the power adapter takes 100-240 volts AC at 50-60 Hz and converts that to 5 to 5.1 volts DC at about 2 amps.  Why are you inverting 12 VDC to 240 VAC then back to 5 VDC?
    It should handle that easily, but seems like a long round about way of getting there.

  • What's the smallest sine wave output from PCI-5401(50&60Hz)

    Want to know the minimal sine wave output from the PCI-5401. Primary use for tests with 50 & 60Hz, with different loads.

    Hello,
    Are you talking with respect to frequency? Using the DDS mode, the frequency resolution is 9.31mHz. You can find more in the appendix B of the manual. I am providing the link below. Please do let me know if you have any questions.
    5401 Manual
    Sincerely,
    Sastry V
    Applications Engineer
    National Instruments

  • Unable to read the frequency from this output sine wave of amplitude VS time

    my programe reads through a labjack programe works up until the LJ stream graph process reads to "scaled data v's seconds" graph.where it outputs a sine wave (amplitude vs time)
    for some reason the "freq. amp." analyser won't read the frequency correctly. when i run the programme it outputs a frequency of zero.
    note: the amplitude is reading correctly
    see both programmes attached..................
    Attachments:
    problem.vi ‏77 KB
    LJstream_graph_processing.vi ‏46 KB

    I don't really see the utility of this VI, however, the variable "scan rate", of the "LJstream graph processing", it's an arbitrary value, why?...
    What is the idea with these VIs?, tell me more, please.
    Bye.

  • In order to sample a 3 Hz sine wave, I have to scan it at 30 Hz.

    My setup is as follows:
    I have two PXI 6031E DAQ cards in a PXI 1000B chassis. Each DAQ card connects to a SCXI 1001 chassis. On the first SCXI chassis I have six SCXI 1102C modules and in the second SCXI chassis I have three SCXI 1102 modules. I set up two seperate scan lists. One for the first DAQ card and one for the second DAQ card. The actual scanning functions are placed in seperate threads. After I acquire the data, I move it to "shared memory." The display program reads the value from shared memory and plots the value. For simplicity I left the data as a short int and plotted it that way. If I connect a function generator to any channel I can read a clean wave only if my scan rate is 10
    times the function generator value. For example, if I want to read a 3Hz sine wave I have to set the scan rate on the DataAcq program to 30Hz and the update rate on the display program to 30Hz. Should I be able to read a 3Hz sine wave while scanning at 3Hz? Also, I am open to any recommendations in my code.
    Attachments:
    DataAcq.zip ‏6 KB
    Display.zip ‏5 KB

    What you have discovered is quite normal for acquiring data in the time domain. If you were only interested in the frequency domain, you could follow the Nyquist criteria and sample at a frequency at least twice your desired frequency (6 Hz). Since you wish to examine the data as a sine wave (to view and recognize), you need to sample the waveform at a rate of at least ten times the desired frequency. Hence, to plot and recognize a 3 Hz signal, you would need to sample at a rate of 30 Hz. This action allows ten actual data points per wave cycle.
    As a rule, I use 16 times "oversampling" for my application where I desire to manipulate the data in the time domain. Twenty times oversampling would be even better. It really depends upon the resolution you would like to
    see in your data.

  • USB-6009 Sine Wave

    Hi,
    I am new to LabView and am having some trouble. I need to input two sine waves into a USB-6009. I have a voltmeter that should read the output. Two of the problems that I have had thus far: I can only use "On Demand" in DAQ Assistant and even when I throw the DAQ Assistant into a while loop I still do not get a readout on my voltmeter. Any suggestions? Thanks for the help.

    That is confusing. You say you need to input 2 sine waves into a 6009 and that to me implies that you are doing a DAQmx Read. Then you say you have a voltmeter to read the output. That implies you are doing a DAQmx Write. If you are really doing a write from the 6009, then on demand is, of course your only choice. As the specs clearly indicate, the output of the 6009 is strictly software timed so you would need to pass a sine wave point by point and then you would have very little control over the frequency. And, again as the specs clearly state, the fastest output rate you could expect is 150Samples/sec.

  • How to measure time difference between zero crossing of a sine wave and rise time of a pulse on a same graph?

    I have a 50Hz sine wave and a pulse signal on a same graph. The phase difference between two is between 0-90 degrees.
    Now I need to calculate the time difference between (when the sine wave crosses zero volts) and (when the pulse rises). The frequency will stay approximately same for both signals.
    The application is for a three phase generator. In simple words, when the time difference between the zero-crossing of sine wave and the pulse rises increases, that means that the load on the generator has increases.
    I am a beginner user of LabView (version 9, 2009), maybe it is a very simple problem but I've been pulling my hair out for the last few days and coudln't figure anything out. Any help would be greatly appreciated. I am using DAQ USB-6008 to measure these voltages and pulse from the generator and a sensor
    I have attached a jpg (a graph that i just made with excel to explain). The time 't' is what I am trying to measure
    Cheers
    Awais 
    Message Edited by awais.h on 03-30-2010 11:20 PM
    Message Edited by awais.h on 03-30-2010 11:21 PM
    Solved!
    Go to Solution.

    Hi
    Thanks for the code but I'm afraid it won't work. Like you said the probability of choosing a value that is on both graphs may not happen. This is something that I would like the code to do automatically.
    But I did use the previous code posted and made some modifications to it and it seems to work perfectly. Now the next thing is to be able to get just that one value that tells you the first time difference.
    Here is what I get using that code.
    As you can see from the t Values. I only need the one that is highlighted. If there is a way to filter out the rest it would be great.
    I was thinking of a while loop and as soon as the value is higher than 3E-5 it would store the number and stop the loop, but I'm not too familiar with arrays in labview.
    Here is the the code modified.
    As you can see, it wasn't that big of a modification and it still is your code.
    I will keep trying.
    Thanks for the help
    Attachments:
    FinalShockSpeed.vi ‏55 KB

  • How to get the sine wave sample of the input and output in the same time?

    I discovered that the samples were acquired did not in the same time in my vi.Could you tell me how to get the sine wave sample of the input and output in the same time?
    Output:9263;
    Input:9201
    Attachments:
    singal requency.vi ‏104 KB

    Hello Yun_Zhu,
    Your VI looks like you started from an example, and you are on the right track. 
    To clarify are you trying to synchronize the input and the output waveforms?  If you you will need to share a time base and a start trigger.  Check out the synchronization examples from LabVIEW
    Anthony F.
    Product Marketing Engineer
    National Instruments
    Attachments:
    HIODAQmxSyncMultiDev.png ‏70 KB

Maybe you are looking for