Unable to generate sine wave

Hello everyone!
I am currently working on my Bachelor project at a company. i am stuck with a problem.
I have designed a labview program for vibration test system. I have used cRIO 9076 as the controller with NI 9263(as D/A) and NI 9234(as A/D).
The loop works as follows. the input is given from the labview program. it is then sent to the cRIO. the output of CRIO(that is output from NI 9263) is given to the amplifier. the vibration shaker vibrates based on the input from aamplifier. then the accelerometer detects the vibration and sends it to the NI 9234 and loop repeats iteratively. since i have designed a sweep sine vibration system, the output of cRIO is a square wave. it should be sine wave.
the probelm is i am getting a square wave as output from my NI 9263 which should be a sine wave output. I have two subVI where i use nominal to binary convertor(for NI 9234) and binary to nominal (for NI 9263) as calibration mechanism. 
the question is where have i went wrong? what should I do to get a sine wave? 
PS: on searching NI i found out some formulas (to generate sine wave) and designed a FPGA and LabVIEW program to generate a simple sine wave and got a sine wave. if that formulas is to be included where should i include that?
Thanks in advance.
Regards,
Vishal.

Without seeing your current code, there is no way we can even uess as to why you are creating a square wave instead of a sine wave.

Similar Messages

  • How to dynamically adjust Frequency, Phase and Amplitude for a Generated Sine Wave in C/C++?

    Hi,
    I wonder if anybody know how to dynamically adjust Frequency, Phase and Amplitude for a Generated Sine Wave in C/C++? This is a part of my project: I need to dynamically generate a sine wave voltage signal by some calculation using the data from a simultaneous analog input and another signal.
    Your help will be appreciated so much!
    Marlon

    Hello Marlon,
    Here is an example of changing frequency and ampliude for an E-series device in Labwindows/CVI. The programming should be similar in C for your S-Series device. As is says on the linked webpage above, this process is going to be very processor intensive since you will continually be creating a buffer.
    Nicholas C
    National Instruments
    Applications Engineering

  • 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.

  • How do I Fix DDS Generated Sine Wave That Produces a Periodic Square Wave?

    Hello,
    I'm an undergraduate researcher with almost no experience dealing with FPGA semantics and other National Instruments hardware in general.  Part of my project revolves around creating a sine wave signal via the FPGA on an sbRIO-9632 that is output via the board's analog I/O pins, and I found it convenient to adapt the code provided by the National Instruments tutorials (http://zone.ni.com/devzone/cda/epd/p/id/6066) to have it run on an sbRIO FPGA.  The problem I'm encountering right now is that the actual output I'm seeing is a square wave as opposed to the smooth sine wave that was expected, and I've exhausted all my ideas on possible ways to debug this issue.  Can anyone please give me feedback if they've seen this problem before or offer other suggestions on fixing this?
    I'm currently running LabVIEW 2009 with the appropriate real-time and FPGA modules on a 64-bit Windows 7 machine.  Again, the hardware is an sbRIO-9632 complete with analog I/O.  I appreciate it everyone!

    I am also having this issue and have not been able to find a solution in the forums. I am somewhat of a rookie so pardon me if I seem ignorant in any way. I am working on a graduate project where I need to produce some sine waves and I am getting more of a square wave when I output it and measure on the scope. The program I am running is quite simple at the moment to attempt to discover any errors by process of elimination. I have the sine wave generator in a while loop outputting to an AO port. I am using the cRIO 9022 with the 9269 AO module. I will attach screen shots of my code and my oscope image
    Attachments:
    sine wave.jpg ‏76 KB
    code for project.PNG ‏169 KB

  • Generate sine wave triggered by impulse?

    Dear all,
    i am new to this labview software and signalling field. Ineed help on the following assignment task.
         - Generate a 50Hz sine wave triggered by impulse with decay rate of 6rad/s
    I know it is a very simple program but i struggle to get the program done. Help would be much thankful.
    Regards
    Ken

    Actually, no hardware is used, we just need to virtually generate a sample sine signal that is triggered from impulse from functions in Labview. It is for analyzation usage.
    Decay rate is the signal will reduce by frequency of 6 rad/s or we put is as 6Hz for example.

  • Capturing min and max of a func. generated sine wave

    I need to identify (in real time) the min and max values of a continuous sine wave (whose amplitude may vary). I need to capture the value of each min and max and the time of each such occurrence.

    If the sine wave is in the form of a waveform data type, then all you have to use is the Waveform Min Max function. This does all that you want including returning the time values. There's even an example under Help>Fundamentals>Waveforms>Waveform Operations.

  • How do I fix slight distortion in background in generating sine wave

    I'm getting a slight distortion in the background when I run the following code, the distortion is very slight and sounds like buzzing. Because of its subtle nature it makes believe there is some sort of aliasing going on with the byte casting:
    Note: code assumes (for now) that the data is in big endian.
    Output:
    PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian
    (sound)
         public static void playFreq(AudioFormat audioFormat, double frequency, SourceDataLine sourceDataLine)
              System.out.println(audioFormat);
              double sampleRate = audioFormat.getSampleRate();
              int sampleSizeInBytes = audioFormat.getSampleSizeInBits() / 8;
              int channels = audioFormat.getChannels();
              byte audioBuffer[] = new byte[(int)Math.pow(2.0, 19.0) * channels * sampleSizeInBytes];
              for ( int i = 0; i < audioBuffer.length; i+=sampleSizeInBytes*channels )
                   int wave = (int) (127.0 * Math.sin( 2.0 * Math.PI * frequency * i / (sampleRate * sampleSizeInBytes * channels) )  );
                   //wave = (wave > 0 ? 127 : -127);
                   if ( channels == 1 )
                        if ( sampleSizeInBytes == 1 )
                             audioBuffer[i] = (byte) (wave);
                        else if ( sampleSizeInBytes == 2 )
                             audioBuffer[i] = (byte) (wave);
                             audioBuffer[i+1] = (byte)(wave >>> 8);
                   else if ( channels == 2 )
                        if ( sampleSizeInBytes == 1 )
                             audioBuffer[i] = (byte) (wave);
                             audioBuffer[i+1] = (byte) (wave);
                        else if ( sampleSizeInBytes == 2 )
                             audioBuffer[i] = (byte) (wave);
                             audioBuffer[i+1] = (byte)(wave >>> 8);
                             audioBuffer[i+2] = (byte) (wave);
                             audioBuffer[i+3] = (byte)(wave >>> 8);
              sourceDataLine.write(audioBuffer, 0, audioBuffer.length);
         }

    The data was actually LITTLE-endian, it become apparent when you use a larger amplitude (say 2^15).

  • Problem with distortion with DAQ Generating Sine wave

    Hello,
    I have a little problem with my VI who is made for driving a biphased stepper motor:
    When I change dynamically the output frequency of my DAQ Generaor, I have some weird effect (see picture). It happend progressivelly like this :
    (the start frequency doesn't matter)
    95Hz - nothing
    95-100Hz progressivelly grow
    100Hz :
    100-105 Hz degressive
    105Hz - nothing
    So I generate 2 phases with a rate of 1M and 100k for sampling. All other stuff are set with the same settings.
    My device is an NI USB-6356 (1.25MS/s/chanel)
    I have tried to set all things at 100k but when I do that my motor won't turn.
    Does anyone know why it does this ?
    Thank you in advance
    Attachments:
    Sub_Mesure1.vi ‏238 KB

    Hello Mike,
    I use 2 simulate signal setting in sine : see Capture2.png
    and both DAQ Gen and Acq : Capture3.png / Capture4.png
    Attachments:
    Capture2.PNG ‏39 KB
    Capture3.PNG ‏70 KB
    Capture4.PNG ‏73 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

  • Generate Sine wave using NIDAQ

    How can we generate sinewave using NIDAQ library fucntion in VC++.

    Hi,
    There are examples of creating a waveform in VC++ that come with the DAQ driver. They can be found here:
    C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ao
    In this folder you can select from any of the WFM examples, which will all create different types of waveforms on your Analog Output channel. There are descriptions of each example contained at the beginning of the program.
    Good luck, and happy programming!
    George

  • 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

  • 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

  • To generate sine curve using sine pattern.vi

    I tried to generate sine wave to provide sine curve to the motor. I used sine pattern.vi and the vi located before the while loop. I could not put it inside 'while loop' to change the amplitude of the sine curve while the program runs. What do I have to make some changes in the program to provide different values in 'sine pattern.vi' while the program runs?
    Attachments:
    AO_command_sin_input_with_position_info.vi ‏165 KB

    Jae,
    Looking at your VI, it seems that what you want to do is update the sinewave generated on the fly. Try using the Point by Point functions to generate a sinewave, they will give your the most flexibility. I am attaching an example that generates a sinewave point by point. If you change the value of the frequency control, you will see that the frequency of the waveform will change on the fly.
    Attachments:
    Generate_Sinewave_PtByPt.vi ‏32 KB

  • Please help simulation synchroniz​ing dual sin wave using PLL labVIEW

    Hello,
    Please I want a simulation based on Lab view for synchronizing generators, as we know that the generator will generate a sin wave.
    If anyone can help me with this idea the simulation can be done using to input sin waves and synchronized with each other using PLL (phase lock loop), note that the generators will be synchronized if the frequency, phase angle and voltages are equal ( synchronized). Please if somebody has simulation based on this idea to help me with it.
    THANK YOU A LOT.
    I will appreciate it.

    Iam new on LV. what i want a simulation to synchronize two generators, the two generators will generate sin waves this sin waves will be compared to achieve synchronization its better to use PLL but i have no idea where to use it in this such simulation.
    The below attachment will discuss more what i want but it it can be editted instead of using two generators from outside is to put to sin wave and prove that when this two sin wave are not equal so synchronization faild and vice versa.
    no need for the DAQ it can be replaced by an oscilscope to see the two sine waves that are synchronized, any one can help me by this simulation  i will bs very thankful for him.
    THANK YOU ANYWAY  
    Attachments:
    paralleling.jpg ‏145 KB

  • 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

Maybe you are looking for

  • Partner details is not updating in PO creation with reference PO

    Hi Team, my user creating a new PO with reference an old PO, and user  changed vendor in new PO then there is change not happening  in partner details of vendor in PO, these are coming old vendor's  partner details. so pl. guide me how we can update

  • Table control line selection issue

    HI im facing a problem in table control. I have a table control with selection column ( single ). First time when i select a row its is marked X in the internal table, Now again when i select another row .. The old row still holds the value X and the

  • Read fields from dynamic table

    Hello everyone, I'm a BW-guy with some ABAP background, but it has been a while since I've used field symbos. I'm writing an enhancement for a BI-extractor using a badi. This is the situation: I have a dynamic table <t_data> over which I need to loop

  • Segment field filters

    Hi All, I want to filter a VSTEL field in segment E1EDP01 in Orders IDOC type. I don't want to filter whole segment. Is there any way?please help SPK

  • Is there a way to remove the add box under the google searchbar on the "mozilla firefox start page" ?

    I always liked the standard google start page for firefox, but with this new 4.0 there's an ugly add box below the search bar, nagging about "learn about all the cool things" or something named "Spark" or all sorts of other spam. So is there a way to