Author Topic: LTspice: could not open library file "..\my_model.spice.txt" What is .spice.txt  (Read 12453 times)

0 Members and 1 Guest are viewing this topic.

Offline DmeadsTopic starter

  • Regular Contributor
  • *
  • Posts: 171
  • Country: us
  • who needs deep learning when you have 555 timers
Hullo!

Hope yall doing well. Im working on a project with another person. they sent me the .asc file and the .asy file for the model in question. Lets just call it my_model.

I was able to copy my_model.asy to the lib directory and get the component to load into the schematic, but I can run the sim.

The error is  'Could not open library file "C:\Users\JohnDoe\Downloads\my_model.spice.txt"

John Doe is the person I am working with, so obviously the path is wrong because its not the same computer, but I have never heard of a .spice.txt extension. There is also no directive to look for the file anywhere on the schematic, and no file that I can find with a .spice.txt extension anywhere

Could someone tell me where this error is coming from and how to fix it? thanks

-Dom
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13179
Although LTspice has certain preferred filetypes for SPICE models, model libraries, netlists etc. it really doesn't care what extension a SPICE file has that you include with a. include or .lib directive, or auto-load as the model file in a symbol.

JohnDoe has obviously downloaded (or maybe created, but its pretty sloppy to do that in your downloads folder) a SPICE model 'my_model.spice.txt'.  Then something in the sim (.asc file) refers to it with its full path.  I *HOPE* you'd have spotted an obvious .include or .lib referring to that file & path, so its got to be set as the ModelFile attribute of the symbol (.asy file).

To fix it, you need to get the missing file - its probably easiest to simply have your friend send it to you.  Then put the symbol, sim and the model in a new folder, and edit the symbol's ModelFile attribute to strip the path so it uses the model in the current folder.   Edit the .asc sim file in a text editor that can be trusted not to insert crap in a plain text file, and check for a SYMBOL line referring to my_model, which is the symbol filename without the .asy.   If there's no path in front of the model name, LTspice searches the current directory before lib\sym.  If there is a full path, it goes off and uses that symbol,  which can cause great confusion.  If you are careful you can strip the unwanted path in the text editor, then reopen the sim in LTspice. (Caution: components in sub-folders of lib\sym will have partial paths relative to that folder)  Alternatively, Ctrl-RightClick the component on the LTspice sim, make a note of any attributes that have been customised, close the dialog, delete the component, and place a new instance of the component to replace it to the sim, from the current folder as the 'Top Directory' (at the top of the Select Component dialog) and once placed take care to re-customise any attributes you noted earlier.

Doing it this way with the custom symbol, sim and model file all in the same folder aids portability, as you no longer have to sync libraries with everyone you collaborate with.   Instead, simply zip up your sim's working folder, complete with all .asc, .asy and model files (often .lib, .sub, .cir, or .inc, but that's not exhaustive), and the .plt file if you have set up a complicated plot window, but excluding generated files like .log,.net and .raw.   The zipped sim is then portable to any LTspice install (unless you've missed another non-standard component).

« Last Edit: July 22, 2020, 09:14:16 pm by Ian.M »
 
The following users thanked this post: Dmeads

Offline DmeadsTopic starter

  • Regular Contributor
  • *
  • Posts: 171
  • Country: us
  • who needs deep learning when you have 555 timers
Thank you so so much. I appreciate the thorough answer.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf