Post Go back to editing

LTSpice 24.1.7 .meas error

Thread Summary

The user encountered a .meas error in LTspice when measuring current through a specific port of the LT317 device. The solution is to use the internal port numbers (e.g., Ix(u1:1), Ix(u1:2), Ix(u1:3)) instead of the symbolic port names (e.g., OUT). This change is due to the latest LTspice version only recognizing names listed in the .raw file. The user confirmed that this workaround resolved the issue for their simulations.
AI Generated Content
Category: Software
Software Version: LTSpice 24.1.7

Hi,

I have run in a .meas error that was non existent in former LTSpice versions. Using the .meas statement to measure a node Voltage works as it should. Also a current measurement of a simple resistor works. But measuring current through a specific port of a device such as a LT317, produces an error in the output log:


C:\Users\name\Desktop\measbug.net(13): Current not found.
.meas I_LT317 MAX Ix(U1:OUT)
^^^^^^^^^^

I wonder if someone could point me to a solution. Or maybe someone could confirm that this is buggy behaviour of this LTSpice version.

Regards

X§U1 N003 N002 N001 LT317A
V1 N001 0 35
R1 N002 N003 100
R2 N003 0 400
I1 N002 0 SINE(20m 10m 50 1.2 0 0 20) AC 1m
C1 N001 0 1µ Rser=1
C2 N002 0 1µ Rser=1
C3 N003 0 1µ Rser=1
.tran 0 3 0 0.0001
.meas V_LT317 MAX V(n002)                                 <--- good
.meas I_LT317 MAX Ix(U1:OUT)                             <--- error
.meas I_R1 MAX I(R1)                                            <--- good
.lib LT317A.sub
.backanno
.end

LTspice 24.1.7 for Windows
Circuit: C:\Users\name\Desktop\measbug.net
Start Time: Mon Apr 14 22:28:26 2025
solver = Alternate
Maximum thread count: 8
tnom = 27
temp = 27
method = trap
Direct Newton iteration failed to find .op point.  (Use ".option noopiter" to skip.)
Starting Gmin stepping
Gmin = 10
Gmin = 1.07374
Gmin = 0.115292
Gmin = 0.0123794
Gmin = 0.00132923
Gmin = 0.000142725
Gmin = 1.5325e-05
Gmin = 1.6455e-06
Gmin = 1.76685e-07
vernier = 0.5
Gmin = 2.96428e-08
vernier = 0.25
vernier = 0.125
vernier = 0.0625
vernier = 0.03125
vernier = 0.015625
vernier = 0.0078125
vernier = 0.00390625
vernier = 0.00195312
vernier = 0.000976562
vernier = 0.000488281
Gmin = 2.96428e-08
Gmin = 0
Gmin stepping failed

Starting source stepping with srcstepmethod=0
Could not converge to DC with sources off!
Starting source stepping with srcstepmethod=1
Could not converge to DC with sources off!
Pseudo Transient succeeded in finding the operating point at 327.969 ms.
Total elapsed time: 5.250 seconds.

Files loaded:
C:\Users\pietw\Desktop\measbug.net
C:\Users\pietw\AppData\Local\LTspice\lib\sub\LT317A.sub

C:\Users\pietw\Desktop\measbug.net(13): Current not found.
.meas I_LT317 MAX Ix(U1:OUT)
                  ^^^^^^^^^^

measbug.asc

  • Dear  ,

    Your .meas worked in prior versions only when run as part of a simulation. If you open just the .raw file and run the same .meas line via "Execute .MEAS Script", it will fail.

    Latest LTspice only understands names as listed in the .raw file. In your case, that's "Ix(u1:1)", "Ix(u1:2)", and "Ix(u1:3)".

    There currently isn't really a good solution, because the names "OUT" etc. come from the symbol and are not easily available to the simulator.

    Best Regards,
    Mathias

  • Thank you Mathias for this responds. Your expanation makes a lot of sense. Changing the port label to the port number solved the issue for my other simulations as well. All my post-simulation measurements run without errors now.

    The plot plane shows the trace lables (not the numbers) with the corresponding traces. I used to copy the trace-label from the plot plane to the .meas statement. It would be nice if this workflow could be restored in the future. For now this is a good work-around.

    Issue solved.

    Regards

  • Mathias,

    I hate to resurrect an old thread, but honestly this is a pretty annoying change. This is, in my opinion, a regression in behavior that most definitely was supported before. I have some very large measure script files that I now need to go and modify after reverse engineering the pin ordering. It seems to me that the software should be able to do this, even if it is "difficult", as this is definitely much more difficult to do manually than algorithmically. 

  • I was facing the exact same problem — my .meas file wasn’t picking up the "current" through a device pin. Like PWneth mentioned, I used to simply copy the quantity name directly from the plot pane trace, which was quick and convenient.


    Luckily, I had an older version of LTspice on another PC. There, my script was working fine. Turns out a newer version is annoying and does NOT let you use the quantity names from traces itself, which saves valuable time, as a designer.

    I have just reinstalled an older version of LTspice and ditching the 24.1.7 error. As another user mentioned, this is definitely regressive!

  • Hi  ,  ,

    LTspice 24.1.10 (to be released shortly) will support .measure with pin names again. It's going to be even better than before.

    Thanks for reporting!

    Best Regards,
    Mathias

  • Confirmed. Happy to see this functionality back again, thanks.