2
\$\begingroup\$

I have used .meas expressions to calculate harmonic values in LTSpice. The problem is that these are now in the error log and I cannot export them. Is there a way to export error log values in a .csv file for example? Is there a better automated way to calculate harmonic values?

\$\endgroup\$
2
  • \$\begingroup\$ If it's about harmonics, may I suggest using .four? The results are also reported in the error log, but cannot be plotted. They can be copy-pasted, though, formatted. \$\endgroup\$ Nov 16, 2017 at 8:15
  • \$\begingroup\$ This is one of the many ways the LTspice UI sucks. They don't allow you to generate any sort of output file for your measurements and they don't allow any sort of comments or other formatting in the error log file. You can, however, add a .meas command with an arbitrary name to generate an output line like, Measurement "20_hz______db_______output" FAIL'ed. This is about as close to formatting as you can get. \$\endgroup\$
    – gnuarm
    Mar 11, 2023 at 21:46

2 Answers 2

0
\$\begingroup\$

The SPICE Error Log actually only shows the contents of the corresponding error log file.

If your project is named X:\Foo\Bar.asc then the error log will be stored in X:\Foo\Bar.log. The location of the output files can be changed globally in the Control Panel.

This file can be parsed using a scripting language of your choice. I do not know if there is a way to automatically export just the relevant measurements in a more convenient way.

You can use the LTspice feature to Plot .step'ed .meas data, which will create a file named X:\Foo\Bar.log.raw, but I do not think that is more helpful. You can opt to use ASCII data files in the control panel, to make these graphs readable, but remember to disable all waveform compression if you take this route.

\$\endgroup\$
0
\$\begingroup\$

I ran into similar issues and wrote a log file parser which outputs a csv file. It is a Python script called ltparse.py and can be found at my GitHub https://github.com/realtime/python-tools

usage:

python ltparse.py results.log

outputs results.csv

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.