Usb 6009 continuous analog output

Hi
I'm pretty new to Labview, so you may have to bear with me. I have a USB-6009 and I want to generate a continuos analog output voltage. I've got the example you have posted 'Gen Mult Volt Updates-SW Timed_LV7.1 (0 to 4).vi' working and it outputs a continuous sine wave.
In a similar manner I need to generate:
1. Ramp up voltage (and ramp down voltage): starting with a continuos constant voltage, which after a period of time linearly increases to another constant voltage, and which allows me to specify the 3 time intervals and the rate of increase.
2. Pulsations: whereby I can specify the amplitude and time interval of each pulsation
This is so that I can control voltage to a valve which regulates my pipe flow. In the example I have (one stated above), I do not understand specifically:
i. Why I need both a 'Software Loop Time (ms)' as well as 'Timeout'
ii. The 'Sinusoidal Pattern' input which seems to generate data for a sine wave- I can't get a description of that and there are no similar VIs for other waveforms; and what is the function of the two numbers it has?
iv. How do I change amplitude and time period for the wave?
iii. What does 'Index Array' do?
thank you

Hi there,
I'm guessing the VI you are using is the one from this KB:
http://digital.ni.com/public.nsf/allkb/6F2C2B49A89D685C8625711D007BDD64
i. The software timed loop control is to control the rate at which you change the voltage output.  The timeout on the DAQmx Write VI is the maximum time in seconds the VI will wait to output a sample (eg. if the write buffer is full, the Write VI will wait for it to become available for 'timeout' seconds before outputting an error).
ii. The sine pattern is just an array constant of doubles that make up the sine wave voltage values, and the for loop adds an offset (of two volts) to every single one of those values. You might want to replace that entire array constant and for loop with a Simulate Signal Express VI (just search for Simulate Sig or look in the Functions >> Input palette) and convert the dynamic data output to an array of doubles.  You can configure the type of waveform, amplitude, and time period from that express VI as well.
iii.  Refer to previous answer.
iv.  Index array returns an element of an array based on the index input.  You can turn on the context help and move your mouse over functions to get more help on them.
I hope that helps!
Way S.
NI UK Applications Engineer

