C++ block delay in output waveforms

Hi ,

I just start to use Qspice.
Look very cool and Fast.
I’m very interest to use C++ Block on it.
I’m able to run it.
I make very easy block Input= Output but I observe that some waveforms are distorted.
Not all 100Kw sin waveforms is good but some other type (like trapezoidal)) look have a some sort of delay.
thanks for help.



Are you referring to this? Add .option MAXSTEP to limit maximum time step may help.

Without .options=MAXSTEP

With .options=MAXSTEP


don’t work for me.

This is the C code

blue trace input green trace output

can you screen capture your schematic?

even more simple example
here waveforms

here the circuit

and here the code
whan it’s wrong?

Correct command is " .option MAXSTEP=100n " or " .options MAXSTEP=100n " (remember the dot at front, and option NAME is MAXSTEP but not MAXTIMESTEP). With this command, retry and see if distortion is improved. In your case, 100ns may enough and not forcing simulation to run too long. Smaller the timestep, longer the simulation. You may want to have balance between what you want and simulation time.

You can goto HELP > Simulator > Command Reference > Simulator Option (.option) to review what this is.

Thanks for hep!
Working good now.