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

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

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

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

  • 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 can I fix a dbwrap.exe error that prevents a SharePoint 2010 installation?

    Every time I attempt to install SharePoint 2010 on my Windows 7 64-bit laptop I get the following error in the setup log:
    'dbwrap.exe' failed with error code: -2068578304. Type: 8::CommandFailed.
    The installation aborts.  I need more information.  How do I fix this problem?J Tom Kinser

    thank you so much Yuming.
    I get the same issue while installing Sharepoint on Win 7. I check out error logs and get to know it's SQL Server Express issue.
    First I found this in DBWrapLog log:
    INF:0:Cannot find sql express instance. Do fresh install.
    INF:0:Try to install SQL Express.
    INF:0:Entering function RunCommand
    INF:0:Starting process C:\Program Files\Common Files\Microsoft Shared\SERVER14\Server Setup Controller\sqlexpr.exe with args  /q /HideConsole  /ACTION=install /pid=11111-00000-00000-00000-00000 /FEATURES=SQL,Tools /SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS"
    /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /INSTANCENAME=SharePoint /INSTALLSQLDATADIR="C:\Program Files\Microsoft Office Servers\14.0\Data" and waiting 00:49:10 for it to stop
    ERR:-2067919934:Leaving function RunCommand
    Then I start my SQL Express instance and run Sharepoint setup to repair. However I got this error again in DBWrapLog:
    INF:0:Entering function RunCommand
    INF:0:Starting process C:\Program Files\Common Files\Microsoft Shared\SERVER14\Server Setup Controller\sqlexpr.exe with args  /q /HideConsole /ACTION=Repair /INSTANCENAME=SharePoint and waiting 00:49:10 for it to stop
    ERR:-2068643839:Leaving function RunCommand
    INF:0:Try to config SQL Express instance.
    INF:0:Grant Exec Right for dbo.sp_add_job
    INF:0:Data Source=.\SharePoint;Initial Catalog=msdb;Integrated Security=True;Pooling=False
    WRN:0:Fail to config in the number 1 try, will sleep 10 seconds and try again. The exception is System.Data.SqlClient.SqlException:
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
    (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
    up to here, I get stuck.
    Can I consult this: How do you know to change value from reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\ServerRole. And what does this mean?
    Another Leon

  • How do I fix a recent cd purchased that has an incomplete track?   Song starts and then cuts off and skips to next track.   Anyone know what I should do to rectify?

    How do I fix a recent purchase from I Tunes?   Track 4 stops after ineminute of play then skips to track 5.  Not sure how to rectify.  Do I need to delete and re download?   Don't wat to get charged 2x for same CD.   Anyone know what I need to do?

    If you live in a Region that allows re-downloading Music...
    Delete the Song(s) and re-download...
    See Here  >  Download Past Purchases
    http://support.apple.com/kb/HT2519
    If not... Contact iTunes Customer Service
    Apple  Support  iTunes Store  Contact Us

  • How do I fix corrupted fonts in firefox that ALL other browsers display perfectly fine?

    How it looks in firefox: http://i47.tinypic.com/334rki0.png
    How it looks in crome (and is supposed to look): http://i47.tinypic.com/5xo1ow.png
    I'm on firefox 20.0.1 on a Mac running mountain lion 10.8.3.
    How do I fix this?

    Hello,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • How do I fix an "activation required" message that is caught in a loop?

    How do I fix an "activation required" issue on my ipad? I seem to be caught in a never ending loop.

    Reboot
    Hold the home and screen lock buttons down until you get a white apple. May take  quite a few seconds

  • How do i fix the disk repair error that pops up when i plug my iPod into my computer?

    every time i plug my ipod into my mac a "Disk Repair" error pops up. how do i fix that?

    Try a low level reformat of your iPod using Disk Utility and the instructions in this article.
    http://www.methodshop.com/gadgets/ipodsupport/erase/
    B-rock

  • 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

Maybe you are looking for

  • How do i use USB 2.0 with an iBook G3?

    I have a WD external hard drive that operates through USB 2.0 and want to use it with my iBook G3. I thought this wasn't possible since it has the old USB ports, but saw the post 28081 which I think says it is. It said you could use the old USB ports

  • In DB13, error occured after trigger Verify Database.

    Dear All,      The following is the job log of the Verify database, i am not sure why this error occured.       I am using BRTOOLS 7.10 (12), SAP NetWeaver 2004s. Job started Step 001 started (program RSDBAJOB, variant &0000000000927, user ID BASISAD

  • Slow moving item report-BW

    Hi guys,             Regards.We got a requirement: 1).The user inputs the "No. of Days since consumed" and the Customer exit code would calculate the "Result Variable from Current Date" and populate "SLOWMOVDATE". 2).We want the Stockvalue against th

  • Trying to center text in a text box

    I have just upgraded from InDesign CS2 to CS4. I am trying to center text vertically in a text box. I remember in CS2 that there were three different buttons, one that would center it at the top, one that would center the text in the middle and one o

  • Javascript on website not loading

    http://fibrenaturelle.com/index.php?option=com_jestockist&view=jestockist&Itemid=171 using a Joomla component to display list of stockists. When you click on an area customers are complaining that the 'loading...' stays and no stockists details loads