¿ªÔÆÌåÓý

LTSpice Model for Photo Triac - VOM160


 

Hi,
I'm new to this group? and LTSpice simulation as well. So far it has been very helpful to the design of my circuit. Now i need to add a photo triac.
I tried looking at LTSpice available libraries but could not find a model for a photo triac. Would there be one for the part no. VOM160? Or similar one?
Thanks and best regards,
Eric





 

¿ªÔÆÌåÓý

Have you downloaded and saved all_files.htm from the web site? Open it in your browser and search for phototriac.

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-20 22:46, Eric Henares eohenares@... [LTspice] wrote:

?
Hi,
I'm new to this group? and LTSpice simulation as well. So far it has been very helpful to the design of my circuit. Now i need to add a photo triac.
I tried looking at LTSpice available libraries but could not find a model for a photo triac. Would there be one for the part no. VOM160? Or similar one?
Thanks and best regards,
Eric





 

Hello John,
Thank you very much. I will? try that..
Best regards,
Eric


On Tue, Nov 20, 2018 at 6:02 PM John Woodgate jmw@... [LTspice] <LTspice@...> wrote:
?

Have you downloaded and saved all_files.htm from the web site? Open it in your browser and search for phototriac.

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-20 22:46, Eric Henares eohenares@... [LTspice] wrote:
?
Hi,
I'm new to this group? and LTSpice simulation as well. So far it has been very helpful to the design of my circuit. Now i need to add a photo triac.
I tried looking at LTSpice available libraries but could not find a model for a photo triac. Would there be one for the part no. VOM160? Or similar one?
Thanks and best regards,
Eric





 

I suggest also searching with these search terms:
? ? "opto-triac"
? ? "optotriac"
? ? "opto triac:
and even simply "opto" if you are willing to filter through the many results.

There are a few instances of "opto-triac", "optotriac", and "opto triac" already in the Table of Contents file (all_files.htm), but I don't know if your Vishay part might be one of them.

There is even one match for "photo triac" (with the space).

Obviously, no search is perfect because many combinations of words can be used for the same thing, so you have to think creatively.

