# Xcos closes when I simulate my block

**URL:** <https://scilab.discourse.group/t/xcos-closes-when-i-simulate-my-block/110>\
**Category:** Xcos\
**Created:** [June 26, 2023, 3:24pm UTC](https://scilab.discourse.group/t/xcos-closes-when-i-simulate-my-block/110 "2023-06-26T15:24:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjLnyr](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sjLnyr](https://scilab.discourse.group/u/sjLnyr)\
**Post date:** [June 26, 2023, 3:24pm UTC](https://scilab.discourse.group/t/xcos-closes-when-i-simulate-my-block/110/1 "2023-06-26T15:24:18Z")

</div>

Hello, if you may, I need help with this. Every time I run my simulation the XCos closes. I just wanna ask what the problem of my block arrangement.

 ![ece107-finalPrjct-test](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/0d0e16f330f183e1157833e8123dc2ff8b4940fc.png)  
[ece107-finalPrjct-test.zcos](https://scilab.discourse.group/uploads/short-url/mxXcXusEu8LN29xuZs6J11UoSL1.zcos) (6.0 KB)

---

<div class="post-metadata">

**Author:** ![sjLnyr](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sjLnyr](https://scilab.discourse.group/u/sjLnyr)\
**Post date:** [June 26, 2023, 4:32pm UTC](https://scilab.discourse.group/t/xcos-closes-when-i-simulate-my-block/110/4 "2023-06-26T16:32:39Z")

</div>

Basically, what I want to achieve is a PWM Demodulation. Im trying to trigger the sawtooth to produce a ramp signal just like the image below.

[PWM Modulation and Demodulation](https://electronicscoach.com/wp-content/uploads/2018/10/waveform-representation-of-PWM-signal-detection.jpg)

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [June 26, 2023, 5:24pm UTC](https://scilab.discourse.group/t/xcos-closes-when-i-simulate-my-block/110/5 "2023-06-26T17:24:37Z")

</div>

Please precise what version of Scilab you are using and the operating system. On my computer with scilab 2023.1.0 your diagram runs fine with the following output:

 ![Capture d’écran 2023-06-26 à 19.21.55](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/a30de724e9164b48f8d9a11992a6abaeb37cc820.jpeg)  
 ![Capture d’écran 2023-06-26 à 19.21.53](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/73625c553c2eef6d4c9f4174979ff42af5e4904f.jpeg)
