Post Go back to editing

Comment Out a Schematic

Thread Summary

The user seeks a method to comment out a hierarchical schematic in LTspice to store text notes and unused circuit snippets without affecting the netlist. The final answer suggests using a dummy subcircuit or changing the Prefix to 'X' and using a non-functional subcircuit. Accompanying answers propose shorting all pins of components, using jumpers, or creating non-simulatable symbols with the same names as real symbols in a separate directory.
AI Generated Content
Category: Software
Product Number: LTspice 26.0.1
Software Version: LTspice 26.0.1

Hello All:

Is there a way to comment out a schematic?
I have a hierarchical schematic design, a dozen pages and 4 levels of hierarchy.
That all works just fine.

I want to create another page to place on my top level schematic.
This page will store text notes, unused circuit snippets.
One copy of each C, D, Q, R, etc...
So it is easy to see that there are 17 different values of resistor in the project.
If one value can be found that is acceptable, I would copy it to it's destination.
If one value can't be found that is acceptable, I would create a new resistor and value, then copy it to it's desired position.
Now I can later easily see that there are 18 different values of resistor in the project.

LTspice must not attempt to netlist that notes schematic.
Can it be done?

  • Hi  ,

    Might help if you send an example of what you want to do. There are currently no layers to a schematic, nor can you comment components. The best way to do it would be with parameters, and maybe a symbol that contains parameters. That latter might be a way to do it.

    You could possibly make a symbol, say, using res.asy as a template, and define it using a library with all of the resistor values each as subckt statements. Then, you would choose the resistor value in the drop down list when you Ctrl-Right-Click the symbol.

    mike

  •  said "nor can you comment components".
    That is not correct.
    Simply connect all pins of a component together, 2-pin, 3-pin, 8-pin, 16pin etc...
    Short all pins together, no need to connect the shorting net to anything.
    On the other hand, one may connect the the shorting net to any other net without effect.
    LTspice will tell you somewhere, I don't remember where, that Rwhatever can have no voltage across it so it will not be added to the netlist.

    Your component is now commented out.
    But that is not tenable for circuit snippets.

    Please consider coding an unused component letter like Z to mean, ignore this entire schematic.
    X-Cell does one thing, X-Block does another, and Z-block or Z-Cell could mean ignore this schematic?

  • eewiz,

    If I understand correctly, you want to draw a new schematic sheet, whose only purpose is to document things, and this sheet's symbol would be added as hierarchy to your main schematic.  Can't you do the same thing you suggested, to that new schematic?  Short out all its components.  Then they won't be "netlisted".  You could short them either with wires, or by grounding both ends, or even by drawing a full schematic and then discretely adding the same node name (Label) to every net.  I think you can even get away with the nodename ".' or "-".

    Alternatively, if the new schematic sheet has no IN/OUT/Bi-Direct pins, then it would have nothing to connect to the rest of your circuit, which might also work.  I guess the sheet's contents would still netlist but they won't connect to anything, except Ground of course.

    Another alternative is to make "do-nothing" dummy symbols that look like resistors, diodes, etc., but which actually do nothing (do not netlist as real components).  BTW, you do not need to actually make dummy symbols; you can use the existing C, D, Q, R, etc. symbols but change their function by way of Ctrl-Right-Click on the symbol and change their Prefix to something else.  A little creativity here can help.

    A last-ditch alternative is to netlist the top-level schematic (turn it into a SPICE Netlist), then open that Netlist, find the subcircuit instance for the added "doc" schematic, which begins with an "X", and literally comment-out that line in the Netlist.  Then simulate the modified Netlist.  This is not as convenient as running the schematic directly, though.

    Andy

  • Andy,

    Yes, presently I have to short out all components on my NOTES schematic.
    This is cumbersome and prone to errors in connection that stop the next sim run until the effort is spent to determine why.

    This does not help with circuit snippets of lets say 10 components consisting of a 16 pin chip, an 8 pin chip, 2 caps, a diode and 5 resistors, etc...

    LTspice will not permit the creation of a hierarchical schematic that has no connections.

    The unused ground connection is the minimum that LTspice will permit.
    It matters not if a component on the NOTES schematic is grounded as long as all pins of that component are shorted together.

    Dummy symbols would not be readily copy-able.

    Changing Prefix R to Prefix Z in an attempt to comment out an R produces:
    Expected model name here. Z§R2 V-15 N001 99.

    Blanking an R's Prefix line from R to nothing, does nothing.
    It still netlists as "R2 V-15 N001 99".

    Blanking an R's Prefix line from R to nothing and changing InstName from R2 to Z2, does this in the net list.
    "R§Z2 V-15 N001 99"
    Even without a Prefix and an InstName of Z2, LTspice still knows it is a resistor and breaks if that Z component is not wired correctly.
    This causes me to believe that use of Res.sym to represent anything other than a resistance element will fail no matter what the Prefix or InstName values are set to.

    Shorting a component's pins is the only "undesirable" method that works.

    All for now

  • When I suggested changing the Prefix, I did not mean to change it to another Prefix letter for a different valid component.  The prefix "Z" is for MESFETs and IGBTs, which require a .MODEL definition, so of course that won't work.  Try using an undefined prefix, but I suspect that would cause an error too.

    What I had in mind, was changing Prefix to "X", and using an Attribute value that loads a dummy subcircuit that does nothing.  As I wrote, "a little creativity here can help."  I really meant that.

  • Where did my other Reply go?  I send another Reply here just a few minutes ago (second one in the last hour), but it appears to be AWOL.  Did EZ lose it?  Was it censored??

  • Hi  ,

    Try again. EZ has a had a few problems staying up this morning.

    mike

  • Another alternative is to make "do-nothing" dummy symbols that look like resistors, diodes, etc., but which actually do nothing (do not netlist as real components).  BTW, you do not need to actually make dummy symbols; you can use the existing C, D, Q, R, etc. symbols but change their function by way of Ctrl-Right-Click on the symbol and change their Prefix to something else.  A little creativity here can help.

    You could also do this using the priority of symbol search. If you create (and place) "non-simulatable" symbols with the same names as the  "real, simulatable" symbols in the same directory as your "notes" schematic when you open the schematic, the "notes" schematic will use the dummy symbols. You would just have to make sure that your non-simulatable schematic directory is not within any of the search paths defined in Settings > Search Paths.

    In this way, your "notes" schematic will use the dummy symbols. Everything else will use real symbols.

    I want to create another page to place on my top level schematic.
    This page will store text notes, unused circuit snippets.

    As noted above, would help if you had a simple sample of what your setup looks like. This description does not exactly match how I picture commenting out components.

    mike

  • Hi  ,

    I thought more about one way to record your resistor values in the main schematic. See attached. I created a symbol based on res.asy called MyRes.asy (Open res.asy, then Save As). MyRes.sub is the shorted resistor. MyRes.asc is a schematic I used to create MyRes.sub using a new feature…

    …In this case, I wanted to test a new feature in 26.0.2, which allows you to create a subcircuit based on a schematic (Hierarchy > Generate Subcircuit Netlist. If you use this feature, and there is a symbol that has the same file name (foo.asc and foo.asy) as the schematic, it will use the pin order/names in the symbol).

    You can place the MyRes symbol on the schematic and give it a value as a notation. The value is meaningless to the simulator, but is recorded in the netlist.

    You could simplify the shorting of pins and nodes in a circuit snippet by using jumpers. I tried this using the AD713 example circuit. Just delete the jumper wires to "short" to uncomment. Commented Vin also. Hmm, this might be a quick way to implement commenting...

    MyRes.zip

    Jumper Shorting.asc

    mike

  • Hello Micheal,

    An example like this:
    Top_Level_Schematic-NOTES.zip

    I have a dozen or more hierarchical schematics, four levels deep.
    A hundred or more distinct component values to reuse if possible.
    More shorts than I can shake a stick at.

    It appears to me that some code character could be used to mean "ignore this schematic named NOTES".
    Like !NOTES or \NOTES or #NOTES or )NOTES instead of XNOTES to cause LTspice to ignore that schematic.

    I also have my NOTES schematic placed in multiple places up and down the hierarchy so I don't have to climb back to the top to copy an existing component value to or from the NOTES schematic.

    It would need to be ignored wherever it is found.

    All for now