I am not aware your initial problem not yet resolved. The issue is that you defined data type of Duty as integer. As a result, if you don’t change data type in your code, your calculate will always output an integer from the formula with Duty.
In this example, datatype of Duty is changed to float. After this change, you have to change Port Definition (2nd GIF in this post : How to Fix No Plot Output in QSPICE - QSPICE - Qorvo Tech Forum)
Here is an updated version.
Semnale_MCU_1.qsch (18.2 KB)
semnale_mcu_x1.cpp (2.3 KB)
