LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a TTL digital trigger produce a programmable set of analog outputs?

I am running an experiment where I need my DAQ board to output a pulse train of a particular voltage amplitude.  I would like to be able to easily define the pulse width and pulse frequency of the pulse train and importantly I will need to be able to input an array of voltage amplitudes and then run the program so that every time the DAQ board receives a TTL digital input event from another computer, one of the voltage amplitudes will be randomly selected (without replacement) and a pulse train at that amplitude will be generated and sent out via an analog output channel on the DAQ board.  On the next TTL pulse, a different voltage amplitude will be randomly selected from the set.  This will go on until all the amplitudes have been generated, at which point the entire set of amplitudes will repeat for a user-defined number of times.  Can someone please tell me if LabView is capable of this and, if so, please lead me in the right direction with some example code.  Thanks. 

0 Kudos
Message 1 of 3
(2,094 Views)

I'm pretty sure LabVIEW can do what you want to do - the most complicated part to me seems like the data manipulation of the amplitude array. Here's an example showing how to create a pulse train for an analog output:

http://zone.ni.com/devzone/cda/epd/p/id/1621

There's an example of triggering off a digital edge to start an analog write in Help>>Find Examples>>Hardware Input and Output>>DAQmx>>Analog Generation>>Voltage>>Cont Gen Voltage Wfm-Int Clk-Dig Start.vi

As far as randomly choosing what index of the array to choose, you'll need some code to generate randoms numbers between two limits:

http://digital.ni.com/public.nsf/allkb/FCCDCD678EEF3A9186256D7B008054F5

You can then delete that from the array using the "Delete from Array" function in the Array palette and reduce the maximum for the random number generator the next round.

You'll have to save the order of amplitudes in another array to reference for the user-defined repetition later.

 

Hopefully, this gets you started. What DAQ board do you have? Is there a reason you don't want to do this with counters (for the most part, they're easier to generate pulses with). What's the overall application for this?

0 Kudos
Message 2 of 3
(2,076 Views)

Thanks Alisha.  I actually have not yet purchased the DAQ board or labview.  I am trying to first make sure that I can do what I need to do.  Your reply was very helpful in making these decisions.  Thanks again.

0 Kudos
Message 3 of 3
(2,067 Views)