LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variable amplitude pulse train

Does anyone have suggestions for ways to generate a biphasic pulse train with fixed pulse width (100 usec) and period (100 Hz), but variable amplitude? I use an NI-DAQcard. Thanks.
0 Kudos
Message 1 of 7
(3,905 Views)
Hi khng,

If you would like a variable amplitude pulse train, then you will need to use one of the analog output channels on your DAQ device. You will need to output a series of points, some 2.6 and some 0, so the output resembles a pulse train.  For instance if you would like a 2.6V pulse train with 10us pulse width and .01s period, then the required duty cycle is 0.1% or 1 out of 1000. If you output one value of 2.6 and then 999 values of 0, then your duty cycle will be 0.1%.  You just need to output the samples at 100kHz to achieve the 10us and 0.01s periods you require.  

You will need to check the specifications of your DAQ device to see if it can support this hardware timed analog output task, but feel free to continue this thread if you have any further questions.

Best Regards,

Jeff Tipps
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,877 Views)
Hi Jeff- Thanks for the tip. This is how I ended up doing it...seems like this is what you suggested to do anyway? I used simulate arbitrary signal to construct a scaled pulse according to the required pulse width and period (kind of like a signal prototype). I also used the random number generator as a scalar multiplier to vary the amplitude of the pulse prototype. Then I fed the multiplier output to the DAQmx timing and write vi and run them through a  while loop. This seems to work fine for the most part, except what I'm interested in is a normal distribution and not a uniform distribution random number generator. I can't seem to find one in Labview 8.2. I tried using the continuous random probability function but I'm getting an error with incompatible data types between array data source and waveform data sink. I'm too new to the data manipulation stuff and can't figure out how to get around that....I'm close though, right?. Can you help? Thanks.
0 Kudos
Message 3 of 7
(3,871 Views)
khng,

I am having difficulty reproducing the broken wire from what you are describing.  Can you post that portion of the code?  

Thanks,

Jeff
0 Kudos
Message 4 of 7
(3,850 Views)
Jeff- I don't know how to post the code you refer to. I'm going to try and attach a pdf of the block diagram. Let me know if this works. Thanks.
0 Kudos
Message 5 of 7
(3,830 Views)
Khng,

We just need to insert an "index array" vi right before the multiplication.  The random number VI outputs a 1D array even though you only want one number.  The array only has one element so you can just index out the first element and it will have the number you requested.  I attached a VI to demonstrate.

Regards,

Jeff Tipps
Applications Engineer
National Instruments
Message 6 of 7
(3,810 Views)
Thanks Jeff- you're a genius!
Message 7 of 7
(3,803 Views)