3
\$\begingroup\$

I have a subcircuit in my LTspice schematic. It appears as a schematic block. Within the subcircuit's schematic there is a .MEASURE statement. How can I view the results of this .MEASURE statement after running a simulation?

Normally, if I put a .MEASURE statement in my top level LTspice schematic I can view the results in the SPICE Error Log located under the view menu.

For example, if I put this on my schematic as a spice directive:

.MEASURE testvalue PARAM 7*7

The following line appears in the Error Log after running a simulation:

testvalue: 7*7=49

However, if that same .MEASURE statement is on a subcircuit's schematic, then it does not appear in the Error Log. Does anyone know how to view this data?

\$\endgroup\$
1
  • \$\begingroup\$ afaik subcircuit measure statements are completely ignored. You could try verifying that by adding one that usually takes a long time and after the simulation is finished looking out if ltspice stalls for quite a while in its executing measure statements state. \$\endgroup\$
    – PlasmaHH
    Feb 16, 2016 at 20:59

1 Answer 1

-1
\$\begingroup\$

http://www.edaboard.com/thread209216.html I tried this and it works on the viewer, which means that it should work with the measure command. Please do some research before asking

Tools-> Save Defaults -> Save subcircuit...

\$\endgroup\$
4
  • \$\begingroup\$ I did find that as I was researching, but that is not what I'm looking for. This link explains how to view the waveforms from a subcircuit, but not how to view the .measure statement results. They are similar in that they both operate on the generated data, but unfortunately checking those options in the settings does not make the subcircuit .measure results appear in the Error Log. I tested it before posting this question. \$\endgroup\$
    – Josh3141
    Feb 17, 2016 at 14:58
  • \$\begingroup\$ Yeah, so I think you just need to do something like this: .MEASURE V(u1:11)*V(u1:11) put the .measure on the top level and access the sub-circuit voltage. If you want to access a sub circuit parameter and you don't mind modifying the subcircuit, create a B-source with 1*Param (or function) as the voltage with a large resistor to ground (like 1e9 ohms) and then you can access it as a voltage which may not be in your interest. B-sources are a great way to work around problems you might face with syntax \$\endgroup\$
    – Voltage Spike
    Feb 17, 2016 at 17:52
  • \$\begingroup\$ I was hoping for a way to do it entirely inside the sub-circuit and not touch the top level at all, but it's looking like that's just not possible. This is an interesting work around though. Thanks. \$\endgroup\$
    – Josh3141
    Feb 18, 2016 at 18:59
  • \$\begingroup\$ Yeah, it makes more sense to do it that way. If you look at it from syntax parsing perspective, its more simple to have operating commands be at the "top level" and spice is fairly simple \$\endgroup\$
    – Voltage Spike
    Feb 18, 2016 at 20:33

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.