LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to control timing in analog output task

Hi all,

    I created a vi using analog output task using usb 6211 and AO0 has to increase the voltage gradually based on the control value and AO2 has an fixed value and now i need to increase the AO0 output in a certain interval or per second here i have used wait(ms)function to control the timing but is there anyway to use timing DAQmx timing.vi to control the output because if i use wait(ms)function it affects the other code here i have attached you the sample code so that you can verify.

regards,

paul

0 Kudos
Message 1 of 2
(2,059 Views)

I don't have this device, so can't run any tests (or try it out in MAX), but I can read the Data Sheet which reveals that this device has a buffer and can accept an array of values to be output at some user-determined clock rate.  So if you want to make it do a ramp, where you change the voltage from 0 to 1 volt 100 times a second, you could do the following:

  • Set up the AO channel for 100 samples at 100 Hz.  Set its scaling to "volts" (so 1.0 in gives 1 volt out).
  • Generate a 100-point array that starts at 0.01 and ends at 1.00.
  • Write this Array to the DAQ to fill its buffer.
  • Check with MAX to see if you need to set a mode, like "Finite Samples" or something like that.
  • When you Start the Task (after filling the buffer), it should give you your ramp.

Hmm -- though I don't have your device, I do have a myDAQ at work that has 2-channel AO, so I could try this myself, but you'll learn a lot more if you try it with your hardware.  Feel free to experiment with MAX, and to read the documentation for your device.  You can also do a Web search for Generating Analog Waveform LabVIEW, which will probably turn up something helpful.

 

Bob Schor

0 Kudos
Message 2 of 2
(2,024 Views)