Daqmx functions generate a waveform

I need to use the daqmx functions to generate a waveform.  The waveform specifications...
Square wave...min voltage 5V, max voltage 8V...50% duty cycle...2kHz frequency...run continuously.
What daqmx functions do I need to use to generate this square wave?  If this has been covered in another thread, I apologize.
Jeremy

Hi jjsomer,
There are a couple of example VI’s that you can use for that, you can go to the NI Example Finder » Hardware Input and Output » DAQmx » Analog Generation » Cont Gen Voltage Wfm-Int Clk.vi
That VI will show you how to output a signal that could be sine wave, square wave of saw tooth wave. In order to set the parameters that you need, you can use the Square Waveform.vi instead, this can let you set an offset for the signal.
I hope this will help you,
Regards,
steve.bm
AE | NI

Similar Messages

  • Modifying Daqmx Function Generator

    hi everyone,
    I found an example from ni and I want to have it modified a little bit. I need to add delay before and after generating the sinewave in 1 channel, how to do that? Just simply delay, sinus, delay.
    Then I need to have range of control for the delay (the delay can be 1ms ~ 1000ms), is that means I should use small buffer (1ms) to be able to vary the delay? (but seems buffer 1ms doesnt work).
    Please help.
    regards,
    yan.
    Attachments:
    funcgen.png ‏112 KB

    hi,
    I really appreciated your VI, thanks for that.
    I made my own VI already, a little different concept, but working.
    You might know about error -200018:
    "A DAC conversion is started before the data to be converted were available.
    Decrease the output frequency to increase the period between two DAC conversions, or reduce the size of the output buffer to the data faster (faster) to write.
    When using an external clock, check whether the signal contains noise or voltage spikes."
    I got this error when I try to acquiring the generated signal at the same time I'm generating. Can't find any help or solution for that.
    regards,
    Yan.

  • Oscillioscope and function generator

    Hello,
    How difficult is it too create a virtual oscillioscope and a function generator that outputs through ethernet or usb to some NI module (Chassis, analog, digital etc) that will send signals to a circuit? So, basically instead of having an oscillioscope or a function generator, you create a virtual one on labview and can send signals to the circuit in the real world. Is that even possible? And if it is how hard do you think the task would be? 
    Thanks in advance for all the input!

    So I happen to have a myDAQ at home and I thought I would try to use it as a scope.  Checkout this video after a 1:30 for a demo of some of this software.  The software it comes with has all the test panels for various instruments for scopes, DMM, function generator, aritrary waveform generator and several others.  The hardware also appears as a normal DAQmx device if you so choose to write your own software.
    Honestly it isn't half bad.  Maybe it's because the software mirrors normal scope functionality but I was able to see my signal and understand it, when I had no other hardware that was capable.  It won't replace a desktop scope but it's what I had on hand.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Generated Pulse waveform is distorted when I deliver the signal to the output port in the DAQmx

    Problem: Generated Pulse waveform is distorted when I deliver the signal to the output port in the DAQmx.
    Environment: Windows XP sp3 (32bit), Visual Studio 2010 sp1, NI-Measurement Studio 2010
    Device: NI - DAQmx PCI 6251
     Analog Input: 1.00MS/s multi-channel (aggregate)
     Analog Output: 2 Channel 2.00MS/s
    Reference Example: AO_ContGenVoltageWfm_IntClk / AI_ContAcqVoltageSamples_IntClk
    Generated Pulse:
    1) AO0 = Square Waveform /0-5V / 8KHz / 0.5㎲/sample / sample 50% Duty
    2) AO1 = Square Waveform /0-5V / 8KHz / 0.5㎲/sample / (Reverse Image)
    Description: I’d like to deliver the waveform stream satisfied with specified constraints to the 2 channel output port in the DAQmx. To verify accuracy of the generated waveform, I did an electrical wiring from the Analog output channel (2 channels) to the Analog Input channel (2 channels) in DAQmx. As a result of this experiment, I could get a result which has signal distortion. Since the waveform has to satisfy with both high frequency (8KHz) and very short moment interval time (△t = 0.5㎲/sample) between samples, I cannot handle some parameters of the function in the referenced VC++ example. Following formulas shows an approach to deliver the generate pulse waveform to output port satisfied with constraints.
    Analog Output Channel
     Frequency = 8,000 cycles/sec (constraint)
     Sample per Buffer = 2,000,000 = 2*106 samples/buffer
     Cycles per Buffer = 80,000 cycles/buffer
     Sample per Channel = 1,000,000 = 1*106 samples/channel
     Sample Rate  = Frequency * (Sample per Buffer / Cycle per Buffer)
                              = 8,000 * (2*106 / 80,000) = 2*106 samples / sec
     △t  = 1 sec / 2*106 samples / sec
               = 0.5 * 10-6 sec/sample (constraint)
     Buffer Cycle  = Sample Rate / Sample per Channel
                              = (2*106 samples / sec) / (1*106 samples/channel)
                              = 2 channel / sec
    Analog Input Channel
    Sample per Channel = 1,000,000 = 1*106 samples/channel
     Sample Rate  = 1 MS/s * (2 Channel) = 5 * 105 Samples / Sec
    Program Code
    AO_ContGenVoltageWfm_IntClk / AI_ContAcqVoltageSamples_IntClk (VC++ Example)
    Result: The proposed approach was implemented in the experiment environment (VS2010, MStudio2010). As shown in Figure 1, we could get the unsatisfied result. Although I intended to make a ‘square’ pulse wave, the result looks like ‘trapezoid’ pulse wave (Figure.1). However, there is other result which was undertaken with different parameter condition. It looks like the square shape not the trapezoid shape.
    Please let me know what the conditions make the problem of signal distortion. (AO0 = Green line / AO1 = Red line)
    [Figure. 1] Frequency 8000 Hz / Cycle per Buffer = 8000 Result
    [Figure. 2] Frequency 1000 Hz / Cycle per Buffer = 1000 Result
    Questions: Please let me know following questions.
    1) Is it possible to deliver the generated pulse wave satisfied with constraints (f= 8KHz), △t = 0.5㎲/sample) to the output port without distortion using PXI 6251?
    (Is it possible to solve the problem, if I use the LabView or MAX?)
    2) Are there some mistakes in the proposed approach? (H/W or S/W program)
    3) What is the meaning of the Cycle per Buffer?, It could effect to the result?

    Hi Brett Burger,
    Thanks for your reply. For your information, I have set the sampling rate as 10000 as for the sound format, I have set the bits per sample as 16 bit, the rate as 11025 and the sound quality as mono. I tried using your method by changing the sampling rate as 8K but still my program encounter the same problem.
    I wish to also create a button that is able to generate a preformatted report that contains VI documentation, data the VI returns, and report properties, such as the author, company, and number of pages only when I click on the button.  I have created this in my program, but I am not sure why is it not working. Can you help troubleshoot my program. Or do you have any samples to provide me. Hope to hear from you soon.
    Many thanks.
    Regards,
    min
    Attachments:
    Heart Sounds1.vi ‏971 KB

  • Derivate a waveform from a Function generator

    I want to use the derivate of a waveform from a Function generator in a Formula node,  but unfortunatelly I dont no how can i do this. I need the exact value of the derivate ("qpg" input variable) to use in the equation in the Formula Node.
    I found a Derivate sub VI, but it gives me the derivate as a vector so i cant wire it as an input to the Formula node.
    I attached pictures about my VI.

    As I understand it, you are using a Waveform Generator VI, and want (in addition to the Waveform) an additional output that is (an estimate of) the derivative of the Waveform.
    If you consider the Waveform Generator as a "black box", something whose internals you don't know, but something that produces a new output every delta-t time increment (I'm going to call this "dt"), then you really do need to estimate the derivative.  Note that since you cannot "predict the future", to estimate the derivative, you need the current data and previous data.  One very common estimate for the derivative x'(t) at time t is (x(t) - x(t-dt))/dt, that is, the difference between the current point and the previous point, divided by the time increment.  For a waveform generator, this will probably be a pretty good estimate, as the data should be relatively "smooth" and noise-free.  Do note, however, that this estimate is really over the time interval t-dt and t, so you could consider it shifted backward in time by dt/2.
    If you want a more accurate estimate of the derivative, one "centered" on the current time, t, then your formula needs to take into account not only the current value and past values but also future values.  This is the reason many "derivative functions" use vectors, as this contains past and present values (with some worry about what to do at the beginning and end of the data).
    On the other hand, if you are generating the data yourself (that is, if you have a VI that you input t and it outputs f(t)) and you have a "nice" function f (say a sinusoid or other non-random function), you can get the "exact" derivative just by programming it.  For example, if f(t) = sin (omega * t), then f'(t) = omega * cos (omega * t).
    Bob Schor

  • Acquire waveforms from function generator to oscilloscope

    I have a problem. We constructed a virtual function generator and a virtual oscilloscope. It's working well, the oscilloscope is displaying the (almost) correct data. My problem is that the waveform displayed in the oscilloscope vi is always sine, although the selected waveform in the function generator is already different.
    I should replace the constant 'zero' with something so that the cases will change in order for my oscilloscope to display different waveforms. Is there a way to acquire the values of the constant enum, for instance, from another vi to this vi?

    Yes, you would need to replace the constant with a control. Once you do this, in the main VI you simply do a right click on the subVI's terminal and select Create Control/Constant that but you cannot change it as the subVI runs.

  • Sending waveform to function generator?

    Hello all,
    I am using an agilent 33205A function generator and require it to use a
    special driving waveform.  Currently I load the waveform using
    this HP Benchlink software.  I would like to automate this in the
    startup of my vi.  Is there a way to download a "home-grown"
    waveform to the function generator using labview? 
    Thanks,
    Azazal
    Azazel
    Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115

    If you're using the driver from here, then use the function called ag33xxx - Arbitrary Wfm Ops. You will have to create the waveform in the form of a 1D array. Look at the high level example called ag33xxx - Arb - Application. I don't see a function in the driver that allows you to output a defined waveform so you may want to look in the instrument manual to see if there is such a function. If there is, then it should be a simple matter to read it and then place the values into LabVIEW as a constant or something you read from file.

  • How can I tell if an arb is currently generating a waveform? (LabView 8.5)

    I have a VI which configures the load impedance of a 5421 arb card by changing the value of the property node "Load Impedance".
    This only works if the arb is not generating at the time of the call to the VI.
    I wish to be able to call the function when the arb is either generating, or not generating a waveform.
    Is there a way I can determine whether the arb is generating a waveform so that if necessary it can be aborted, then the Load Impedance changed, then the output re-initiated?
    Thanks
    Alan

    The fastest way to do this is to Disable the output (with enable output.vi) change the impedance and re-enable the output.
    Of course if you want to wait untill a generation session is complete you will need to configure the Done event to output something you can monitor (hardware only for unknown reasons) and use that to gate your changes.
    Jeff

  • I want to use the Function Generator VI to send command signals through the NI 7344 motion controller. This will be a closed loop servo valve system. I want to be able to change from say a square wave to a sine wave on the fly. Idea's?

    I am going to run tests that require an actuator to move using various types of arbitrary waveforms such as sine or square. The NI 7344 is hooked to the UMI that is going through a driver for a servo valve. The loop is analog and it is closed. I have played with some of the examples but can't get it to work. I have used the function generator VI to generate a signal but I think I am using the wrong input VI to the motion control board. When I use what I have it moves the servo and then stops. It doesn't continually generate the signal.
    I would love to use the controls on the function generator vi to control frequency and amplitude ect. Any help or pointer would be helpful. Thank you in advance.

    Hello,
    I'm not clear on exactly how you want to use the generated data but I'm assuming they will be used as your target points.
    There's a built-in example for motion called 'One-Axis Contour Move.vi'. This example demonstrates how to provide your target points as 1-D array. All you need to do is to replace the input array with the output of the function generator. In order to have it run continuously, use a while loop. You can further program your application so that it'll change the waveform on the fly by monitoring the user interface but this might be little little tricky as you will need to reset the move and load the new generated points while keeping track of your current position.
    I hope this helps. Let me know if you have further questions regarding this
    application.
    Best regards,
    Yusuf C.
    Applications Engineering
    National Instruments

  • How can i add one wave in in our Function generator example?

    how can i add one anotehr wave in our function generator example. i want to use superposition and add one more wave to our first wave in function generator and see the result.thanks

    Hi hood1,
    2 options:
    1) You can add many waveforms by combining them into one Array.
    2) Use the Waveforms tools, that give you many option for adding waveforms. one after the seconed or adding the Y array of a waveform to other Y array of second wave form, and so on...
    Hope it Helps...

  • Sending .arb files to function generator

    Hi
     i am  very  fresh to labview  programming.
     I have  created some  waveforms  using  HP BenchLink software(and saved in .arb file  format).  Can i send  these  wave forms  to  a  function generater  through Labview  program . if  possible   how  can i do that
    Thanks
    jith

    Hi
     Yes  i have  downloaded the driver ag3xxx and  installed .  and   also got  some  advise from [email protected]
      Their  comments  follows .
                    Yes you can read the values from the .arb file into LabVIEW and store
    the values in 1D array or text file and then send it to the function
    generator you are using.
         Basically you would have to use APIs such as read from binary
    file(there are examples present in LABVIEW example finder which shows an
    example of how you could read a binary file.) After reading from the file
    you could store its values in an array or a text file and the read from
    this array and send the data to the function generator you are using. If
    you are using a function generator which is not made by National
    instruments you have to install the device drivers for that instrument fro
    LABVIEW, you could install them from www.ni.com/idnet.
                 i have  used  some  eg:  programmes   given in LV to read binary files .
                 The  function name is  "read binary files vi " .  the  out  put  of "read binary files vi "
                 is  data .  I am trying  to store this  data  in an array  , but   got  stucked  ,  in finding
                 a sutable  function to send  this  array valuse  to  the  function generator. Can  i send
                  the  array out  put  directly to a  FG  ?
     Thanks
     jith

  • DC offset problems in NI-5401 function generator card

    When i give a Dc offset of 1 Volt the output of my function generator reads 1.97v. what is the reason behind this,why is it so what setting have to be made so as to get the dc ofset only when no ac signal is given.

    Hi. The NI 5401?s output voltage is specified in terms of 50 ohms. This means for a 50 ohm load, you should see 1.0 Volts for a 1.0 Volt setting when the load is 50 ohms. For an other than 50 ohm load, there is a voltage divider action that takes place, where the voltage will vary up to double the size for a high impedance load, such as most default oscilloscope settings. The Connecting Signals>>ARB Connector section of Chapter 1 of the NI 5401 user manual describes this in further detail.
    To generate just a DC voltage level, there is an option for DC as the Waveform to use when programming the device. The LabVIEW niFgen Function Generator Example shows this on the front panel. If you are using the Sources Soft Front Panel, when the Standard Function Output is se
    lected, there is a DC Voltage level selection button available to be selected to generate a DC voltage.

  • Generating a waveform using PXI-6534

    Hello,
    I am trying to write a VI to generate 3 waveforms using a PXI-6534. I am not familiar with how to do this in Labview really, so I was hoping I could get some help getting started with this. The 3 signals are a clock signal, data, and load enable. The clock has a frequency of 614.4KHz, and a data bit is sent on the falling edge of each clock pulse. After 48 data bits have been sent, the clock remains low while the load enable signal is pulsed low for one clock cycle. Unfortunately I do not have the waveform generation editor, are there any alternatives to this? If anyone could give me any suggestions or point me to any tutorials or examples it would be greatly appreciated.
    Thanks,
    Steve

    This you can do this.  I have used this exact card to continiously bit pattern from an array I streamed out a 500,000 sample stream out at 10MHZ and read back a 8MHz and parsed the data.  Look at the daqmx examples.  essentially you want to write the array to the buffer and set it up for ALLOW REGENERATION on the write property and Continious on the sample clock. Look at the following examples:
    Hardware IO>>daqmx>>digital generation>>Continious Write Dig Port-Ext Clk generation.
       this sounds like what you need, a continious digital pattern generation using an external clock.
    Also see the non regeneration example. you can change the pattern on the fly.
    I would not use traditional daq since is is very outdated and probably will not be supported in the future.  DAQMX is much better.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • USRP as a function generator

    Is it possible to use USRP as a function generator ? If yes can any one please provide me the sample VI. I want to generate Sine wave, Square wave, Triangular wave etc. Also I need the option to vary Frequency and Voltage. Is it possible to implement Function Generator mechanism on USRP using LabView? Please guide.  

    Hello josephkirmani,
    When you say you want to use the USRP as a function generator, do you mean you want to be able to output and send a function over a certain RF carrier frequency? If so, I think you might find the example below helpful, it uses frequency modulation (must have the modulation toolkit installed) in order to embed a signal of your choosing (square, sine, triangle…) into a FM modulated waveform to be transmitted over a specified carrier frequency. Just switch out the Basic Multi Tone.vi for your preferred function from the Waveform Generation Palette. If that’s not what you are trying to do, please clarify. 
    Example: https://decibel.ni.com/content/docs/DOC-24206
    Matthew R.
    Applications Engineer
    National Instruments

  • Testing a function generator using PXI-5412

    I want to test a function generator example by reading it from a PXI-5412, but I dont know what do I suppose to read the input from.

    I don't understand. The PXI-5412 is a function/arbitrary waveform generator and it cannot read anything. It is an output only device. To check the output, you can connect it to a scope.

Maybe you are looking for

  • File Type Association fails when opening multiple files from Bridge to Premiere

    I'm running Vista 32 bit CS3 Bridge and Premiere. According to the Video workshop http://www.adobe.com/designcenter-archive/video_workshop/ under Premiere > all 19 topics > Managing Media in Adobe Premiere Pro > at 02:46 it shows group selecting a bu

  • Help! - as3 IE preloader issues

    Ok, So, I work for the NPS, and they have an outdated CMS. I have no rights  to upload an .html file, or edit one that the CMS makes. SO, I am forced to use their little deal to display my .swf files. Problem: http://www.nps.gov/glca/photosmultimedia

  • JOptionPane Timeout

    Can anyone provide a code snippet showing how to have a JOptionPane timeout if the user doesn't respond after a specified period? I assume this would be done via a thread or timer, but can't figure out how to make it work.

  • Long login times on solaris 10

    I had this nested in another thread, pulling it out to be seen easier I hope... I have a solaris 10 install that has a very long login time. If you telnet or ssh to the machine, you are prompted for the username and then password, then the system tak

  • IPhone calendar & contacts missing from desktop

    last night came home and my calendar & contact list are no longer on my desktop.  NO Idea where to look to get them back.  Still on my phone.