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

Similar Messages

  • Ni5401 how to generate 4 cycles of a sine wave at a time

    I'd like to generate 4 cycles of a 100kHz sine wave using a ni5401.  I'm currently able to generate a sinewave at 100kHz countinuously, but I need to stop after 4 cycles and then do some other processing and then restart another 4 cycles and then stop etc...  any help is appreciated

    hi htch,
    Unfortunately this isn't really the ideal application for a 5401. This application is something that could be accomplished fairly easily with an arbitrary waveform generator, or even a multifuction DAQ card, as long as it had a sample rate of at lease 2 MS/s. The 5401, however, is an arbitrary function generator, which means that it is meant to generate continuously, not a finite number of samples. 
    What you could try to do is use software timing to exit the loop after a certain amount of time has elapsed. However, you must keep in mind that software timing is not as accurate as hardware timing, and you may not generate exactly the amount of samples that you expect. 
    Regards,
    Leah
    National Instruments
    Applications Engineer

  • Generating a sine wave using PXI 5441

    How to generate a sine wave using PXI 5441 (Arbitrary Waveform Generator)?
    Can anybody post a vi that generates a sine wave with frequency at a user defined frequencies.
    Thanks in advance.

    Hi Venki,
     When using an arbitrary waveform or user-defined
    waveform, you provide the actual waveform you want to generate to
    the device, so it is easy to also just connect a graph to the waveform
    and see what it looks like. Unfortunately, when using standard function generation (which is the method used in this example), you are not providing a signal that is created in software. Because the standard function
    generation is happening on the FGEN and not in software, there is
    really no way to display the exact signal without measuring
    it on a scope or some device. You can, however, simulate the signal in
    software such that the parameters which are given to the FGEN functions
    are the same parameters that you use to generate a simulated wave. This
    would be somewhat complex since you can change parameters such as
    frequency and amplitude on-the-fly, and also you would need separate
    functions for each of the different signal types available for the
    FGEN. You would need to place the software waveform generator in your
    inner loop and have a waveform graph connected to it in the loop as
    well to display the signal. The main thing to keep in mind is that this
    will only be a simulated signal and so it may not exactly match what is
    being generated (this also depends on how you program the simulation to
    work). Hope this helps,
    Daniel S.
    National Instruments

  • How do i measure the frequency of a sine wave using a field point counter module

    I need to measure the frequency of the sine wave using field point. is it possible and if yes how. do i need to convert the sine wave signal to square wave. Please let me know.

    It probably would be easiest to convert the sine wave to a square wave with a simple external circuit and then use a counter module to measure the frequency. There is a shipping example in LabVIEW that shows how to measure frequency with a FieldPoint Counter module.
    JRA

  • How to generate a chirp(linear FM) signal using dds theory in LabVIEW FPGA.

    how to generate a chirp(linear FM) signal using dds theory in LabVIEW FPGA.
    attachment:a sine signal using dds theory. Hope to get some help. Thanks!
    Attachments:
    FPGA DDS SineGen IP.vi ‏42 KB

    you need to increment the "accumulator increment" during the duration of the chirp.  the "accumulator increment" controls the frequency of the DDS cycle.  by increasing it's value, you are increasing the frequency.  the math for increment values follows the same math as determining the frequency to increment value.
    Stu McFarlane
    Viewpoint Systems, Inc.

  • Simultaneous updation of sine wave using 2 PXI-6711 cards using RTSI Trigger

    Hi ,
    How to generate continuous sine wave using two pxi-6711 cards at same time without any phase shift using traditional nidaq functions.
    Regards,
    satya

    In LabVIEW, go to Help>>Find Examples. Navigate to Hardware Input and Output>>Traditional DAQ>>Multiple Device. There is an example there called "Two E Series Shared Scan Clock". That example is for analog input, but you should be able to modify it to be for analog output. Basically you will just have to share the scan clock from one board(master) and use it as an 'external' clock for the other board(slave).
    -Alan A.

  • 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

  • Trasnmitting a single sine wave using USRP

    how do i transmit and recieve a single sine wave using USRP...i would really appreciate it if someone posted that example
    i already understand the blocks of the usrp...but do i need to modulate the sine wave signal or i will just send it..i am really confused
    i hope that you may post the example

    Hey Eldokch,
    See step 4 in the following white paper:
    http://www.ni.com/white-paper/13880/en/#toc4
    It uses two examples packaged with the NI-USRP driver, "niUSRP EX Tx Continuous Async.vi" and "niUSRP EX Rx Continuous Async.vi".
    -Jim B
    Applications Engineer, National Instruments
    CLD, CTD

  • How to count the number of cycles in sine wave

    Hi,
    I am new to Labview.  I have labview 8.2 version and my dataacquisition is NIDAQPAD6015.  I could write a program to generate a sine wave of desired frequency through simulate signal. My question is how do i measure the number of cycles for this sine wave as soon as I run the program. Hope my question  is clear.
    Ravi Mokirala

    To find the offset (which in this case is the Y value midpoint around which the sine wave is symetrical):
    Capture more than one cycle.  Find the min and max values.  Subtract Min from Max and divide by 2.  Then subtract this result from the Max value (or add the result to the Min value).  This is the offset.
    To count the number of cycles where the offset is unknown, just use the first data point value as a reference.  If the next data point is more positive, then count the number of times that the first data point is repeated and the next data point is more positive.  Of course with DBL data type, you probably would not get the exact same value as the first data point, so you need to use In Range with a very tiny limit.  It all depends on your signal amplitude, frequency, and sampling rate.
    Example:  Lets say your first data point value is 0.5 and the 2nd point is 0.55.  You need to look for another value that is between 0.48 and 0.52.  Then read the very next data point value.  If it is greater than the previous value, add one to the cycle count.  If it is less than, you are at half a cycle, do not add to the count.
    - tbob
    Inventor of the WORM Global

  • How can I generate a smooth continuous sine wave

    I am trying to build a single frequency active noise control system to
    control a tonal acoustic disturbance. In order to do this I need to be able to
    drive a set of loudspeakers with a single frequency waveform which will be
    continuously adapting at each sample.
    The control system will ideally be implemented to control low frequency
    tones, 700-1000Hz, and thus sampling rates of below about 4000Hz should be
    sufficient for the task.
    However, when trying to continuously generate a waveform at an update rate
    of 4000 updates/sec the resulting sine wave output from the DAQ card when
    observed on an oscilloscope looks very much like a digital signal (a sine
    wave containing large "steps" in the voltage), as if there
    has been no
    smoothing in the DAC. Playing this through a loudspeaker results in a very
    "buzzy" sound and not a single frequency tone. Only when the update rate
    is much higher >50000 updates/sec, does the signal start to sound like a
    single frequency tone.
    I would much rather be able to implement the control system at a sample
    rate of 4000Hz than >50000Hz. How do I therefore guarantee a smooth analog
    sine wave output at the lower sample rates? Is this a labview problem, or
    a hardware problem?

    Is this a labview problem, or
    a hardware problem?"
    Problem?
    Well it actually the nature of the beast. As a rough rule of thumb, the signal starts to become smooth when the update rate is at least 10X the highest frequency present in your signal.
    The human ear is amazing in its ability to detect (hear) higher frequency components. This is the buzz you hear.
    If you want to keep your update rate low, then you may be able to get away with a low pass filter on the output from your DAQ device. An appropriately size cap and resistor may be all you need.
    Ben
    Ben Rayner
    Certified LabVIEW Developer
    www.DSAutomation.com
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Generating a 6X Sine Wave using an absolute encoder

    How do I get an Analog Signal Generation Synchronized to six times the frequency of an absolute nine bit parallel encoders output with adjustable phase relation. I am using a PXI-6533, a PXI-6711 and have available a PXI-6070E.
    Now the long version of the problem. I have a 9-bit absolute encoder connected to a motor shaft (up to 420Hz). From the encoders 9-bit (0-511) parallel signal I need to create a synchronized 6X sine wave (up to 2500Hzwith an adjustable phase relation. Picture an electronic timing chain. For every cycle of the encoder, I need to produce six full sine wave cycles with a variable tuned phase shift. I have LabView 7 w/RT.
    I have tried to use the Update Clock (PFI5) to step through a buf
    fer but it seems to drop an update every so often. I also have tried to monitor the bit-0 line to determine freq. and scaled the update rate accordingly but the phase shifts all over the place. Does anyone have any ideas on the matter ? I would really appreciate it! Thanx….Phil

    Phil,
    Another different option to solve your application would be to use the new LabVIEW FPGA module and the 7831R reconfigurable I/O hardware. Using these tools you can configure the FPGA on the board to generate the sine wave based on the 9-bit parallel input. The most simple setup would be to have a lookup table in the FPGA that has a corresponding output value to each of the 512 possible input values. This 512 sample table would contain 6 cycles of a sine wave. Every time the parallel input changes the analog output value would be updated accordingly from the lookup table. This setup would also allow to easily add a phas
    e shift of the output by shifting the point in the lookup table you are reading by a known constant.
    Christian L
    NICS
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • How to generate multiple digital outputs (square waves delayed) at 50 kHz?

    I would like to generate 3 digital outputs like the picture attached at 50 kHz. Using the "digital pattern generator (marching values).vi", I can generate 3 digital square wave but without the delay time. How can I do that?
    I'm using the card PCI 6034E.
    Thank you
    Attachments:
    digital outputs delayed.png ‏8 KB

    Hi,
    the digital pattern generator (marching values) only shifts the binary value of the first signal and sample to the next signal/sample.
    Have you tried generating your waveforms via build waveform and use t0 terminal to change the lead delay?
    In general, this DAQmx example could be helpful which you can modify to your needs.
    DAQmx Write Digital Channel- External Clock: https://decibel.ni.com/content/docs/DOC-11142
    Regards,
    Thomas

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

  • 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

  • How to generate jasper report in pdf format using swing

    hi all,
    im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
    1)delegate:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
    return generateReportDto;
    2)sessionBean:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    //Map parameters = new HashMap();
    ReportManager reportManager = new ReportManager();
    3)ReportManager()
    public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
              Connection conn = null;
              try {
                   conn = dataSource.getConnection();
                   //Generate the report to bytes
                   File reportFile = new File(fileName);               
                   byte[] bytes =
                        JasperRunManager.runReportToPdf(
                             reportFile.getPath(),
                             parameters,
                             conn
              //conn.close();
              //Write the bytes to a file
              ByteBuffer buf = ByteBuffer.wrap(bytes);
              File file = new File(outputFileName);
              // (if the file exists)
              boolean append = false;
              // Create a writable file channel
              FileChannel wChannel = new FileOutputStream(file, append).getChannel();
              // Write the ByteBuffer contents; the bytes between the ByteBuffer's
              // position and the limit is written to the file
              wChannel.write(buf);
              // Close the file
              wChannel.close();
              } finally {
                   if (conn != null) {
    conn.close();
    Any help would be highly appreciated. Thanks in advance

    Hi ,
    One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
    Read for further info in 'PL/SQL Packages and Types Reference'.
    If you have access to OEM ... you can configure this there using wizard.....
    Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
    http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
    My greetings,
    Sim

Maybe you are looking for

  • HP LaserJet 4300 prints gibberish for one user, but prints OK for all others on a Windows 7 32-bit

    HP LaserJet 4300 printer installed via LPT1 using Universal Print Driver v5.2.6.9321 on an HP 8100 desktop running Windows 7 Enterprise SP1 32-bit. For one particular user, this printer prints gibberish no matter what type of document she attempts to

  • Populate table control in maintenance view

    Hi all, I need to load data from an excel file and then call the maintenance view from a table through SM30 transaction, I want to see the data from the file already loaded in the table control, any idea how could I achieve this? I don't know how cou

  • BUG: 1.4.1 beta doesn't like to be in an IFRAME that moves.

    If you are using 1.4.1 beta in an IFRAME which position can be moved by javascript for instance, the plugin will grey out and not refresh. 1.4.0 work perferctly in this regard.

  • ITunes Only Runs with Anti Virus disabled

    I had the same problem a lot of people are having when upgrading to the latest iTunes. I have reinstalled QT and iTunes separately and have finally gotten it to run. My problem now is that iTunes only opens if I have Norton Internet Security disabled

  • SQ01 query with identical lines

    I have an issue where existing queries which have worked fine before, but now display identical lines randomly. I am not able to figure out any specific reason why a specific line is repeated again with the same data. these queries are by document nu