Fixing power ports in a schematic 5.99

In my present schematic, I committed the error of renaming a power port GNDREF into PGND before copying it all over the schematic. Now as I work on the layout, I see all of these grounds named GNDREF instead of PGND. The renaming did not work as intended but the appearance of the schematic showed PGND.

The Find function (Cntrl-F) was unable to find GNDREF (even with hidden text checked) both in the pcb and the schematic, even though I could see GNDREF as a labeled net on many pcb pads. Why was this?

After a few manual swaps I opened the schematic with a text editor and did Find-Replace. I think this did the trick. But I don’t think I should have needed to do that. Am I missing something?

Application: KiCad Schematic Editor (64-bit)

Version: (5.99.0-13185-g0dcbfa2b69), release build

wxWidgets 3.1.5
libcurl/7.78.0-DEV Schannel zlib/1.2.11

Platform: Windows 10 (build 19043), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Nov 9 2021 12:00:58
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.76.0
OCC: 7.5.0
Curl: 7.78.0-DEV
ngspice: 35
Compiler: Visual C++ 1929 without C++ ABI

Build settings:

No opinions on this one?

Can you post a stripped down schematic?

Without that, the only suggestion I have is to make sure the pin name in your new power symbol matches what you want the power net to be.

Thank you. As I am saying, I committed an initial error. My question is: Why cannot find and replace fix the error?

Allow me to tweak what I said above…here I am using find and replace all.

Then I save the schematic and update the pcb from the schematic.

But the pcb makes it obvious that the netlist is still full of GNDREF.

Here is a zipped project folder: Digipot SEPIC November 8 (26.7 KB)

In KiCad net names are derived from the pin names in the power symbols.

So I took one of my STM32 projects and tried to rename the “BOOT0” pin. With Eeschema / Edit / Find and Replace I could rename the label, but not the pin name in the schematic symbol.

Even if I did have the “Search pin names and numbers” checkbox on. It does search and highlight the “BOOT0” pin, but does not replace the text. Do you consider this a bug or a feature?
If you do the search & replace with a text editor, it has no such qualms.

Thanks, Paulvdh.

Are you being facetious? Of course, if I ask for “search and replace” then I want it to replace. Anyway I think you have confirmed my point.

Changing schematic symbols is usually reserved to the schematic symbol editor. I find it quite understandable that a “search and replace” does not change texts in the schematic symbols themselves.

Also note there is an extra checkbox for Replace matches in reference designators and this has to be enabled separately.

With KiCad V5.1.x and earlier this would not even have been possible because schematic symbols were only linked into the schematic from external libraries. KiCad-nightly V5.99 is the first version in which the schematic symbols are embedded in the schematic itself.

I generally think of “find and replace all” as being sort of a user-beware, all powerful tool. KiCad generates backups, and at least if you find an “oops” before saving, you also ought to be able to “undo.” The text editor proves that the requisite information is contained in the schematic file. And the dialog box allowed me to check hidden fields. So it seems reasonable to me that find and replace (including hidden fields) ought to have been able to make the changes.

Gripe, moan, complain, etc. But doesn’t that lead to better software?

It sounds to me like the most logical thing would be another checkbox.

BTW; I thought that I had simply specified the wrong power port among the many in my library. But looking at it an hour ago, I could not find GNDREF in the library so I am unsure how I got that to begin with. But PGND is in my library. So basically I was trying to replace all the grounds with a different one which exists in my library.

Sounds like a valid feature request.
The way that label names are now derived from hidden pins in power symbols is still quite hackish. I assume that at some time in the future this will be fixed and the net names can be edited normally in the schematic, just like any other label. Power symbols would then become some sort of fancy labels with extra graphics.

Changing text inside schematic symbols in the schematic editor, instead of the schematic symbol editor is a decision that should not be taken lightly. Usually schematic symbols are checked / vetted / verified meticulously, and errors should be fixed in the libraries. I (and probably many other people) would not be happy if these can be changed accidentally with a simple mistake in an search and replace operation.

