KiCad Ngspice Dump to Text Command

Is there any way to programmatically dump the output from the SPICE simulation into a text file?

I know that I can use the File → Save as .csv File command. But I would like to set up something to automatically write to a file each time I run the simulation.

I have tried setting compatibility to ‘LT’ and using the ‘.wave’ command in the schematic, but that produces the following error:

Compatibility modes selected: lt
Circuit: KiCad schematic
Error on line 24 :
.wave circuit_data.wav 16 1k v(/vin) v(/v0) v(/v9) v(/v10)
unimplemented control card - error
Error: circuit not parsed.

Any suggestions would be greatly appreciated.

Two different things:
.wave is not supported by the current ngspice version.

Output to a file:

Add the following as a text box to the Eeschema window:

.control
set controlswait
write filename.txt all ; standard ngspice raw file
wrdata filenam2.txt all ; plain text file
.endc

This will print out all simulation results. Instead of ‘all’ you may give one or more of the output vectors.

1 Like

Thank you. This is exactly what I was looking for.

1 Like