Keyboard Shortcuts
Likes
- LTspice
- Messages
Search
Re: Syntax error on .MEAS in 24.1.x
开云体育OK, I get that it's a potential issue, although it has never arisen for me. Perhaps changes like this can be mentioned in the LTspice Change Log, with a note advising of potential backward compatibility problems? This is a sensitive issue, as it can break production systems.I understand the motivation for cleaning up the code, but it comes with risks. --
Regards, Tony On 20/05/2025 18:17, Mathias Born via
groups.io wrote:
|
Re: Syntax error on .MEAS in 24.1.x
This is an intentional change that removes an ambiguity.
Each measurement name can be used in other .meas expressions. Suppose you have two measurement names "A" and "A+A". What would be the meaning of the expression "A+A"?
In short, math operators are not allowed in parameter names.
?
Best Regards,
Mathias
?
On Tue, May 20, 2025 at 05:55 PM, Tony Casey wrote:
|
Syntax error on .MEAS in 24.1.x
开云体育A new error seems to have crept into
.MEAS directives on the 24.1 branch.
Measurement names are apparently not now allowed to have a sign character in them, e.g.: .MEAS Tpd+ param T1-T0 .MEAS Tpd- param T11-T10 .. results in: I:\tony\Documents\Simulations\LTspice\Comparator\UniversalComp\Dev\UniversalComp_Test.net(37): syntax error .MEAS Tpd+ param T1-T0 ???????? ^^^^^^^^^^^^^ I:\tony\Documents\Simulations\LTspice\Comparator\UniversalComp\Dev\UniversalComp_Test.net(38): syntax error .MEAS Tpd- param T11-T10 ???????? ^^^^^^^^^^^^^^^ This has worked in all previous versions. In the logfile, normally it would show, e.g.: tpd+: t1-t0=1.08114e-08 tpd-: t11-t10=1.09962e-08 -- Regards, Tony |
Re: Execute .meas file
开云体育Andy, you’re right, across the board. I do have Automatically Delete raw Files set to avoid accumulating large (sometimes huge) data files that I rarely need to refer to. Most simulations I do are quick to run, or re-run if I do want to dive deeper into logged data. ? These WCAs I’m working on are unusual in taking minutes to execute and creating very large outputs. My questions about the process and the responses I’ve received have been leading me to making Save exceptions for these runs, and learning just which files are required to revisit prior data for new queries. ? Thanks for your help! ? Dave ? From: [email protected] <[email protected]>
On Behalf Of Andy I via groups.io
Sent: Tuesday, May 20, 2025 6:59 AM To: [email protected] Subject: EXTERNAL: Re: [LTspice] Execute .meas file ? On Mon, May 19, 2025 at 09:56 PM, Bell, Dave wrote:
Dave, I think you are making this more complicated than it is, by doing it that way. ? Unless you have your LTspice configured to "Automatically delete .RAW files", uou should never need to make a copy of a .RAW file.? But if you find the need to make a copy, then why delete the original? ? The only reason to "Automatically delete .RAW files" is if you never ever want to revisit old simulations.? Otherwise, don't do that.? That setting is in Control Panel/Settings > Operation. ? The .RAW file IS your output data!? It is not just a "temporary" file.? It contains all the waveforms and simulated data (except for what little bit goes into the Error Log file), so deleting it seems pointless.? Without that file, you've lost all your simulated data. ? View > Visible Traces re-loads the .RAW file data.? If View > Visible Traces is greyed-out,? then there is no .RAW file to load.? That happens either because
Clearly you first have to know what you are doing.? If there's no .RAW file, then there is nothing to load. ? LTspice has a setting (in Control Panel/Settings > Waveforms) to save the output files including .RAW in a specific directory instead of the normal one with the schematic, and I am not sure if or how it affects its ability to find and re-open the .RAW file.? Obviously, if you re-use a schematic filename (e.g., "Draft1", it will overwrite the old .RAW file.? The schematics can be distinct because they were in different folders, but the .RAW files are not because they are all in one big barrel - with that setting. ?
It does.? Reloading it with its schematic is most ideal - for me, anyway - because it allows you to look at its schematic and pick what you want to plot.? But if your only objective is to re-run a .MEAS script and nothing else, then the only things needed are the .RAW file and the .MEAS scripts.? Yes, you can do that blindly. ? Andy ? |
Re: round () function on AC measurements does crash on old versions and just delivers zero at latest version
On Tue, May 20, 2025 at 10:55 AM, John Woodgate wrote:
Perhaps we will never know.
?
Perhaps there is a reason involving the math library, though it seems counter-intuitive.
?
Perhaps that is how it was done in other SPICE programs, and LTspice was designed to be compatible with existing syntax.
?
? |
Re: round () function on AC measurements does crash on old versions and just delivers zero at latest version
开云体育From the Help, under Waveform Arithmetic: The functions Re(x) and Im(x) are available for complex data and return a complex number with the real part equal to the real or imaginary part of the argument respectively and the imaginary part equal to zero. I wonder why that is so. The zero imaginary part seems useless,
and it prevents, for example, the syntax Re(round(expression))
being used to produce the result that the OP wants. On 2025-05-20 15:22, Andy I via
groups.io wrote:
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion |
Re: round () function on AC measurements does crash on old versions and just delivers zero at latest version
I missed that you wrote this:
I thought maybe it appeared when you pasted it into the message.? Is that funny character there in the .LOG file too?
?
I'm thinking the degree character (°) was written as Unicode and that is probably the cause of the errant (?) character in front of it.? But perhaps not.
?
Andy
?
|
Re: round () function on AC measurements does crash on old versions and just delivers zero at latest version
I don't know if this is related --
?
But mag() returns a complex number in .AC analysis.? Perhaps round() can only take a real argument.? Giving round() a complex argument might be the cause of both problems - the crash in earlier versions, and returning 0 in the latest version.
?
Referring to the Help page, it implies that round(x) was perhaps able to accept complex arguments, originally.? It is not listed as one of the exceptions that does not accept complex data.? Perhaps it had that ability but lost it somewhere along the way, while LTspice evolved, and nobody reported it, or someone did but it was not yet taken up as an action item to fix.? Have you reported it to ADI?
?
By the way, the results you pasted into the message appear to have included some non-ASCII text (0?°), which probably did not look like that originally.
?
Andy
? |
Re: round () function on AC measurements does crash on old versions and just delivers zero at latest version
开云体育On 20/05/2025 15:51, oerni via
groups.io wrote:
By using round() in .AC analyses, you're requesting the round operation is performed on a complex number. I'm not sure that is meaningful. Just because you're using it on the result of a mag() function doesn't change this, as as mag() still returns a complex number. I'm not surprised it doesn't work. -- Regards, Tony |
Re: Execute .meas file
On Mon, May 19, 2025 at 09:56 PM, Bell, Dave wrote:
Dave, I think you are making this more complicated than it is, by doing it that way. ?
Unless you have your LTspice configured to "Automatically delete .RAW files", uou should never need to make a copy of a .RAW file.? But if you find the need to make a copy, then why delete the original?
?
The only reason to "Automatically delete .RAW files" is if you never ever want to revisit old simulations.? Otherwise, don't do that.? That setting is in Control Panel/Settings > Operation.
?
The .RAW file IS your output data!? It is not just a "temporary" file.? It contains all the waveforms and simulated data (except for what little bit goes into the Error Log file), so deleting it seems pointless.? Without that file, you've lost all your simulated data.
?
View > Visible Traces re-loads the .RAW file data.? If View > Visible Traces is greyed-out,? then there is no .RAW file to load.? That happens either because
Clearly you first have to know what you are doing.? If there's no .RAW file, then there is nothing to load.
?
LTspice has a setting (in Control Panel/Settings > Waveforms) to save the output files including .RAW in a specific directory instead of the normal one with the schematic, and I am not sure if or how it affects its ability to find and re-open the .RAW file.? Obviously, if you re-use a schematic filename (e.g., "Draft1", it will overwrite the old .RAW file.? The schematics can be distinct because they were in different folders, but the .RAW files are not because they are all in one big barrel - with that setting.
?
It does.? Reloading it with its schematic is most ideal - for me, anyway - because it allows you to look at its schematic and pick what you want to plot.? But if your only objective is to re-run a .MEAS script and nothing else, then the only things needed are the .RAW file and the .MEAS scripts.? Yes, you can do that blindly.
?
Andy
? |
round () function on AC measurements does crash on old versions and just delivers zero at latest version
using round to get better readable results (e.g. mV's with one further number after the dot) in the measurements does not work for me in AC measurements while it works fine for TRAN.
?
running .AC the following statements bring the below listed results
?
.OPTIONS meascplxfmt=polar
.MEAS V_ACOMP_max_IC7_p18_mV ? ? ? ? ? ? ? ? ? ?PARAM (V_ACOMP_max_IC7_p18*1000*10)/10 .MEAS V_ACOMP_max_IC7_p18_mV_2 ? ? ? ? ? ? ? ? ? ?PARAM round(mag((V_ACOMP_max_IC7_p18*1000*10)/10))
.MEAS AC V_ACOMP_max_IC7_p18_mV_3 ? ? ? ? ? ? ? ? PARAM round(mag((V_ACOMP_max_IC7_p18*1000*10)/10)) leads to
v_acomp_max_ic7_p18_mv: (V_ACOMP_max_IC7_p18*1000*10)/10=(24.2389660125,0?°)
v_acomp_max_ic7_p18_mv_2: round(mag((V_ACOMP_max_IC7_p18*1000*10)/10))=(0,0?°) v_acomp_max_ic7_p18_mv_3: round(mag((V_ACOMP_max_IC7_p18*1000*10)/10))=(0,0?°) ?
In former versions e.g. 24.0.12 using round() even crashed and said: this is a bug, please report it.
Now with 24.1.8 it does not crash but reports zero...but maybe I am doin wrong because I don't get converted (not even with mag() ) this cartesian numbers to normal values.
Also the ASCII character in front of ° looks weired since new version installed. |
Re: Execute .meas file
开云体育To follow up, loading a .raw file directly then works to execute .meas files. So, answering my original question, after a complete Run, save (in Settings) the raw file(s), or make a copy, while the simulation is still in the app, Reloading that .raw file gives access to the large data from a long and multipart simulation. ? Dave ? From: [email protected] <[email protected]>
On Behalf Of Bell, Dave via groups.io
Sent: Monday, May 19, 2025 5:27 PM To: [email protected] Subject: EXTERNAL: Re: [LTspice] Execute .meas file ? I closed LTspice along with the schematic, then opened just the sch. View, either by right-clicking the schematic, or from the View menu option, has Visible Traces grayed out until a Run. ? I haven’t yet tried opening a RAW file directly. That’s next… ? From:
[email protected] <[email protected]>
On Behalf Of Andy I via groups.io ? You can also open a .RAW file directly into LTspice, and see all your waveforms, and maybe run .MEAS scripts.? But doing it that way, they won't be associated with a schematic.? To re-establish the ability to click on schematic nets to see waveforms, you have to open the schematic first, then View > Visible Traces. ? I went my first few years using LTspice, not aware that I should do that - until Helmut pointed it out. ? Andy ? |
Re: Execute .meas file
开云体育I closed LTspice along with the schematic, then opened just the sch. View, either by right-clicking the schematic, or from the View menu option, has Visible Traces grayed out until a Run. ? I haven’t yet tried opening a RAW file directly. That’s next… ? From: [email protected] <[email protected]>
On Behalf Of Andy I via groups.io
Sent: Monday, May 19, 2025 5:00 PM To: [email protected] Subject: EXTERNAL: Re: [LTspice] Execute .meas file ? You can also open a .RAW file directly into LTspice, and see all your waveforms, and maybe run .MEAS scripts.? But doing it that way, they won't be associated with a schematic.? To re-establish the ability to click on schematic nets to see waveforms, you have to open the schematic first, then View > Visible Traces. ? I went my first few years using LTspice, not aware that I should do that - until Helmut pointed it out. ? Andy ? |
Re: Execute .meas file
You can also open a .RAW file directly into LTspice, and see all your waveforms, and maybe run .MEAS scripts.? But doing it that way, they won't be associated with a schematic.? To re-establish the ability to click on schematic nets to see waveforms, you have to open the schematic first, then View > Visible Traces.
?
I went my first few years using LTspice, not aware that I should do that - until Helmut pointed it out.
?
Andy
? |
Re: Execute .meas file
开云体育Thanks, Andy! ?
But if I rename that with a different extension, it still runs the script. In the Help. there’s a hint that it can also derive data from the Plot.
That would load everything back into memory. ? ? From: [email protected] <[email protected]>
On Behalf Of Andy I via groups.io
Sent: Monday, May 19, 2025 3:33 PM To: [email protected] Subject: EXTERNAL: Re: [LTspice] Execute .meas file ? I am not in the habit of running .MEAS scripts, so my answers may or may not help ? Bell, Dave wrote:
I would not think you need any temporary files.? I could be wrong, but I think you need only the .MEAS script files themselves, and of course the .RAW output file. ?
If you come back to a previously run simulation and want to examine the results without re-running the simulation, use Right-click > View > Visible Traces.? That loads the .RAW file back into LTspice and you should be back to where you were when the simulation completed.? I'm assuming that would be all you need to do before executing .MEAS scripts. ? The alternative to Right-click is: View (menu bar) > Visible Traces.? The hotkeys are Alt-V-V (in older LTspice versions). ? Andy ? |
Re: Execute .meas file
I am not in the habit of running .MEAS scripts, so my answers may or may not help
?
Bell, Dave wrote:
I would not think you need any temporary files.? I could be wrong, but I think you need only the .MEAS script files themselves, and of course the .RAW output file.
If you come back to a previously run simulation and want to examine the results without re-running the simulation, use Right-click > View > Visible Traces.? That loads the .RAW file back into LTspice and you should be back to where you were when the simulation completed.? I'm assuming that would be all you need to do before executing .MEAS scripts.
?
The alternative to Right-click is: View (menu bar) > Visible Traces.? The hotkeys are Alt-V-V (in older LTspice versions).
?
Andy
? |
Re: LT1680
On Mon, May 19, 2025 at 06:02 PM, Pietro wrote:
I am not employed by Analog Devices, but I can say with high confidence that the LTspice LT1680 model is correct and it simply did not include those two pins because they aren't needed in the simulations. ?
Vref is an internally generated DC voltage that needs a bypass capacitor connected to it, so it has a pin where you can connect one.? You won't use it for anything else, and the SPICE simulation doesn't need it.
?
I do not know much about the SYNC pin, except that it seems to be optional, and they recommend grounding it if it is not used.? From the signal name, I am guessing it may have something to do with synchronizing multiple LT1680 parts together.? If you are doing that, then make sure to read the datasheet carefully.? My guess is that they did not include it in the SPICE model because it is rarely ever used, and it likely won't affect the simulation of your DC voltages.
?
It is not unusual for SPICE models to omit pins that are rarely used.? I guess this is the first time you saw that.
?
Andy
? |
Re: LT1680
I mentioned this already, but I think it is worth a bit more elaboration.??John Woodgate wrote:
SPICE/LTspice simulations are never meant to constitute the full and complete design database for a circuit layout.? Yes, you can take a schematic in LTspice and export it to a file that can be read by a PC layout program, and that's fine.? But you should ALWAYS assume that the LTspice-generated netlist does not have some things that are necessary for the physical layout, because they were not needed to simulate the circuit.? It should ALWAYS be assumed that modifications and touch-ups will be needed, after the circuit is ported into a PCB layout system.? Anyone who takes an LTspice simulation, exports it to a layout program, and blindly uses it that way is "shooting themselves in the foot".
?
The SPICE models for many ICs are not 100% complete and do not include some physical pins.? Some LTspice models omit pins and the functions that connect to those pins, because almost no design engineer ever needs to simulate those parts of the circuit.? So they are omitted from the LTspice model and from the LTspice simulation.? But the real IC has them, and you may need to do something with those pins in the physical design even though they were not a part of the simulation.
?
? |
Re: LT1680
Andy I I studied the datasheet, I know that it is my final responsibility to make design choices according to my skills, but I believe that the community serves the purpose of sharing problems and solutions and maybe this problem has already been solved by some other member since it is a component from the year 2004 (21 years). I am writing this post not because I do not know how to connect the 2 missing pins but because I have doubts that the component in LTspice LT1680 is wrong and maybe there is a valid file to replace in the simulation. (As often happens). |