Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

To .inc or not to .inc a library in LTS?

Status
Not open for further replies.

alec_t

Well-Known Member
Most Helpful Member
I've recently downloaded the tectriac.lib file from the Yahoo LTS group and saved it in the LTS sub folder. I drew a schematic including the triac modelled in the library and was surprised to find the sim ran ok without having to use the ".inc tectriac.lib" command. What's going on?
 
You can't just include the triac model and have it work, the symbol itself related to the triac in the schematic needs to be re-directed to the specific sub circuit in the library file, it's no longer a 'model' at that point strictly speaking from a SPICE perspective it's a sub circuit. You were likely never simulating based on the sub circuit model you thought you provided, just on the default triac model for the symbol you loaded.
 
Last edited:
Thanks, that could explain it. I didn't realise LTS had a default triac model. But that raises a further question. LTS includes as standard a triac symbol, but the symbol description says the user has to provide a model. Why, if there's already a default model?
 
I've recently downloaded the tectriac.lib file from the Yahoo LTS group and saved it in the LTS sub folder. I drew a schematic including the triac modelled in the library and was surprised to find the sim ran ok without having to use the ".inc tectriac.lib" command. What's going on?

hi alec,
If you post the asc for the sim you ran using the default model, I will give it a look over.

E.
 
Yer tiz. If you plot I(Lamp) the main triac seems to be doing its thing ok without tectriac.lib being referenced. I know you have CD4000.lib, but you might want to mod the circuit to omit the opto if you don't have the library file MOC302x.lib.

Edit: I'm just wondering if by referencing the MOC302x.lib perhaps LTS gets enough info to not need an explicit ref to tectriac.lib ?
 
Last edited:
hi,
If you run that sim from your desktop you will get the cannot find 'tectriac.lib', which is what you would expect.

If you look in C:\Program Files\LTC\LTspiceIV\lib, you will see the tectriac.lib.

Open the tectriac.lib using a text editor, you will see the L6008L6 listed amongst many other Triacs, near the end of the file.

When using F2 and 'Triac_SCR' folder 'TRIAC_Teccor uses the L6008L6 as its default model.

If you want to choose one from the list in the above lib file, just replace the L6008L6 with the new type number on your asc file drawing.


So you dont have to include tectriac.lib, its part of LTS.

If you use another triac.lib, you could place it in the Libs and include as required.

E.
 
Last edited:
Thanks for that, Eric.
When using F2 and 'Triac_SCR' folder '
My LTS version (updated recently) doesn't have such a folder :(
So you dont have to include tectriac.lib, its part of LTS.
Not part of mine. I had to download it from the Yahoo group.
 
hi alec,
Over time I have added a number of libs, as required, from YLTS, so the 'Triac_SCR' folder maybe one of those.

When you update LTS, it doesn't remove any of your existing added libs etc, it refreshes existing 'original' files and adds some new files.

Some of my files are in this zip

E.
 
Last edited:
Thanks for the zip, Eric. I'm still puzzled, though, over how the triac gets simulated without a specific reference to its library :confused:.
 
Edit: I'm just wondering if by referencing the MOC302x.lib perhaps LTS gets enough info to not need an explicit ref to tectriac.lib ?
More than likely, all you have to do is open the MOC302x.lib in a text editor and read it a bit.
 
I think I've sussed it. If I invoke the Attribute Editor for the triac symbol I can see the SpiceFile attribute is 'tectriac.lib'. So the library file gets netlisted ok without me having to .inc it.
I've been playing with the SpiceFile attribute for the CD4001B symbol to see if I could do the same trick; but no luck. I just get the message 'can't find CD4000.lib' when I try running a sim with a CD4001B, unless I explicitly .inc CD4000.lib on the schematic. Weird.

Edit: For 'SpiceFile' read 'ModelFile'
 
Last edited:
I've been playing with the SpiceFile attribute for the CD4001B symbol to see if I could do the same trick; but no luck. I just get the message 'can't find CD4000.lib' when I try running a sim with a CD4001B, unless I explicitly .inc CD4000.lib on the schematic. Weird.
Verify your path statement before you say that.
 
Verify your path statement before you say that
I thought I had. AFAIK the default LTS path includes the lib/sub folder, which is where my CD4000.lib file is located. So by specifying the symbol attribute ModelFile merely as 'CD4000.lib' shouldn't LTS be able to find it? This method works for other libraries in the sub folder; why not the CD4000 one? For example I often use DVIEW. By editing the ModelFile attribute for the DVIEW10 and DVIEW5 symbols I no longer have to remember to '.inc DVIEW.lib' every time I use them. Much more convenient.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top