LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my zero order hold not giving the expected result?

Solved!
Go to solution

I am trying to replicate the functionality of the Discrete Order Hold Function so that I can use it without having to have a ''Control and Simulation Loop''. The attachment desiredresult.vi shows an example of the Discrete Order Hold Function inside the ''Control and Simulation Loop''. The other attachment (zeroorderholdquestion.vi) shows my attempt at achieving the same result. I multiplied the while loop index by the sampling period to get the array index for the resampled y-output. I based this on my understanding of the formula for Discrete Order Hold given under http://zone.ni.com/reference/en-XX/help/371894G-01/lvsim/sim_dzoh/#details.

 

However, I am having difficulty getting the frequency of the waveforms before and after resampling to match up. (See attachment for clarity on what I mean by this). Any suggestions on what I am doing wrong?

Download All
0 Kudos
Message 1 of 4
(1,635 Views)
Solution
Accepted by Laura121

here i wrote something maybe similar to simulate a multi channel, mux, sample and hold with cross talk 🙂

http://forums.ni.com/t5/LabVIEW/How-can-I-create-and-sample-and-hold-circuit-in-Labview/m-p/2407256#...

 

 

If samplerate and hold time have a clean ratio  you just need the decimate vi 🙂

 

another simple version:

 

s&H.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 4
(1,606 Views)

Thank you very much! That helps a lot.

0 Kudos
Message 3 of 4
(1,600 Views)

Have a look at the

 

Resample Waveforms (single shot) VI

Owning Palette: Waveform Conditioning VIs

Requires: Full Development System

Resamples input waveforms or data according to the user-defined t0 and dt values. Wire data to the waveform or data input to determine the polymorphic instance to use or manually select the instance.

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 4
(1,597 Views)