¿ªÔÆÌåÓýOn 24/02/2025 06:54, eewiz via
groups.io wrote:
This .MEAS will fail because LTspice doesn't test for inequalities. It test for equalities. You are looking for a single instance in time - the answer cannot be an interval. Assuming you can actually plot V(XSW11:X1:Qc,XSW11:X1:Qe), do you actually see any time when its value is less than 1? Also, when you have complex expressions that fail, the procedure for debugging them is to simplify, so you can home in on which part is failing. "FAIL'ed diagnostic is not very helpful! So, try: .MEAS TRAN T1 when V(XSW11:X1:Qc,XSW11:X1:Qe)=1 cross=1 That will tell you when the expression is first true, but not the trajectory. Or: .MEAS TRAN T2 when V(XSW11:X1:Qc,XSW11:X1:Qe)=1 fall=1 .MEAS TRAN T3 when V(XSW11:X1:Qc,XSW11:X1:Qe)=1 rise=1 If both .MEASs succeed and T2 < T3, then V(XSW11:X1:Qc,XSW11:X1:Qe) < 1 between T2 and T3, ¡à T2 to T3 is your desired interval. If T3 succeeds but not T2, then the expression is true from time = 0 to T3, but not afterwards. You can extend the logic to find the other possibilities. If?V(XSW11:X1:Qc,XSW11:X1:Qe) is periodic, then there may be other intervals when the expression is true. .MEAS is not well suited to this kind of thing, although you can set the rise= or fall= qualifiers to different values in multiple .MEASs. N.B. You could also plot: if(V(XSW11:X1:Qc,XSW11:X1:Qe)<1,1,0) ..in a separate pane in the waveform viewer, which will plot multiple intervals when the expression is true. It sounds like this might be more useful for you. -- Regards, Tony |