By the way, Eric -- When starting a new question in this forum, please use the "New Topic" button, not the "Reply" button.? Even though you changed the Subject line, your message is linked to the question about the HV9110 PWM controller (which you replied to).? The Yahoo!Groups website is at least partly thread-aware, and it keeps your replies within that original conversation even though you changed the Subject line.? Therefore, use "New Topic" to start a new topic.? (This affects some people's email programs too.)? If you don't see the "New Topic" button, go back to the group's main webpage, by clicking on "LTspice" in bigger letters near the top of the page.

Regards,
Andy



 

Hello John,
Pls kindly wish to consult. I found the MOC308x phototriac circuit simulation (solved) from the htm files.? I tried to RUN it but it won't. I uploaded the file named MOC308xSimulation for your reference.
Not sure what is wrong? Do I need to do something else?? How do I load this part into my library??
I have tried separately loading stand alone .lib model and symbol of the same part also found in the htm files but seems I can't make it work too.
Thanks and best regards,
Eric


On Tue, Nov 20, 2018 at 6:17 PM Eric Henares <eohenares@...> wrote:
Hello John,
Thank you very much. I will? try that..
Best regards,
Eric

On Tue, Nov 20, 2018 at 6:02 PM John Woodgate jmw@... [LTspice] <LTspice@...> wrote:
?

Have you downloaded and saved all_files.htm from the web site? Open it in your browser and search for phototriac.

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-20 22:46, Eric Henares eohenares@... [LTspice] wrote:
?
Hi,
I'm new to this group? and LTSpice simulation as well. So far it has been very helpful to the design of my circuit. Now i need to add a photo triac.
I tried looking at LTSpice available libraries but could not find a model for a photo triac. Would there be one for the part no. VOM160? Or similar one?
Thanks and best regards,
Eric





 

Hello Andy,
I found a part MOC308x and uploaded into my library. I couldn't make it work. Maybe I have not done it correctly. But I also found a circuit containing the same part that has been "solved" already.
I tried to Run it but wouldn't. Not sure what is wrong. I have uploaded the file named MOC308xSimulation. I just saw your mail now so I had asked help from John already.
Yes sorry I was not aware to use the new topic button.
Thanks and best regards,
Eric


On Tue, Nov 20, 2018 at 10:20 PM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

I suggest also searching with these search terms:
? ? "opto-triac"
? ? "optotriac"
? ? "opto triac:
and even simply "opto" if you are willing to filter through the many results.

There are a few instances of "opto-triac", "optotriac", and "opto triac" already in the Table of Contents file (all_files.htm), but I don't know if your Vishay part might be one of them.

There is even one match for "photo triac" (with the space).

Obviously, no search is perfect because many combinations of words can be used for the same thing, so you have to think creatively.

By the way, Eric -- When starting a new question in this forum, please use the "New Topic" button, not the "Reply" button.? Even though you changed the Subject line, your message is linked to the question about the HV9110 PWM controller (which you replied to).? The Yahoo!Groups website is at least partly thread-aware, and it keeps your replies within that original conversation even though you changed the Subject line.? Therefore, use "New Topic" to start a new topic.? (This affects some people's email programs too.)? If you don't see the "New Topic" button, go back to the group's main webpage, by clicking on "LTspice" in bigger letters near the top of the page.

Regards,
Andy



 

Eric wrote:

? ? "I found the MOC308x phototriac circuit simulation (solved) from the htm files.? I tried to RUN it but it won't."

I downloaded it (it's the same file that was uploaded here around a month ago), extracted it, and it ran.? There were a bunch of "heightened def con" messages in the .log file, but those are not necessarily bad, and they don't indicate failure.

So, it always helps to tell us what didn't work.? Did your computer shut off, or burst into flames?? Was there an error message?? If there was, what was it?? Try to be specific.? Also tell us which version of LTspice you used: LTspice IV or LTspice XVII.

All I did was create a brand new folder, extract the contents of the ZIP file into that folder, open the .asc file in LTspice, and press RUN.? There was nothing else to do.? You didn't move any of the files anywhere else, did you?

Have you altered your LTspice settings?? You might have changed the settings in the Control Panel at some point.? If you think you might have done that, open the Control Panel (hammer icon), press "Reset to Default Values", and OK.? Then try running the simulation again.

? ? "How do I load this part into my library?"

I think you need only these two files:
? ? LED_TRIAC_ZCS.asy
? ? MOC308x.lib
You can either put them in the folder with the schematic(s) that will use them, or add them to LTspice's libraries.? I prefer the former, but you could do either.

To add them to LTspice's libraries, move or copy LED_TRIAC_ZCS.asy here:
? ? Documents\LTspiceXVII\lib\sym\
or to a subdirectory of it.? Move or copy MOC308x.lib here:
? ? Documents\LTspiceXVII\lib\sub\
(must be that folder, not a subdirectory of it).

If you leave both files in the folder with your schematic, you'll need to do one extra step when putting the symbol on a schematic.? Open the schematic file in LTspice (if it's new, make sure to save it so that its file is in the current folder).? Go to the Add Components menu.? At the top, there is a line for "Top Directory" with two choices.? One is LTspice's library; the other is the current directory.? Change it to the current directory.? Now the LED_TRIAC_ZCS symbol should be in the menu and can be selected.

Whichever method you used, follow these steps:

(1)? Add a LED_TRIAC_ZCS symbol to the schematic.
(2)? Right-click on the text LED_TRIAC_ZCS under the symbol, and change it to MOC3083.
(3)? Add this line as a SPICE Directive:

? ? .lib MOC308x.lib

I am not 100% certain that the above steps work, but I think they should be right.

Regards,
Andy



 

Hi Andy,
Thank you very much for your very quick reply and taking your time to explain details. I will continue with this query after my personal errand.?
Best regards,
Eric

On Wed, Nov 21, 2018 at 12:41 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric wrote:

? ? "I found the MOC308x phototriac circuit simulation (solved) from the htm files.? I tried to RUN it but it won't."

I downloaded it (it's the same file that was uploaded here around a month ago), extracted it, and it ran.? There were a bunch of "heightened def con" messages in the .log file, but those are not necessarily bad, and they don't indicate failure.

So, it always helps to tell us what didn't work.? Did your computer shut off, or burst into flames?? Was there an error message?? If there was, what was it?? Try to be specific.? Also tell us which version of LTspice you used: LTspice IV or LTspice XVII.

All I did was create a brand new folder, extract the contents of the ZIP file into that folder, open the .asc file in LTspice, and press RUN.? There was nothing else to do.? You didn't move any of the files anywhere else, did you?

Have you altered your LTspice settings?? You might have changed the settings in the Control Panel at some point.? If you think you might have done that, open the Control Panel (hammer icon), press "Reset to Default Values", and OK.? Then try running the simulation again.

? ? "How do I load this part into my library?"

I think you need only these two files:
? ? LED_TRIAC_ZCS..asy
? ? MOC308x.lib
You can either put them in the folder with the schematic(s) that will use them, or add them to LTspice's libraries.? I prefer the former, but you could do either.

To add them to LTspice's libraries, move or copy LED_TRIAC_ZCS.asy here:
? ? Documents\LTspiceXVII\lib\sym\
or to a subdirectory of it.? Move or copy MOC308x.lib here:
? ? Documents\LTspiceXVII\lib\sub\
(must be that folder, not a subdirectory of it).

If you leave both files in the folder with your schematic, you'll need to do one extra step when putting the symbol on a schematic.? Open the schematic file in LTspice (if it's new, make sure to save it so that its file is in the current folder).? Go to the Add Components menu.? At the top, there is a line for "Top Directory" with two choices.? One is LTspice's library; the other is the current directory.? Change it to the current directory.? Now the LED_TRIAC_ZCS symbol should be in the menu and can be selected.

Whichever method you used, follow these steps:

(1)? Add a LED_TRIAC_ZCS symbol to the schematic.
(2)? Right-click on the text LED_TRIAC_ZCS under the symbol, and change it to MOC3083.
(3)? Add this line as a SPICE Directive:

? ? .lib MOC308x.lib

I am not 100% certain that the above steps work, but I think they should be right.

Regards,
Andy



 

Hi Andy,

I have LTSpice XVII which was just updated then. When I opened the zip file, I just clicked into the heater circuit schematic file? and it opened automatically in the LTSpice space.??
So I clicked Run but I remember it displayed something like MOC308x.lib can't be found. I didn't know what was going on and I thought you will also see the same thing when you open it.? Thus I posted it .
After reading your instructions, I loaded the .lib files to "sub" directory, and all symbols to the "sym" directory, and loaded the schematics to my drive D simulations file. Then on LTSpice space, I opened the saved
schematics and Run it. Wallah it ran:). By the way, the LTSpice XXVII program is on my C drive while I save all my trial schematics on my D drive. Is this an issue?

So now I tried to draw a simple fresh schematic using the newly loaded??LED_TRIAC_ZCS?part. It wouldn't run. It flagged this issue " Unknown subcircuit called in: xu2 n002 0 n003 0 led_triac_ZCS.

So I tried to copy the original heater schematic, paste it into a new schematic page in LTSpice space, then modify it to be exactly like my fresh circuit, it works. So I'm not sure where the problem is.?

I uploaded both circuits so you can maybe is it okay you can take a look. The description? is MOC3083 Trial Circuit Comparison.

Thanks and best regards,
Eric


On Wed, Nov 21, 2018 at 11:08 AM Eric Henares <eohenares@...> wrote:
Hi Andy,
Thank you very much for your very quick reply and taking your time to explain details. I will continue with this query after my personal errand.?
Best regards,
Eric

On Wed, Nov 21, 2018 at 12:41 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric wrote:

? ? "I found the MOC308x phototriac circuit simulation (solved) from the htm files.? I tried to RUN it but it won't."

I downloaded it (it's the same file that was uploaded here around a month ago), extracted it, and it ran.? There were a bunch of "heightened def con" messages in the .log file, but those are not necessarily bad, and they don't indicate failure.

So, it always helps to tell us what didn't work.? Did your computer shut off, or burst into flames?? Was there an error message?? If there was, what was it?? Try to be specific.? Also tell us which version of LTspice you used: LTspice IV or LTspice XVII.

All I did was create a brand new folder, extract the contents of the ZIP file into that folder, open the .asc file in LTspice, and press RUN.? There was nothing else to do.? You didn't move any of the files anywhere else, did you?

Have you altered your LTspice settings?? You might have changed the settings in the Control Panel at some point.? If you think you might have done that, open the Control Panel (hammer icon), press "Reset to Default Values", and OK.? Then try running the simulation again.

? ? "How do I load this part into my library?"

I think you need only these two files:
? ? LED_TRIAC_ZCS..asy
? ? MOC308x.lib
You can either put them in the folder with the schematic(s) that will use them, or add them to LTspice's libraries.? I prefer the former, but you could do either.

To add them to LTspice's libraries, move or copy LED_TRIAC_ZCS.asy here:
? ? Documents\LTspiceXVII\lib\sym\
or to a subdirectory of it.? Move or copy MOC308x.lib here:
? ? Documents\LTspiceXVII\lib\sub\
(must be that folder, not a subdirectory of it).

If you leave both files in the folder with your schematic, you'll need to do one extra step when putting the symbol on a schematic.? Open the schematic file in LTspice (if it's new, make sure to save it so that its file is in the current folder).? Go to the Add Components menu.? At the top, there is a line for "Top Directory" with two choices.? One is LTspice's library; the other is the current directory.? Change it to the current directory.? Now the LED_TRIAC_ZCS symbol should be in the menu and can be selected.

Whichever method you used, follow these steps:

(1)? Add a LED_TRIAC_ZCS symbol to the schematic.
(2)? Right-click on the text LED_TRIAC_ZCS under the symbol, and change it to MOC3083.
(3)? Add this line as a SPICE Directive:

? ? .lib MOC308x.lib

I am not 100% certain that the above steps work, but I think they should be right.

Regards,
Andy



 

Hi Eric,

If you run LTspice with the schematic that's inside the ZIP file, then that is the problem.? When you open something in a ZIP archive, Windows creates a temporary copy of JUST that one file, nothing else.? So none of the library and symbol files are there with it.? They are still in the ZIP file, but not in the temporary folder where Windows put the schematic file before sending it to LTspice.

You have to extract the contents of the ZIP file.? Then you can run it.? Running from a ZIP file works only if there are no other files involved.

(I don't think it matters, but I use a separate program for opening ZIP files on my PC.? I'm aware that MS-Windows itself can open ZIP files, but I don't let it do that.)

There is no need to move any files to other locations, not with this ZIP file.

? ? "By the way, the LTSpice XXVII program is on my C drive while I save all my trial schematics on my D drive. Is this an issue?"

Nope.

More later.

Regards,
Andy



 

Eric wrote:

? ? "I uploaded both circuits so you can maybe is it okay you can take a look."

What you uploaded didn't include the symbol and library files.? We like to have all uploads be complete, so that they don't depend on other files elsewhere.

So I copied over the two files (LED_TRIAC_ZCS.asy and?MOC308x.lib) that I said you needed.

When I run "Heater-circuit-MOC3083_modified.asc", it won't run because that schematic tries to load "st_standard_snubberless_triacs_LTspice.lib" which isn't there either.? I don't think it's needed in that schematic, is it?? So then I copied that file over too, anyway.? Now when I run it, it runs without any errors.? Is this the one you said had an "Unknown subcircuit" error?

When I run "Heater-circuit-MOC3083-fresh drawn.asc" (after having added the symbol and library files), I get the error about "Unknown subcircuit".? The reason is because you forgot to do steps (2) and (3) that I described earlier.? The text immediately under the symbol needs to be changed to "MOC3083", and there must be the line to include the library file that has its subcircuit definition:

? ? .lib MOC308x.lib

Fix those two, then it should work.

Regards,
Andy



 

Hi Andy,
Sorry for the incomplete upload. Learning woes I guess.
Actually the one modified from the original circuit ran. I think because I didn't delete any text that was on the original schematic.

While the fresh? made one? wouldn't and has the error. So I got puzzled again what was going on. I actually did step 2 before but still it wouldn't run. I did not do step 3. So now I do both and wallah it runs!

Please would like to request one more help. How do I now permanently save the part that has already MOC3083 on it instead of? LED_TRIAC_ZCS, and what needs to be done
so I don't have to add the directive? ?.lib MOC308x.lib? everytime I use this part?

Thanks and best regards,
Eric


On Thu, Nov 22, 2018 at 1:28 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric wrote:

? ? "I uploaded both circuits so you can maybe is it okay you can take a look."

What you uploaded didn't include the symbol and library files.? We like to have all uploads be complete, so that they don't depend on other files elsewhere.

So I copied over the two files (LED_TRIAC_ZCS.asy and?MOC308x.lib) that I said you needed.

When I run "Heater-circuit-MOC3083_modified.asc", it won't run because that schematic tries to load "st_standard_snubberless_triacs_LTspice.lib" which isn't there either.? I don't think it's needed in that schematic, is it?? So then I copied that file over too, anyway.? Now when I run it, it runs without any errors.? Is this the one you said had an "Unknown subcircuit" error?

When I run "Heater-circuit-MOC3083-fresh drawn.asc" (after having added the symbol and library files), I get the error about "Unknown subcircuit".? The reason is because you forgot to do steps (2) and (3) that I described earlier.? The text immediately under the symbol needs to be changed to "MOC3083", and there must be the line to include the library file that has its subcircuit definition:

? ? .lib MOC308x.lib

Fix those two, then it should work.

Regards,
Andy



 

Eric asked, "How do I now permanently save the part that has already MOC3083 on it instead of? LED_TRIAC_ZCS, ..."

That's easy.? Edit the symbol and save it.? Open the symbol file in LTspice.? You can right-click on it when it's on your schematic, then click Open Symbol.? Then right-click on that text and change it.? It happens to be an Attribute of the symbol.? Then save the file.? If you want to, you could save it under a different filename, but then you'd probably want to edit your schematics too.

? ? "...?and what needs to be done?so I don't have to add the directive? ?.lib MOC308x.lib? everytime I use this part?"

There are ways to put the library filename into the symbol itself, but to be honest I don't remember them.? I think there is more than one way, but they come with side-effects which is one reason why I tend to avoid it.? If you read through the LTspice Help (remember that?) it lists at least one of them.? I think one of the consequences is that you can no longer open or edit the symbol from a schematic page.? Which might not be an issue for you.

Some of the symbol attributes work in unexpected ways.

Regards,
Andy



 

Hi Andy,

Thanks again so much for your help.I was able to save the part with name MOC3083 already on it.?

But I wasn't able to do the automatic MOC308x.lib search. I tried the LTspice Help using "Model and Library Search Path" topic. I entered the directory path for the newly saved symbol MOC3083? and the directory path for MOC308x.lib and saved. But it didn't work or do anything. Still the schematic without the .lib MOC308x.lib directive wouldn't run. I also tried? the FAQ but can't find the right instruction there for the automatic directive search.
But its ok already at this point. I can easily add the directive everytime I use the part.?

Incidentally I might have to ask help also on loading another part if I can't still do it. But it will be on New Topic:).

Thanks and best regards,
Eric


On Thu, Nov 22, 2018 at 9:42 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric asked, "How do I now permanently save the part that has already MOC3083 on it instead of? LED_TRIAC_ZCS, ..."

That's easy.? Edit the symbol and save it.? Open the symbol file in LTspice.? You can right-click on it when it's on your schematic, then click Open Symbol.? Then right-click on that text and change it.? It happens to be an Attribute of the symbol.? Then save the file.? If you want to, you could save it under a different filename, but then you'd probably want to edit your schematics too.

? ? "...?and what needs to be done?so I don't have to add the directive? ?.lib MOC308x.lib? everytime I use this part?"

There are ways to put the library filename into the symbol itself, but to be honest I don't remember them.? I think there is more than one way, but they come with side-effects which is one reason why I tend to avoid it.? If you read through the LTspice Help (remember that?) it lists at least one of them.? I think one of the consequences is that you can no longer open or edit the symbol from a schematic page.? Which might not be an issue for you.

Some of the symbol attributes work in unexpected ways..

Regards,
Andy



 

Hi.
An example of a symbol with an internal library reference.
See MOC3083.asy in TEMP folder.
In my collection of models, this particular symbol.
?
Bordodynov.
?


22.11.2018, 22:29, "Eric Henares eohenares@... [LTspice]" <ltspice@...>:

?

Hi Andy,

Thanks again so much for your help.I was able to save the part with name MOC3083 already on it.?

But I wasn't able to do the automatic MOC308x.lib search. I tried the LTspice Help using "Model and Library Search Path" topic. I entered the directory path for the newly saved symbol MOC3083? and the directory path for MOC308x.lib and saved. But it didn't work or do anything. Still the schematic without the .lib MOC308x.lib directive wouldn't run. I also tried? the FAQ but can't find the right instruction there for the automatic directive search.
But its ok already at this point. I can easily add the directive everytime I use the part.?

Incidentally I might have to ask help also on loading another part if I can't still do it. But it will be on New Topic:).

Thanks and best regards,
Eric


On Thu, Nov 22, 2018 at 9:42 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric asked, "How do I now permanently save the part that has already MOC3083 on it instead of? LED_TRIAC_ZCS, ..."

That's easy.? Edit the symbol and save it.? Open the symbol file in LTspice.? You can right-click on it when it's on your schematic, then click Open Symbol.? Then right-click on that text and change it.? It happens to be an Attribute of the symbol.? Then save the file.? If you want to, you could save it under a different filename, but then you'd probably want to edit your schematics too.

? ? "...?and what needs to be done?so I don't have to add the directive? ?..lib MOC308x.lib? everytime I use this part?"

There are ways to put the library filename into the symbol itself, but to be honest I don't remember them.? I think there is more than one way, but they come with side-effects which is one reason why I tend to avoid it.? If you read through the LTspice Help (remember that?) it lists at least one of them.? I think one of the consequences is that you can no longer open or edit the symbol from a schematic page.? Which might not be an issue for you.

Some of the symbol attributes work in unexpected ways..

Regards,
Andy



 

Eric, see this Help page: Schematic Capture > Creating New Symbols > Adding Attributes.? Quoting from that page:

? ? "There is a special combination of attributes that will cause a required library to be automatically included in every schematic that uses the symbol."

It then shows you that combination.? Those attributes must be added to the symbol in LTspice's symbol editor -- not on the schematic page.? Then go to Edit > Attributes > Edit Attributes (or press ctrl-A) to change the attributes.? Once the symbol is saved with those attributes, you may need to delete and add the symbol again to your schematic, for the changes to take effect there.

The SpiceModel attribute should be the name of the file.? In your case, that would be MOC308x.lib.? I recommend no directory path.? That works both if the file is in the folder with the schematic, or if it is in LTspice's library area.

The Value2 attribute should be the name of the subcircuit, the thing that comes after .SUBCKT.? In your case, that would be MOC3083.

Regards,
Andy



 

Eric, there is another way to have the symbol automatically load a library file.? That is to use the ModelFile attribute.? See the same Help page as in my previous reply, as well as this one: Schematic Capture > Editing Components > Super Expert Mode.? Near the bottom of that Help page it says that if the Prefix is "X" (it is) and if a ModelFile attribute is defined (you should set it to MOC308x.lib, if you want to use this option), then LTspice will automatically load that file as if you had written ".lib MOC308x.lib".? This attribute also must be added in LTspice's symbol editor, and again it would be best to delete the symbol from your schematic and re-add it after making the change to the symbol.

Because this library file MOC308x.lib contains three subcircuits, you will be able to select which subcircuit to use, after the symbol is added to your schematic, as it says at the very bottom of that Help page.? To do that:? Right-click on the symbol on the schematic.? Then click on the name after SpiceModel.? It should show you the three available subcircuits.

Regards,
Andy



 

Hello Bordodynov,
Thank you for your advise. I checked it out but was a bit confused how and where to save it as it doesn't have the "and gate" icon for a symbol.
But? thank you very much for taking your time also to help.? I also saw the replies from Andy and thought it was easier to do for me.
This community is simply full of very supportive and sincere participants.
Best regards,
Eric


On Thu, Nov 22, 2018 at 11:59 PM §¡§Ý§Ö§Ü§ã§Ñ§ß§Õ§â §¢§à§â§Õ§à§Õ§í§ß§à§Ó BordodunovAlex@... [LTspice] <LTspice@...> wrote:

?

Hi.
An example of a symbol with an internal library reference.
See MOC3083.asy in TEMP folder.
In my collection of models, this particular symbol.
?
Bordodynov.
?


22.11.2018, 22:29, "Eric Henares eohenares@... [LTspice]" <ltspice@...>:
?

Hi Andy,

Thanks again so much for your help.I was able to save the part with name MOC3083 already on it.?

But I wasn't able to do the automatic MOC308x.lib search. I tried the LTspice Help using "Model and Library Search Path" topic. I entered the directory path for the newly saved symbol MOC3083? and the directory path for MOC308x.lib and saved. But it didn't work or do anything. Still the schematic without the .lib MOC308x.lib directive wouldn't run. I also tried? the FAQ but can't find the right instruction there for the automatic directive search.
But its ok already at this point. I can easily add the directive everytime I use the part.?

Incidentally I might have to ask help also on loading another part if I can't still do it. But it will be on New Topic:).

Thanks and best regards,
Eric


On Thu, Nov 22, 2018 at 9:42 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric asked, "How do I now permanently save the part that has already MOC3083 on it instead of? LED_TRIAC_ZCS, ..."

That's easy.? Edit the symbol and save it.? Open the symbol file in LTspice.? You can right-click on it when it's on your schematic, then click Open Symbol.? Then right-click on that text and change it.? It happens to be an Attribute of the symbol.? Then save the file.? If you want to, you could save it under a different filename, but then you'd probably want to edit your schematics too.

? ? "...?and what needs to be done?so I don't have to add the directive? ?..lib MOC308x.lib? everytime I use this part?"

There are ways to put the library filename into the symbol itself, but to be honest I don't remember them.? I think there is more than one way, but they come with side-effects which is one reason why I tend to avoid it.? If you read through the LTspice Help (remember that?) it lists at least one of them.? I think one of the consequences is that you can no longer open or edit the symbol from a schematic page.? Which might not be an issue for you.

Some of the symbol attributes work in unexpected ways..

Regards,
Andy



 

Hi Andy,
Thank you very much again! It works! Really appreciate your perseverance to help and support us newbies to LTspice XVII.
Best regards,
Eric


On Fri, Nov 23, 2018 at 12:27 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric, see this Help page: Schematic Capture > Creating New Symbols > Adding Attributes.? Quoting from that page:

? ? "There is a special combination of attributes that will cause a required library to be automatically included in every schematic that uses the symbol."

It then shows you that combination.? Those attributes must be added to the symbol in LTspice's symbol editor -- not on the schematic page.? Then go to Edit > Attributes > Edit Attributes (or press ctrl-A) to change the attributes.? Once the symbol is saved with those attributes, you may need to delete and add the symbol again to your schematic, for the changes to take effect there.

The SpiceModel attribute should be the name of the file.? In your case, that would be MOC308x.lib.? I recommend no directory path.? That works both if the file is in the folder with the schematic, or if it is in LTspice's library area.

The Value2 attribute should be the name of the subcircuit, the thing that comes after .SUBCKT.? In your case, that would be MOC3083.

Regards,
Andy



 

Hi Andy,
Thank you so much once again. It already worked with the first approach in your earlier email so maybe I can try this one if a new oppurtunity comes.
Best regards,
Eric


On Fri, Nov 23, 2018 at 12:42 AM Andy ai.egrps@... [LTspice] <LTspice@...> wrote:
?

Eric, there is another way to have the symbol automatically load a library file.? That is to use the ModelFile attribute.? See the same Help page as in my previous reply, as well as this one: Schematic Capture > Editing Components > Super Expert Mode.? Near the bottom of that Help page it says that if the Prefix is "X" (it is) and if a ModelFile attribute is defined (you should set it to MOC308x.lib, if you want to use this option), then LTspice will automatically load that file as if you had written ".lib MOC308x.lib".? This attribute also must be added in LTspice's symbol editor, and again it would be best to delete the symbol from your schematic and re-add it after making the change to the symbol.

Because this library file MOC308x.lib contains three subcircuits, you will be able to select which subcircuit to use, after the symbol is added to your schematic, as it says at the very bottom of that Help page.? To do that:? Right-click on the symbol on the schematic.? Then click on the name after SpiceModel.? It should show you the three available subcircuits.

Regards,
Andy