Play sine wave with soundcard on CVI

Does anybody know how to generate sine waves with the soundcard ?
Thank you for your help.

Diver,
The way to go here is the Windows SDK. First make sure that you have the Windows SDK installer; go to the help menu and you should be able to select Windows SDK . If you don't have that option then you need to run the installer again and change the installation to include the Windows SDK.
Once you have this running there are a couple of ways you can do this:
Play a WAV file: this is the easy and fast way of doing it; record or generate the WAV file with any simple sound editor and use the function PlaySound() from the Windows SDK to play strait from the file (you can find more info about the function in the Windows SKD help file).
Play generated data using lower level soundcard functions: this is not as easy, but gives
you the most flexibility; you basically open a session with the sound card and write data to it. I'm attaching a very basic example that can get you started.
Use Media Player to play a file: you can use ActiveX to embed Media Player in your UI and use it's capabilities to play wav files. CVI has a good shipping example about this, you can find it here.
You can request this feature for future version of CVI; go to http://www.ni.com/contact and select product feedback to submit your request.
In the mean time I hope this helps you get started.
Regards,
Juan Carlos
N.I.
Attachments:
WaveOut1.c ‏2 KB

Similar Messages

  • How can i do a sine wave with High Throughput Sine for fpga?

    I try to do a sine wave looking the examples but i can't. I have a sbRio 9606. 
    I need to do a sine wave with high throughput block. In my exercise i have 2 inputs (amplitude and frecuency) and i have to look the output (sinewave)
    I need help!!

    Hi pablosan,
    If I understood correctly, you want to generate a sine wave with a high throughput block in Labview FPGA.
    I'm afraid you won't e able to do this, as these blocks are specifically designed for other FPGA targets with better features for high performance. So instead of using the example named "Sine and Cosine.lvproj" under High Throughput examples, you can use the "Sine Wave.lvproj" under Signal Generation and Processing examples, which is more adequate to your Single-Board RIO.
    Regards.

  • PXI-5406: unable to generate 10 mV p-p sine wave with 1.5 V dc offset

    I'm using the PXI-5406 and FGEN Soft Front Panel to output a low amplitude sine wave. It works fine when I have the amplitude set to 10 mV and the DC offset set to 1V but when I increase the dc offset (I want it to be set to 1.5V) the FGEN front panel reports an error and stops outputting the wave. It starts working when I have the DC offset set to 1.5V and the amplitude increased to 50 mV. Any ideas on how to output a sine wave with 10mV amplitude (p-p) and 1.5V dc offset with the PXI-5406?
    Thanks,
    Rachel

    I also wanted to mention that while using the FGEN Soft Front Panel, some of the settings are coerced to set values (particularly Digital Gain). Is it possible for you to use the driver API through LabVIEW or another program? This would allow greater control and a potential workaround.(set Gain to a value less than one (0.25) and the Amplitude to a value to 40mV).
    Evan S.
    National Instruments

  • Generate and record sine wave with GB

    Is there a way to generate and record a sine wave with GB? I need to record a 20khz tone and put it to track. Thanks!

    Thanks. The purpose of this was to 'fool' the horrible compressor/encoder over at Youtube. Inserting a 20khz tone in the mix tricks the compressor and effectively bypasses Youtube's butchering device. What I did was downloaded Audacity (free) for Mac. Audacity has a 'generate tone' capability which can be recorded. I then 'exported' my 20khz tone as a wav file and 'imported' same into my GB mix. Et voila! I can now mix my sine wave tone to the specified 'workaround' levels which I had seen posted on the net. ~King

  • Problems graphing FFT of sine wave with Waveform Graph

    I know that this type of question has been posted
    many times, so I apologize for posting a similar one. Unfortunately,
    after reading quite a few threads I still have a question or two.
    Basically, I need to use a Waveform Graph (not an XY graph) to graph
    the magnitude of an FFT of a sine wave. I can't figure out which VI I
    should be using to obtain the magnitude of the FFT. I think I'm using
    the proper FFT vi (just the regular FFT.vi), but I can't find a VI
    dedicated to magnitude. Of course, I could be misinterpreting the
    pseudocode which I am following.
    If you
    wouldn't mind taking a gander at my VI, I'd appreciate any input you
    might have. The pseudocode is contained in the block diagram. You
    can see that I have another graph for just the sine wave, and I think
    that works as it should. I'm primarily concered about the waveform
    graph which isn't currently connected to anything, but should
    eventually be hooked up to the FFT.
    Thanks!
    Attachments:
    Labview5.vi ‏199 KB

    Your problem is that the output of the FFT is an array of complex numbers. Take the magnitude and you will be able to plot it.

  • Help needed with generating a sine wave with NI-5640R card

    Hi there,
    I have created a simple programe using the 5640R card, and i am attaching the programe to this question. Using a "sine generation" function/block i am generating a sine wave and outputting to one of the o/p ports and then i am connecting that o/p port to one of the i/p ports using a cable. Then i am plotting what ever i have recieved through the i/p port (this has to be same as what is generated using "sine generator" ). The graph shows that i am not receiving aything from the i/p port, but when i plot the o/p of the "sine generator", i see that the sine generator is generating the sine wave. Please refer to the attached figure and please tell me what mistake i have made in this simple programe.
    Thanks,
    Sandeep.
    Message Edited by sandeep palreddy on 07-08-2007 12:46 PM
    Sandeep Palreddy, Graduate Research Assistance
    The Microwave Remote Sensing Laboratory (MIRSL)
    University of Massachusetts
    151 Holdsworth Way
    Amherst MA 01003-9284
    Attachments:
    figure.doc ‏27 KB
    figure.doc ‏27 KB

    Hi sandeep
    This small segment of code will not work on the NI PCI-5640R.  This module does not support running the FPGA Vis directly.  A Host VI must be run that calls to the FPGA Vis.
    I suggest that you look at the ni5640R Analog Input and Output example that is installed by the NI PCI-5640R software. 
    Jerry
    PS: Make sure that you are using the NI PCI-5640R software version 1.1.

  • Generate two sine waves with time delay

    I have not been using the waveform generation tools so I hope this is an easy one for somebody.  I want to create two sine waves at different frequencies say F1 = 1.00 KHz and a second at F2 = 1.20 KHz.  I know that to combine them into one I can just add them.  Them problem I have is that I want F1 to start first then a few millisecond later have F2 sum into F1.
    T0 = F1
    T0 + Delay = F1 + F2
    Is there a VI capable of a time delay?  Tried to sum individual signals together but seems more difficult because of the waveform cluster format.
    Any help is appreciated,
    Matt
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

    Would the attached VI work for you?
    Attachments:
    Add Delayed Sinewave.vi ‏54 KB

  • Test Bench generating sine wave with noise when simulating Compact Rio on Dev Computer

    How do I create a simulated IO vi. I have tried to follow the tutorial but it didn't work. Do I need a pre filled array with data for the running case or can I generate it with an express vi? My IO vi doesn't seem to enter Running case ever. What is the process of executing this VI? is it run once or every time the main vi tries to sample some data?

    Hello I've a similar problem. I want ot simulate a sinusoidal input for my cRIO and I followed the example about the Dynamic IO generation but when I launch my VI with the light bulb on for every iteration I get the same value for my Module.
    Here are my VIs

  • Measure a Linear Scale Unit, with sine wave signal

    I have a Linear Scale Unit, with three outputs, Phase A, Phase B and Scale ABS point. The outputs signals are in sine wave, with Phase difference of 90º. I have a NI PCI-6034E, and I don't know how to read that signals and convert them in mm and also put them in LabView program. I only find Quadrature Encoders. I don't know if it is better read the signal by the counter or analog input line.
    Thanks and Best Regards

    Hi Luis,
    If your inputs are sine waves, you're probably best off using analog input, though if the voltages are correct, you might be able to use counters.
    The conversion from the voltage outputs to mm distance is dependent on the sensor, so you will have to look in its documentation or search the web to find the parameters for your device. Once you find these values, you should be able to convert with a pretty simple LabVIEW application based on the input signals, either using their exact values or counting cycles, whichever is appropriate for your sensor.
    If you need more help with the conversion, please post more detailed information on the encoding of your sensor.
    Thank you,
    Kyle Bryson
    National Instruments

  • PXI-board only returns perfect sine wave

    Hi, everyone!
    This is a strange one:
    Im peforming synchronized sampling from two boards; one is a PCI-6224 in my computer and the other a PXI-6229 located in our PXI-system. Being a rookie when it comes to labview, I was quite proud of myself for managing this all by myself. However, when i looked closer at a 10 sec test-record I noticed something peculiar. Although none of the 32 (differential) channels had inputs during the recording, the PXI-board returned 16 perfect 1 Hz sine waves with exactly the same amplitude as the measurement range. Attaching a signal to the terminal block didn't alter this. The PCI-board returns only weak 50 Hz (power network) noise, as expected. What is going on ??
    I'm using a PXI-1031 chassis together with a PXI-8184 controller connected to the PC with a network cable. I trigger the pxi-board by sending the PC-clock through a PFI-port and a physichal wire.
    regards, Einar

    As I said, I haven't used LabVIEW 8 all that much. It's a bit tricky: you'll have to make a new Project, add the PXI as a new Target, and the add the VI you're trying to run underneath the new target. The last time I was playing with this I also had to open some ports in the Windows XP firewall.
    If this is all a bit much for you, you might have a PXI controller that is configured to dual-boot both LabVIEW RT and Windows XP. If you reboot the controller in Windows XP mode, you can then access the PXI-6229 in the same way you currently access the PCI-6224... provided you don't mind copying the VIs over and hooking up a mouse, monitor, and keyboard to the PXI.
    Switching from LV RT to Windows XP is most easily done by selecting the appropriate option in the PXI's BIOS. Check your PXI controller's manual for details.

  • Generating sine wave

    Hello,
    I have a small labview problem.
    I want to generate a sine wave pulse with labview and send this to a pc oscilloscope by using my soundcard.
    First VI I made creates a sine wave and sends it to the pc oscilloscope. Works perfectly.
    But now i want to create a sine wave with only one period (second VI). Problem is then that the VI blocks if i want a high frequency (I need 10kHz)
    So the VI works on low frequencies but gives this error with higher frequency:
    "the sound driver or card does not support the desired operation."
    Can somebody give a solution for my second VI (creating sine with one period on 10kHz).?
    Thanks in advance!
    Jelle
    Solved!
    Go to Solution.
    Attachments:
    GeneratingSineWaveManyPeriods.vi ‏59 KB
    GeneratingSineWave1period.vi ‏37 KB

    Hello Benje,
    The problem/difference you're seeing is indeed in the coding and also in the sound card.
    In the "working" example you're using the Simulate Signal VI with the following settings:
    - 44100 samples per second (sample rate)
    - Number of samples 10000 (samples per generation cycle)
    In the non working example you specify:
    - sample rate = 1000*"Frequency Control value". This sampling info should be fixed to (for example) 441000 Hz.
    - Number of samples 1000 (samples per generation cycle)
    As a sidenote:
    Is there any reason why you used different functions to generate similar signals in the 2 VI's?
    Kind Regards,
    Thierry C - Applications Engineering Specialist Northern European Region - National Instruments
    CLD, CTA
    If someone helped you, let them know. Mark as solved and/or give a kudo.

  • LabVIEW FPGA Sine Wave Generator Reset Input Behavior

    I would like to know what the output from the Sine Wave Generator express VI is while the reset input is true, and what happens to the output immediately after the reset input is set false.
    I need to generate a regular sequence of positive half-cycles of a sine wave, with an arbitrary delay between them that is not related to the actual frequency of the sine wave. So my plan is basically to periodically fire a trigger in the fpga software that resets a sine wave generator and directs its output to an analog output until the sine wave goes negative, at which point the analog output is set to 0 until the next trigger.
    Thanks

    Muchas gracias por responder steve.bm
    El problema que tengo es el siguiente, estoy desarrollando un proyecto en el cual uso los conversores DAC y ADC de la  tarjeta FPGA Spartan 3E para lo cual use como base el proyecto que esta subido por la NI que se encuentra en uno de los enlaces que me dejaste,( Lesson 8 - Linking Existing VHDL Code from WebPACK into LabVIEW FPGA) del mismo solo modifique para usar el ADC y el DAC mediante el cual adquiero una señal senosoidal y la tengo que reconstruir, el problema es que como uso un generador de señal de laboratorio al ingresar la frecuencia de muestreo para obtener una buena reconstruccion, la frecuencia se baja lo cual en el proyecto real no podra pasar ya que la frecuencia ya en proyecto final la adquiero de la red electrica publica pero ahora para pruebas estoy con un generador, la verdad no se que pasa porque tiene un retrazo la señal.....
    Te parece si te puedo dejar mi proyecto subido en enlace para que lo revices ??

  • Sin wave generation for R series FPGA

    Dear All,
    I am generating sin Wave with (FPGA Sin Wave Generation Express vi) from Rseries FPGA Target.Frequency range is from 1500Hz to 3000Hz.Frequency and Amplitude parameters are coming from Host .Wave is going to an AO.The wave is not displaying in my Host with the set parameters as required.
    What am I doing wrong??
    Certified LabVIEW Architect
    Certified TestStand Developer

    Hi,
    I am using NI 9263 4x AO.the problem was with the FPGA Express vi Parameters used the example sin wave Generation from the FPGA fundamental folder and modified the Host parameters to meet our requirement and it worked fine.
    Thanks
    Certified LabVIEW Architect
    Certified TestStand Developer

  • Measuring Superimposed Frequencies on a Sine Wave

    Hi,
    Just looking for advise on the best way to measure superimposed frequencies on my raw data. The raw data (voltage versus time) is ultimately a noisy sine wave with a frequency of 1Hz. I need to determine where the noise is coming from, i.e. is it vibrational, electrical or surrounding noise, hence requiring the frequency of the noise if possible.
    Any advise on the best way of filtering the data would be appreciated. Currently I am using a butterworth filter with a cutoff setting of 1.5Hz. The original data was sampled at 1.5KHz so the noise was measured and so could be filtered during postprocessing.
    Also when filtering I don't want to loose important data i.e. sudden peaks or drops.
    Regards,
    John.

    John,
    Have you tried spectrum analysis of your data? That will give you the frequency content of the signal plus noise. One peak will be at the 1 Hz sine signal and other peaks will correspond with the supeimposed signals. With a 1.5 kHz sampling rate you would get information on frequency content up to the Nyquist frequency of 750 Hz. A peak at 50 or 60 Hz will likely be power line frequency interference. Gears, bearings, and motor armature slots produce characteristic frequencies which are related to the rotational speed.
    Lynn

  • How can I get stable Sin wave through NI 9264 ?

    Dear all,
    I would like to generate 64 analog sin wave with frequency up to 20K Hz.
    Then I bought 4 NI9264:
    25 kS/s/ch simultaneous output
    Hot-swappable operation
    Spring terminal or D-SUB connectivity options
    250 Vrms isolation (spring terminal version)
    60 VDC isolation (D-SUB version)
    .The attached is my file for the generation. when I used Osciloscope to monitor the output, I could not get any stable output.
     Could I have the reasons and suggestions for my objective please?
    Thanks!
    Zhu_nuo
    Attachments:
    64 Channel Programmatic v2.vi ‏22 KB

    Hi Zhuming,
    The VI above only provides waveform information for a single channel. In order to output data across all 64 channels in the task, we can make use of a For Loop to build an array of waveform information for each channel. In the example below, I've made use of an Auto-Indexing For Loop in order to build up a waveform output array of 64 elements. I've wired this to an NI-DAQmx Analog 1D Wfm Write VI; the 1D array's elements represents each channel in the group of selected channels for generation.
    An important thing to note is that the NI 9264 16 channel analogue output modules have a maximum sample rate of 25 kS/s/ch. This means that each channel is capable of writing 25kS/s simultaneously.
    To reliably generate a signal, we generally need to have it comprised of around 5 to 10 points of data. This allows us to represent the signal to a good degree of accuracy. For example, if I wanted to reliably output a 1Hz Sine Wave, I would need to break the 1Hz wave into ten separate points and then output them at a rate of 10Hz. In terms of the NI 9264, the maximum frequency content (Two points of information) that can be generated is 25kHz/2 = 12.5kHz wave. The maximum clear wave frequency that we could produce with the 9264 (A wave built up of ten points) is 2.5kHz simultaneously across each channel. This is all to do with Nyquist's Theorem. This should explain why the frequency appeared to drop.
    Out of interest, how are you measuring these output frequencies?
    Kind Regards,
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

