C Block unexpected result

I’m trying first time to use the “C Block” feature with a very simple (or stupid :roll_eyes:) example.

The only line I added to the template is: Out = In1 + In2;
The simulation always reports HALF the sum of In1 and In2, so in this case 10 V instead of 20 V.
Why? Where I’m wrong?
Thanks and regards!

Unfortunately I cannot upload the schematic file and the C code as attachments

The code block has non-zero output impedance (if you not set, the defalut is 1k). Right click on block → Add new attribute and write e.g: Rout = 1u. The Rout is predefined attribute of code block. Optionally you can increase R load.

Thanks WinterMime! Yes, you are right, now better searching in the Parameters description I’ve found it.
Honestly I didn’t get the default was 1000 Ohm, and I didn’t try to change the load resistor…stupid example for an even more stupid newbie :woozy_face:

As Mike explained the code block output is a Norton equvilaent which inner resistance cant be zero. To avoid further suprises worth to read this topic:

Hi FrancescoA,

Don’t worry, we all make mistakes!
I made the same mistake in a Verilog block, which was automatically converted to a C block by the “Verilator” program. :woozy_face:
So,you’re not alone!