You can make one symbol without any names, that is, no "hardcoded" edits from within the symbol editor. Edit the attributes but not the names. Then, when placing that symbol in the schematic, simply rename its instance name to whatever subcircuit you have. Then place the other and do the same for the other subcircuit, while adding proper .inc
or .lib
cards on the schematic. Of course, this implies the same number of pins in both cases, but there can be a cheat for this: if thte 1st subcircuit has 3 pins and the other 4, then simply add a dummy pin to the 3 pin subcircuit.
If you need to have two symbols at the and of it, no problem, just use only one symbol and change the instance name, the other symbol will be there, ready to be used. The greatest hint for hierarchical schematics (by your words I'm guessing this is what you have) is not to make the name of the symbol hardcoded -- that makes it unique to a certain subcircuit --, unless that is your purpose from the beginning.
Edit: Just to be sure I spell it all out, using two symbols for the same subcircuit, or hierarchical schematic, means simply placing a symbol on the schematic, renaming its instance name, then placing the other (or the same) symbol and doing the same renaming reflecting the desired subcircuit's, or hierarchical schematic's name. All these while taking care that the symbol itself doesn't have a builtin (edited, hardcoded) instance name -- easily taken care of when editing the symbol.
Edit 2: I got home and I realized I omitted another possibility, that deals with hierarchical schematics. The symbols and the schematics can only share one name, case insensitive, so, if you need two symbols pointing to the same schematic (avoiding duplicates of the schematic but keeping more than one symbol), you can simply make the second symbol with a similar name as the first (say hierarchical.asy
and hierarchical2.asy
), and make a symlink to the lower level schematic (say hierarchical.asc
and the symlink hierarchical2.asc
). It should be a fairly simple task whether you're in Linux, Mac, or Widows. I'm on Linux -- ln -s file link
--, never been on a Mac -- I understand it's about the same thing --, and used a small freeware utility in Windows -- hard link shell ext or something like that, but you can use command prompt, too.
You are thinking in terms of creating a package-based symbol and that's leading to some confusion between the spice sub-circuit model you are also looking at.
Instead, the spice model you show is really laid out for a more normal opamp-like symbol for your schematic.
Instead, copy this file:
Version 4
SymbolType CELL
LINE Normal -32 32 32 64
LINE Normal -32 96 32 64
LINE Normal -32 32 -32 96
LINE Normal -28 48 -20 48
LINE Normal -28 80 -20 80
LINE Normal -24 84 -24 76
LINE Normal 0 32 0 48
LINE Normal 0 96 0 80
LINE Normal 4 44 12 44
LINE Normal 8 40 8 48
LINE Normal 4 84 12 84
WINDOW 0 16 32 Left 0
WINDOW 38 44 50 Left 0
SYMATTR SpiceModel LM358
SYMATTR Prefix X
SYMATTR Description National LM385
SYMATTR ModelFile LM358.MOD
PIN -32 80 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 1
PIN -32 48 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN 0 32 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 3
PIN 0 96 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 32 64 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5
And save it as a file called LM358.ASY in some directory you can easily use. If you want, go into the LTspice installation directory, find the "lib" subdirectory there, then look inside that and find the "sym" subdirectory. Place the above file in there, if you can't place it anywhere else that is convenient.
However, I usually create my own symbol directory and place it there. This can then be accessed by first going to the Tools/Control Panel selection and then picking the "Sym. & Lib. Search Paths" tab and adding your own personal directory in the Symbol Search Path box.
While you are here, you might as well also add a new directory of your own for the Spice simulation models in that box, as well. I keep my model files in one directory and my symbol files in a second one. But you could use one directory for both, too. Doesn't matter. LTspice just needs to be told about things, either way.
Then, restart the program after saving. Then when you hit F2, you can see at the very top that there is a "Top Directory" entry there and you will find your own personal directory listed there. Select that, then select LM358 from there.
Either way works.
However. As I mentioned above, you will ALSO need an LM358.MOD file and that needs to be placed into another directory (or the same directory.) If you look at the symbol definition included above, you will see a line that says:
SYMATTR ModelFile LM358.MOD
That's where the symbol points to the model file. So you have to use that name, or else change the symbol description above to use whatever name you want to use.
Then you need to store your model in such a file.
In my case, my model file says the following. But you can use your own model, as well. But I think you will be able to see where the nodes are also shown as just five nodes here, too. Just like yours.
The key to all this is that the node numbers match up with the symbol nodes. If you want, you can use LTspice to open up the LM358.ASY file, too. And then you can see the symbol there. Mouse over to a pin and right click on it. You will see the node number listed there and some other useful information. You can match these up (their numbers) with the order in which they are also found in the subcircuit node list in the model below here.
Go back and look up at the LM358.ASY file given above and note the "SpiceOrder" entries there. Five of them, right?
*//////////////////////////////////////////////////////////////////////
* (C) National Semiconductor, Inc.
* Models developed and under copyright by:
* National Semiconductor, Inc.
*/////////////////////////////////////////////////////////////////////
* Legal Notice: This material is intended for free software support.
* The file may be copied, and distributed; however, reselling the
* material is illegal
*////////////////////////////////////////////////////////////////////
* For ordering or technical information on these models, contact:
* National Semiconductor's Customer Response Center
* 7:00 A.M.--7:00 P.M. U.S. Central Time
* (800) 272-9959
* For Applications support, contact the Internet address:
* amps-apps@galaxy.nsc.com
*//////////////////////////////////////////////////////////
*LM358 DUAL OPERATIONAL AMPLIFIER MACRO-MODEL
*//////////////////////////////////////////////////////////
*
* connections: non-inverting input
* | inverting input
* | | positive power supply
* | | | negative power supply
* | | | | output
* | | | | |
* | | | | |
.SUBCKT LM358 1 2 99 50 28
*
*Features:
*Eliminates need for dual supplies
*Large DC voltage gain = 100dB
*High bandwidth = 1MHz
*Low input offset voltage = 2mV
*Wide supply range = +-1.5V to +-16V
*
*NOTE: Model is for single device only and simulated
* supply current is 1/2 of total device current.
* Output crossover distortion with dual supplies
* is not modeled.
*
****************INPUT STAGE**************
*
IOS 2 1 5N
*^Input offset current
R1 1 3 500K
R2 3 2 500K
I1 99 4 100U
R3 5 50 517
R4 6 50 517
Q1 5 2 4 QX
Q2 6 7 4 QX
*Fp2=1.2 MHz
C4 5 6 128.27P
*
***********COMMON MODE EFFECT***********
*
I2 99 50 75U
*^Quiescent supply current
EOS 7 1 POLY(1) 16 49 2E-3 1
*Input offset voltage.^
R8 99 49 60K
R9 49 50 60K
*
*********OUTPUT VOLTAGE LIMITING********
V2 99 8 1.63
D1 9 8 DX
D2 10 9 DX
V3 10 50 .635
*
**************SECOND STAGE**************
*
EH 99 98 99 49 1
G1 98 9 POLY(1) 5 6 0 9.8772E-4 0 .3459
*Fp1=7.86 Hz
R5 98 9 101.2433MEG
C3 98 9 200P
*
***************POLE STAGE***************
*
*Fp=2 MHz
G3 98 15 9 49 1E-6
R12 98 15 1MEG
C5 98 15 7.9577E-14
*
*********COMMON-MODE ZERO STAGE*********
*
*Fpcm=10 KHz
G4 98 16 3 49 5.6234E-8
L2 98 17 15.9M
R13 17 16 1K
*
**************OUTPUT STAGE**************
*
F6 50 99 POLY(1) V6 300U 1
E1 99 23 99 15 1
R16 24 23 17.5
D5 26 24 DX
V6 26 22 .63V
R17 23 25 17.5
D6 25 27 DX
V7 22 27 .63V
V5 22 21 0.27V
D4 21 15 DX
V4 20 22 0.27V
D3 15 20 DX
L3 22 28 500P
RL3 22 28 100K
*
***************MODELS USED**************
*
.MODEL DX D(IS=1E-15)
.MODEL QX PNP(BF=1.111E3)
*
.ENDS
*$
Best Answer
It's stored in the .asc file that contains your circuit. This makes sense because you don't want to store the name for a specific part in the part file, rather anything you rename a part(C1, C2, C3, Etc) gets stored in the .asc file which contains the components and wiring of your circuit.
Edit: I understand now what you were asking. The line SYMATTR Prefix X is the line that the U is stored under. I don't know why the character X shows up as a U for the opamp but if you change that character to an A and open the model you'll see Annn instead. Every other character, including multiple characters, I changed the value to was mirrored in ltspice when i opend the .asy file.