Similar Messages

  • Usb 6009 multiple analog inputs

    I am currently attempting to sample two different analog inputs at different sampling rates using a USB 6009.  I keep getting the 'resource reserved' error and am wondering if this is not possible using this DAQ.  Questions:
    1.  Does creating two analog input channels on the device cause this error?
    2.  Is it possible to sample at different rates on channels created in the same task?  (i am trying to 'slow down' the second analog input to display switch points to a customer)
    3.  Running multiple analog inputs using independent timing would be better achieved by switching to a higher end DAQ?  If so which would you recommend?
    I have attached my vi.  Thank you in advance for your help. 
    I surf therefore I am....
    Attachments:
    demo_nolvl.vi ‏27 KB

    The DAQ boards only have 1 timing clock for the analog inputs/outputs.  So you can only have 1 sample rate on a given card.  I would recommend just sampling at the highest of the desired rates in a single task.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Usb-6009 high-speed continuous acquisition for slow control loop application

    Hi,
    After watching a few Youtube videos, I successfully built a control loop in LabVIEW using my USB-6009. Currently, this loop is limited by the speed my actuator can take and respond to commands, topping out at 200 Hz. This is completely sufficient for my application. My question is more regarding the wasted potential of the USB-6009 to acquire samples at a much higher rate than what would be obtained if I used a simple single sample-on-demand during every iteration of the loop.
    It seems to me that having the USB-6009 continuously acquire samples and having my control loop periodically check in for the latest data when it is ready to execute would have the advantage of allowing me to average groups of samples together to lower the overall noise associated with the measurement process (I am reading voltages from an amplified photodiode).
    1) Does anyone know how I would instruct the USB-6009 to continuously acquire at say 10 kHz, so that on each loop I will have 50 or so samples that can be averaged together for a more accurate measurement of my control variable? Unfortunately, I'm new to this and not too familiar with DAQmx Timing.vi.
    2) I've heard that reading into a buffer can increase latency for moving data into the computer. Given the low speed of my control loop, I don't foresee this as being a problem. Is this a correct assumption? I can probably live with an extra millisecond of latency.
    3) I goofed around briefly with DAQmx Timing and managed to see a buffer overflow error. Certain rare events will by necessity cause my control loop to take much longer to execute, so I cannot guarantee that occasionally during normal operation I will not overflow the buffer. Can I suppress this error so that the dialog box does not pop up and the program continues to run uninterrupted? If the buffer overflows and old data gets overwritten it isn't a big deal for me since the control loop is only concerned with the latest data anyway.
    Thanks for any info!

    Howdy Patrick!
    Here is a picture of the front panel:
    Here is the block diagram:
    And I've attached a copy of the VI saved for LabVIEW 7.1.
    Regards,
    Barron
    Applications Engineering
    National Instruments
    Attachments:
    most recent samples.vi ‏73 KB

  • How to reset buffer pointer for analog output generation?

    I am doing a finite analog output generation on a USB-6216
    Sequence of events:
    DAQmx Create Task
    DAQmx Timing (finite samples, 1000Hz)
    Use DAQmx timing property SampQuantamples per channel to set buffer size
    Write buffer with DAQmx Write
    Repeat
      DAQmx Start Task
      DAQmx Wait until done
      DAQmx Stop Task
    Until finished
    DAQmx Clear Task
    I get a full waveform output on the first iteration of the loop. On subsequent iterations I get only a small section of the waveform, but no error. It seems that it is regenerating the waveform, because when I switch off regeneration I get an error at Start Task, but before it can regenerate all the data Wait Until Done.vi decides that the generation is done and exits, stopping the generation.
    I have done this with a PCI device and it works fine; every call to Start Task generates the whole waveform again.
    OK, so it looks like after every waveform generation completes I need to reset the pointer to the start of the buffer, so that the Wait Until Done vi does not think the generation is done. Or - maybe there is a way to reset the "Generation Done" state?
    I'm sure there's an easy way to do this....?

    Hi CDancer,
    Many thanks for contacting National Instruments. If I can start by giving some general advice, it would be well worth posting your actual VI. This helps others on this forum in helping you with your application. 
    From the sounds of things, you want to do continuous analog output generation. I have had a look at the examples that come with LabVIEW and I think you should look at the one below.
    I would have a look at some of the DAQmx examples that come installed with LabVIEW. The following example would be particularly relevant I feel
    Cont  Gen Voltage Wfm-Int Clk-non Regeneration.vi 
    Please let me know how you get on.
    Many thanks,
    Andrew McLennan
    Applications Engineer
    National Instruments

  • Usb 6009 kullanırken hata alıyorum

    USB 6009  ile analog bir sinyali sürekli olarak almak istiyorum.fakat bir süre sonra bu hatayı alıyorum.Resim olarak ekte gönderiyorum.
    Attachments:
    hata.JPG ‏29 KB

    Aldığınız hata büyük olasılıkla veri toplama ayarlarınızdan kaynaklanıyor.Veri toplama hızı, paket büyüklüğü ve veri toplama modunuzu gözden geçiriniz.
    Zafer DEPE
    R&D Proje Lideri
    Elektronik Müh.
    E3TAM A.Ş.
    www.e3tam.com

  • Hardware buffered analog output single shot

    Using DAQmx and M-Series hardware i'm trying to fire a single shot analog output buffered waveform.   I need the output hardware timed.  I'm able to output a hardware buffered waveform but can't figure on how to configure it for or stop it after prescribed number of cycle runs.
    Thanks in advance.
    Solved!
    Go to Solution.

    Hi,
    You have a couple of options. You can set your timing to N
    samples and you acquisition will stop when N samples have passed. Or you can
    use a counter to control the clock of the analog output and then the counter
    can be paused whenever you can.  Before
    we go and dig into the specific details of the scheme let me suggest a couple
    excellent reading materials and let me know if they help. M Series Synchronization
    with LabVIEW and NI-DAQmx, Continuous Analog Output
    with Pause Trigger and Programmatic Grounding of Output in DAQmx, NI-DAQmx: Retriggerable
    Analog Output -- LabVIEW and M Series: Analog Trigger
    Source.
    Also don’t forget to take a look at simpler examples like: Cont
    Gen Voltage Wfm-Int Clk-Pause Trigger.vi
    I hope it helps
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters

  • USB-6009 Analog Waveform Output

    I'm trying to create an analog waveform from a USB-6009 device through one of the analog output channels. However, through the DAQ Assistant, I can only select the 1 Sample (On Demand) setting. When I test the device, I can only push a constant voltage out. If anyone has any advice on how to create an analog voltage waveform using this device, I would like to know.

    >I am only a novice at LabVIEW and data acquisition in general.
    I don't use Labview (I write in C++) so I can't help you with that. I try to answer questions about C/C++ and general hardware questions.
    >What did you mean by software-timed waveform generation?
    That's where the software driving the device sends a sample to the DAQ device, waits for the prescribed time interval, then sends the next sample. So the timing of the waveform is driven by the software, using the computer's clock, instead of by the DAQ hardware. Software-timed is less reliable and has (often) lots more jitter because of competition for CPU resources.
    >Does this mean that I cannot generate a waveform that is more than 150 Hz?
    It's worse than that. It means you can't generate a waveform faster than 150/N Hz, where N is the number of samples (data points) that define the waveform.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • Usb-6009 analog output voltage

    Hi,
    The usb-6009 has two 0-5 volts analog ouputs. Is it possible to connect
    them in series, in order to get a single 0-10 volts analog output
    channel ?
    Thanks,
    Nicolas

    Those are ground-referenced signals. To connect them in series, you would have to connect one of the outputs to ground. You would be shorting out (at least) one of your analog outputs, and probably damage the unit.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • How to toggle LED at analog output from my VI Using NI USB 6009

    Greetings,
    I bought this NI USB 6009 Multifunction I/O and found various uses for it. In my VI, I am acquiring some signals using the DAQ assistant. After doing a couple manipulation I would like to toggle a LED at one of the two Analog outputs available. I tried configure it in Max and was able to toggle it there, but now I would like to have the VI do it once a certain value is attained. Can anyone  tell me how this is done as I think I might be doing something incorrect.
    Thanks
    Edward

    Greetings,
    Attached you will find just a simple code to turn on the LED if the indicator on the VI's front panel illuminates. In my original code it is something similar. I have also check the wiring and I don't think that's the problem since I was able to toggle it through Max. I am using LV 2009. When  the output channel was configured in Max, the output voltage was set to range from 0-5V. I am not sure if the DAQ  Assistant  analog output is being triggered properly.
    OK, Lets say that I wanted to turn on the LED if a number was greater than the one stored in memory. How would I pass that to the NI USB 6009 to turn on a External LED. Please assume that the output is wired properly.  
    Thanks
    Edward
    Attachments:
    LED Application.vi ‏43 KB

  • How do I set up a triggered analog output on a USB 6009?

    Hi! I am very new to LabView and am working on the control portion of my senior ME design project. It is an anti-tip brake system for a bicycle. The goal is: When critical time to tip is reached (by reading values from a rear wheel normal force sensor, taking the derivative and calculating this critical time), my cheap DAQ USB-6009 device will put out an analog signal to a transistor, which will spin a DC motor (attached to a worm gear setup) for a certain length of time (...This will change a pivot location in the mechanical assembly which will decrease brake mechanical advantage).
    I have been trying to work with LabView 8.5. I get bogged down in confusion when I try to use G-code and get unexplained errors in using Express VI's (they're rather black box-ish to me).
    I think that all I need to do is set up an analog input channel, take derivatives and values and put them into a formula for critical time. Then if the result is a "True", I want to begin an analog out sequence for a certain period of time (to get the motor to the right position).
    I would appreciate any help that I can get with this one.
    Attachments:
    ABScontrol1.JPG ‏43 KB

    chowph,
    You are
    correct with your last statement about performing a comparison on your data.
    1.  Are there any error codes or messages in the
    errors you are getting? Or if you have screenshots of the errors you could post
    then that would work too.  Knowing the
    errors would help in understanding where to start. 
    2.  In your previous
    post did you have a chance to try the examples or Kent’s example code he
    posted?
    3.  What were the results of those examples and
    your experiment?  Again screenshots would
    work fine here.
    Since you
    new to LabVIEW make sure to take advantage of the online training material and
    tutorials we have on ni.com.  I have posted
    a few that I think may be helpful.
    Learn 10 Functions in
    NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
    Complete Data Acquisition
    Tutorial
    How Can I Learn
    LabVIEW?
    I hope this helps!!
    Message Edited by Ryan N. on 03-31-2008 11:52 AM
    Ryan N
    National Instruments
    Application Engineer
    ni.com/support

  • USB-6009 pulse train generation with digital output....

    Hello!
    I've bought a new USB NI-Card (USB-6009) and now I'm trying to adopt an old vi that uses traditional DAQ drivers. I wrote that vi for a PCI NI-Card (PCI-6024E), which has two counters to generate two pulse trains simultaneously. Now I've only one counter and that's why I'm searching for a good way to create pulse trains using a digital output! The pulse trains are both ranging between 100 Hz and 100 kHz.
    I'm sure somebody has an idea how I can solve the probem in the best way
    Kind regards,
    Peter

    You can't do it with this low cost board. Both digital and analog outputs are software timed only. The analog out is rated at only 150  samples/sec and the digital is about the same. You can't even use one of the counters because it is not a hardware timed counter output. It is an event counter only as an input.

  • Usb 6009 output changes

    Hi, I'm using a NI USB 6009 device.  I am using the analog output to drive very small currents (less than 1 micro Amp) through a 1 MOhm resistor.  I find that the output often changes significantly when I begin to acquire data, or if the computer is doing something, such as fitting data, or even if I am simply opening other files or programs.  Any advice?
    Thanks!
    Micah

    Hi, thanks for the responses.
    I'm outputing a DC voltage with values typically ranging from 0.1 V to 1 V.  The signal goes through a 1 MOhm resistor in series with a coil for producing very small magnetic fields applied to an atomic magnetometer.   It appears that the output changes by tens of millivolts, as recorded by a yokogawa oscilloscope with input impedance of 1 MOhm.  The coil and scope are both grounded.  I am using only a single input channel on the USB6009, coming from an SRS voltage preamp with output impedance of 50 Ohms
    I can also infer that there are changes in the current when the computer "does something" by looking at the signal in the atomic magnetometer.   
    Perhaps it would help if I shunted the output with some smaller resistor, say 10kOhm?
    I will look at the document you mentioned.
    Thanks again.

  • USB-6009 Digital Output Current

    You need to have all those grounds connected together - USB-6009 Digital Ground, ULN2003 GND, and the power supply ground. In this case it will not matter how they are connected.  If they are not connected, then one of the devices could be damaged.
    Lynn

    Hi, I'm trying to increase the voltage of the digital outputs of USB-6009 device. I read a couple topics about using a relay but I could not manage it.
    I was thinking to use 5V supply on the card since it has 200mA current on it, but when I use it with open-collector output, it can not switch the relay. When I measure the current between
    5V and ground: 200mA,
    5V and output, I read a value around 30-40 mA.
    Why can't I use that 200mA with an output? This is the relay I'm using.
    If this is not possible, can I use an external 5V supply (with more current) and a digital output to switch the relay without damage the 6009?

  • USB 6009 - Calibration of Analog Input (Mac)

    Hi,
    I have recently acquired a NI USB 6009. I'm using it under labview 7.1 on Mac OS X 10.4 (Tiger).
    I can run the software examples and the datalogger without problems. However, the device seems
    not to be properly calibrated, and I can't figure out how to do it from the manual. When I connect
    pin 1&2 (analog in 0) to pin 32 and 31 (GND and 5V ref voltage) the software claims that the
    measured voltage it ~3.7V (a multimeter confirms that it is in fact 5.0V). Can anyone help
    trouble shooting this ?
    Thank you in advance,
    Niels

    A little update : After thinking some more I realized that it's because
    the USB 6009 is in differential mode, and I hadn't connected one pin. Now
    however, I have trouble figuring out where to change/set this. None of
    the programs (e.q. Acquire One Voltage.vi) seems to define this, so where
    is this defined ?
    Thanks,
    Niels

  • How can i deliver a single pulse of varying amplitude using Analog output and USB-6251?

    I am trying to generate an analog output for the following waveform:
    Pulse width: 300 usec, Frequency 40 Hz, Amplitude is following a sine wave with a 2 second period.
    My approach is: Use an async timer with 1/[40 Hz] sec  interval. I set the DAQ output rate at 1 MHz and the approach has been to generate and write 300 samples of the amplitude I need to send out, then wait for the next async interval callback , update amplitude etc etc.  The assumption is that once the 300 samples are written and the task started , a 300 usec pulse would be sent out , task then stopped and then the analog output would be set to 0 waiting for he next pulse.  The reality is that I get a stream of pulses of 300 usec which last the whole timer interval. 
    So , trying to establish whether what I am trying to do is feasible without actually sending a large array to the USB-6251 which would write zeros for the period after 300 usec.
    Here is my timercallback code for review:
        switch (event)
            case EVENT_TIMER_TICK:
                DAQmxErrChk(DAQmxStopTask(TaskAnalog));
    Determine Voltage value algorithm here
                //Generate Waveform and start Task
                //Prepare AO arr
                for (k=0;k<300;k++)
                    AOArr[k] = 0;
                    if (k<G_PulseWidth)
                    AOArr[k] =  VOLTAGE_OUTPUT;
                if (AOArr!=NULL)
                    DAQmxErrChk(DAQmxWriteAnalogF64 (TaskAnalog, (int32) 300 , 0, DAQmx_Val_WaitInfinitely, DAQmx_Val_GroupByChannel , AOArr, &sampsPerChanWritten, NULL));
                DAQmxErrChk(DAQmxStartTask(TaskAnalog));
                break;
    Thanks

    I did resovle the issue I encountered. It was due to bad configuration of the Task.
    My initial configuration was:
    DAQmxErrChk(DAQmxCfgSampClkTiming(TaskAnalog, "",1.0E+06, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps , 300 * 1.0E+06));
    which should be:
    DAQmxErrChk(DAQmxCfgSampClkTiming(TaskAnalog, "",1.0E+06, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps , 300));      
    THis did it. works very well.
    THanks

Maybe you are looking for