The answer from gkeeth goes in the right direction.

The problem is: power ports are special symbols, you cannot simply change the value of a power-port.
You can see this by double-click on the alue of a power-port (PGND/GNDREF) - the value-field in the displayed “edit value field”-dialog is gray (non-functional) with the help-text: “Power symbol value field text cannot be changed”
So your “solution” with Find&replace to change the power-port value has sidestepped the protection against value-change.

For elaborated description of power ports: see chapter “power symbols” in:

in short:

  • a power port symbol consists of an internal pin. The symbol-name and the pin-name should be the same.
  • to create a new power port symbol: make a copy from an existing power port into an own symbol-library
  • change symbol-name AND internal pin-name to the new desired power port name (for your example: PGND)
  • save library
  • in your schematic add the new power port symbol and use it
  • for only some symbols: delete the old and place the new manually
  • if you want to batch-replace multiple existing power ports with your new power-port:
    use the Tools->update symbols from library:

It would be great if the power ports appeared in the Symbol fields table but they do not. I had looked at that early in the process. And I do not quite see how it would be done with this:

We have talked about changing how power symbols work in the future so that the net name can be changed from inside the schematic (i.e. you would not need to have a library of dozens of different net names just for the same power symbol). At this point, find & replace should work. I am not sure it’s a good idea to have find & replace make changes inside symbols, even now that symbols are cached in the schematic. But, it could be discussed I supposed.

1 Like

Thanks. I am somewhat confused as to the moves I have applied within KiCad, but none of them seem to have worked. I think a key point is that I am trying to replace-in a symbol which exists in my library, not concoct something which is not in the library. But with (guess-50) incorrect ground symbols in my schematic and the incorrect text invisible, I would need to eliminate all of the ground symbols and replace all of them individually with mouse operations. Sort of a pain. My text edit stands out as a risky but effective “nuclear option.”

You are right here. There is no easy way to bulk-update a power symbol’s usage in a schematic today unless you go to the library editor and change that symbol itself (and then update all instances of it). Changing the way KiCad works so that the power symbol net name is defined in an editable field rather than as a hidden pin name would be the ideal fix to this.

Once you started replacing texts in a text editor, you have to tread carefully with bug reports, etc. You may have left your schematic in some non-valid state without knowing it.

The way KiCad currently works, the net names derived from power symbols are immutable in those symbols. Which means, that if you want to change them, then do not use Update Symbols from Library, but use Eeschema / Edit / Change Symbols to replace the whole symbol that is not to your liking.

Eeschema / Edit / Change Symbols probably works as a Search and replace to fix the complete symbols.

I guess you can also use: Eeschema / Tools / Edit Symbol Library Links.

The KiCad folder that I posted was from a backup generated before I did the text editor “find and replace.” So far as I know, my text editor operation was successful and I have not tried to undo that in any way…but I have not posted that file or a file derived from it.

Ahh that works!

That also works!

@BobZ: my fault.
you have to use Change symbol (not update):
1.) select one of the old GNDREF-values, than doubleclick. You should get the symbol properties dialog
2.) on the right-side of the dialog click button: Change Symbol, you now get the “Change symbols” dialog
3) select radio-button “change symbols matching value”, the value should be prepopulated with “GNDREF”
4.) select new powert port in field “new library identifier”
5.) set checkbox reference+value, click “CHANGE”-button

I see I’m way to slow…

That also works!

See…I guess I was the one who was way too slow. :frowning:

What I am doing right now…in my layouts with a particular power conversion IC, I feel that I am always “re-inventing” the wheel with my grounding around this IC. In this design today I am trying to use only two layers and decided to keep only PGND and eliminate AGND; eliminate the net tie. Really a couple of vias will serve as the net tie. I used tools>edit symbol library links to replace my several AGND connections.