Post Go back to editing

LTSpice 24.1.7 .meas error

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