# Interaction of ModellingToolkit with C code

**URL:** <https://discourse.julialang.org/t/interaction-of-modellingtoolkit-with-c-code/139982>\
**Category:** Modelling & Simulations\
**Tags:** question\
**Created:** [October 13, 2026, 8:07am UTC](https://discourse.julialang.org/t/interaction-of-modellingtoolkit-with-c-code/139982 "2026-10-13T08:07:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhi7k](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abhi7k/32/224632_2.png) [@abhi7k](https://discourse.julialang.org/u/abhi7k)\
**Post date:** [October 13, 2026, 8:07am UTC](https://discourse.julialang.org/t/interaction-of-modellingtoolkit-with-c-code/139982/1 "2026-10-13T08:07:12Z")

</div>

Hi All, I am trying to model a converter using ModellingToolkit whose control lies in a c file. The control is being called at a regular interval using ccall and periodic callback. It seems impossible to integrate the variable updated from c file into the model as it is not reflecting as an unknown.

Does anyone have an idea how to resolve this.  
Below is the code for reference.
