Post Go back to editing

Plot settings (.PLT) file incompatibility problem

Category: Software
Product Number: LTspice

For engineers who share simulations with one another, it is critical that their files be forwards and backwards compatible.  Old LTspice simulations must work (exactly the same, if possible) on newer LTspice versions - and simulations that were created on newer versions must work on older versions too - as long as they do not exploit new features or components that the older version did not have.

That compatibility has been violated here.  I have been seeing it for a while, but did not track it down until today.

The problem being considered here is with the Plot Settings (*.PLT) file.  If there is a micro (µ) symbol to be saved to the Plot Settings file, LTspice 26 corrupts it by saving it as a 2-byte combination.  Previous LTspice versions did not do that.  They saved the micro character as the normal 1-byte micro character in the ANSI extended ASCII character set, 0xB5.  LTspice has used that 1-byte micro character since forever, and still uses it.  It is found in every LTspice schematic that has values in microFarads or microHenries.  But now LTspice seems to be unable to write it to a .PLT file.

And that causes the compatibility problem.  Plot Settings files saved by LTspice 26 and contain a micro character, can not be read by older versions of LTspice.

Here is a line copied from a .PLT file written by LTspice 26:

      X: ('µ',0,0.00046,2e-05,0.00068)

Here is the same line copied from a .PLT file from LTspice XVII:

      X: ('µ',0,0.00046,2e-005,0.00068)

As you can see, LTspice 26 saved the "µ" character as "µ".  LTspice XVII does not understand the corrupted combination with the "Â" byte, so it rejects the .PLT file.  That is unacceptable.

Please fix LTspice 26, so that it correctly saves a "µ" as the non-Unicode "µ" (0xB5) like it used to do, without altering or corrupting it.  There is no need for it to do that.  Please restore LTspice's previous behavior, where it understood what a µ character was and does not try to cobble it.

I should point out that LTspice 26 does not have this deficiency when saving schematic or symbol files.  It seems to be only the Plot Settings (.PLT) file that is being corrupted.

Thanks,

Andy

Parents
  • Hi  ,

    Some more info from my testing. This appears to be a problem with the LTspice text editor, not just PLT files. Problem shows up in independent netlists as well, an I assume any text file saved from the text editor has this problem.

    Furthermore, appears to apply to all extended characters. 

    mike

  • I would assume that SOME extended characters require two bytes like this, so it might be unavoidable for those extended characters. 

    However, the micro character has a single-byte version, and previous versions of LTspice used it.  That seems to be what "broke" the PLT files for backwards compatibility.

    Thanks,

    Andy

  • Hi  ,

    Unfortunately, the problem is entirely in the Old LTspice file structure, which is not as standard an encoding as one might think.

    That is, you'll find that if you edit a netlist in a text editor, other than Old LTspice, you'll run into the same problem. This is an old problem, one of the reasons one should not edit a netlist or schematic in a text editor. It is possible, but unlikely that it will work. 

    So, why do ASC files not have this problem? That is because, ASC files are still (New LTspice > 24.1) stored in the ASC (Old LTspice) format for backward compatibility wrt to schematics. 

    I played around saving some simple text files using extended characters and saved using a number of formats. Old LTspice was not able to decode any of them. If you have found an.editor/save format that works, that might be a solution. I have heard of editors that work, but don't know which ones.

    It is possible that "Save As Legacy file structure" may be added as a feature in the future.

    mike

Reply
  • Hi  ,

    Unfortunately, the problem is entirely in the Old LTspice file structure, which is not as standard an encoding as one might think.

    That is, you'll find that if you edit a netlist in a text editor, other than Old LTspice, you'll run into the same problem. This is an old problem, one of the reasons one should not edit a netlist or schematic in a text editor. It is possible, but unlikely that it will work. 

    So, why do ASC files not have this problem? That is because, ASC files are still (New LTspice > 24.1) stored in the ASC (Old LTspice) format for backward compatibility wrt to schematics. 

    I played around saving some simple text files using extended characters and saved using a number of formats. Old LTspice was not able to decode any of them. If you have found an.editor/save format that works, that might be a solution. I have heard of editors that work, but don't know which ones.

    It is possible that "Save As Legacy file structure" may be added as a feature in the future.

    mike

Children
No Data

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.