# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

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

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?

Message 1 of 4
(1,621 Views)
Solution
Accepted by Laura121

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

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:

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,592 Views)

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

Thank you very much! That helps a lot.

Message 3 of 4
(1,586 Views)

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

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 ǝɥʇ'

Message 4 of 4
(1,583 Views)