circuitjs1 icon indicating copy to clipboard operation
circuitjs1 copied to clipboard

Subcircuit terminals shared between all Instances.

Open Merilix opened this issue 1 year ago • 3 comments

Because the pins of subcircuits are made of named nodes, they are all he same if you have multiple instances. They behave like they are connected parallel.

Terminals of a subcircuit must be independent of other instances. They should be build of an element say "pin" which behaves like a normal unnamed node.

Merilix avatar Jun 10 '24 09:06 Merilix

Can you give an example? I'm not seeing that.

https://tinyurl.com/2kfz7jkl

pfalstad avatar Jun 28 '24 18:06 pfalstad

I can't see how test1 in your example is made.
But here you go https://tinyurl.com/22cholyb Thats my sub-circuit: https://tinyurl.com/2buafrrx

Intended was to show the behavior of induced current/voltage in a loop using DC simulation. Wanted to simplify that: https://tinyurl.com/26xl3qam My sub-circuit was meant to represent a single segment of the wire loop.

Merilix avatar Jul 06 '24 08:07 Merilix

There are some known bugs with 2-terminal voltage sources in subcircuits. This looks like another one.

I used a workaround to fix your subcircuit: https://tinyurl.com/28rots7t

I also added some grounds, just to fix the voltage colors, but it works without the grounds.

I took your subcircuit and added a ground, not connected to anything, like so: https://tinyurl.com/25olne3u Then I select everything but the ground and do "Create Subcircuit". Then it works.

pfalstad avatar Jul 06 '24 17:07 pfalstad