# PLECS- how to implement continuous integration

**URL:** <https://forum.plexim.com/t/plecs-how-to-implement-continuous-integration/941>\
**Category:** PLECS\
**Tags:** plecs, runtime\
**Created:** [January 15, 2021, 12:23pm UTC](https://forum.plexim.com/t/plecs-how-to-implement-continuous-integration/941 "2021-01-15T12:23:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samk](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Samk](https://forum.plexim.com/u/Samk)\
**Post date:** [January 15, 2021, 12:23pm UTC](https://forum.plexim.com/t/plecs-how-to-implement-continuous-integration/941/1 "2021-01-15T12:23:07Z")

</div>

Hi,

I want to sample current across inductor in regular time samples. For example find current delta at t(i+1)-t(i). How can I implement that. I tried using function block. inductor current is a continuous signal. I want to find delta between two successive samples continuously.

Any help is appeciated.

Thanks,

---

<div class="post-metadata">

**Author:** ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)\
**Post date:** [January 18, 2021, 10:39am UTC](https://forum.plexim.com/t/plecs-how-to-implement-continuous-integration/941/2 "2021-01-18T10:39:27Z")

</div>

\> I want to sample current across inductor in regular time samples.

If the sample instances are fixed, then one approach is to use the Zero-Order Hold (ZOH) Block with a Discrete-Periodic sample time input. You can enter the sample time parameter as “Tp” or “[Tp,To]” where Tp is the sample period and To is the offset in seconds within that sample period (0≤To\<Tp). You could then use ZOHs with different offsets and subtract the results.

A basic example is attached.

[RegularSampleTimes.plecs](https://forum.plexim.com/uploads/short-url/wVP2hMO9fVrVnuBw1pfnMWBMfBF.plecs) (11.6 KB)

---

<div class="post-metadata">

**Author:** ![Samk](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Samk](https://forum.plexim.com/u/Samk)\
**Post date:** [January 20, 2021, 10:08am UTC](https://forum.plexim.com/t/plecs-how-to-implement-continuous-integration/941/3 "2021-01-20T10:08:23Z")

</div>

Thanks Bryan.This helps