Maybe you are looking for

  • Adobe Reader 9/Mac OSX 10.5.4/Internal Error after installing

    Just purchased a new iMac with OSX 10.5.4 installed. I have 2.4 GHz Intel Core 2 Duo with 4 GB 667 MHz DDR2 SDRAM. Acrobat Reader v8.x won't run, so downloaded and installed v9 from the official Adobe web site. When I attempt to launch Acrobat Reader

  • [Jdev11gR1]: Insert taskflow run as dialog and window (X) Close button

    Hi i have taskflow to insert some data into database and i have (commit and rollback) buttons it is run as external dialog using (dialog:nav) when i press commit and rollback every thing good but if i press X button to close dialog , i find row added

  • Acrobat Pro 10.1.1 network issue

    Hi everyone, Im having an issue with Acrobat Pro X. About two weeks ago we did a server migration. Since then everyone (about 60 people) have been running into a performance issue with Acrobat X. Everyone uses Word 2007 and the office plugin to creat

  • S415 Can't connect to wifi.

    I purchased an ideapad s415 and u530. the u530 and other devices including smartphones and xbox one can connect to the internet via wifi. The s415 however cannot. ive updated the driver and it hasnt worked. im on windows 8.1.

  • Annoying popup _mmServerScripts

    While working on a site that was migrated from a now defunct computer, I am constantly getting this message in a dialog box that I am forced to respond to: "Dual867C2ROOT  is currently working on _mmServerScripts/SQLServer7.cfm (or some other file na