LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample-and-hold vi for USB-6251

 

 

I want to implement a sample-and-hold circuit on my USB-6251 device.

 

The input will be an analog voltage waveform.  The output will be that same analog voltage waveform (this is the "sampling" in the sample and hold), with one caveat:   I want to hold the output at a certain level depending upon a digital input (ttl 5V hi or 0V low).  For example, when the digital input cycles hi, I want to take the value of the analog output at that point in time, and continue to output that voltage value until the digital input cycles back low (the "hold" in the sample and hold), at which point the output continues outputing the incoming analog voltage waveform. 

 

I think I should be able to create such a VI using a comparison function, but I cannot quite figure out how to implement it.  Any suggestions?

 

thanks!

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

I would imagine this could be accomplished with the use of a simple true false selector.  In the false case the waveform coming from the Analog Read would be passed on and also into a shift register on the right side of the reading while loop.  This shift register would then also be the true case of the selector.  There would then be a producer consumer style structure where this output array would be fed into a DAQmx write.

 

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 2 of 2
(2,303 Views)