Keyboard Shortcuts
Лайки
Пошук
My ideal transformer symbol "can't be edited"
I am working on a "cantilever model" flyback
transformer with 4 windings. I elected to rip
off one of the contrib/Wurth transformer
symbols because they were nice and pretty
while I can't seem to get the hang of stick-
building with the "arc" object.
So that worked out, except now right-click
delivers a popup that's still all about Wurth
symbol.
"attachments are not allowed in this group"
This seems to be some "hidden junk", "Attributes"
has none of this visible. Down in the symbol ASCII
I see this bit that appears in the popup, but nothing
that looks like "why?".
"attachments are not allowed in this group"
Contents of IdealXfmr.asy:
Version 4
SymbolType BLOCK LINE Normal 61 0 61 96 LINE Normal 67 0 67 96 LINE Normal 0 0 32 0 LINE Normal 0 96 32 96 LINE Normal 128 0 96 0 LINE Normal 128 96 96 96 CIRCLE Normal 28 12 36 20 CIRCLE Normal 92 12 100 20 ARC Normal 16 0 48 32 32 32 32 0 ARC Normal 16 32 48 64 32 64 32 32 ARC Normal 16 64 48 96 32 96 32 64 ARC Normal 112 0 80 32 96 0 96 32 ARC Normal 112 32 80 64 96 32 96 64 ARC Normal 112 64 80 96 96 64 96 96 TEXT 64 -32 Center 2 IdealXfmr TEXT 16 48 Right 2 Pri TEXT 112 48 Left 2 Sec WINDOW 0 64 -64 Center 2 WINDOW 3 49 112 Left 0 SYMATTR Description WE-FB Flyback Transformer\n25uH, 9-30Vin, 5V/2A, 5Vaux\nwww.we-online.com/redexpert/article/750310471?al\n\nPlease note the disclaimer in lib/sub/Contrib/Wurth/WE-FB.lib. SYMATTR Value2 750310471 SYMATTR Prefix X SYMATTR SpiceModel Contrib/Wurth/WE-FB.lib PIN 0 0 RIGHT 6 PINATTR PinName PriP PINATTR SpiceOrder 1 PIN 0 96 RIGHT 6 PINATTR PinName PriN PINATTR SpiceOrder 2 PIN 128 0 LEFT 6 PINATTR PinName SecP PINATTR SpiceOrder 3 PIN 128 96 LEFT 6 PINATTR PinName SecN PINATTR SpiceOrder 4 If I remove that line the popup goes away, but
I can't hierarchy-descend by right click, as the
Help claims - this only works on some subset
of symbols, no idea why. Also cannot get to
symbol attributes list by control-right-click
(as Help claims with no qualification).
What I want, is to add a "turns ratio" property
so that I can square-scale the secondary winding
inductance by that, squared.
But I see nothing about how to add or remove
attributes from a symbol. Only change visibility.
I'm looking to add a named property and use
it (with math) in the netlist line or pass it in and
use the (well behaved in this regard) ind primitive
to (hopefully) carry it (the param*value) to the
netlist. I would like this param to appear at
placement-time, just like the primitives, and
used in a math expression in the value attribute
fields of ind instances (like I want to see
"TurnsRatio" as a field to fill, and I want the L
(inductance) value of L1 to be "10m*TurnsRatio"
(or its syntax-correct equivalent, so that the
inductor in question is "modified from above"
(symbol instance property flows to SPICE
value, not a SPICE .param or a {} evaluation of
one).
For that matter I find nothing about flexible
definition of netlisting either. Seems "baked
in". But I know there's a lot of undocumented
features, so I'm asking.
|
On Wed, Nov 6, 2024 at 08:35 PM, Dick Freebird wrote:
Because. Read it, follow it, and move on. (One reason is because attachments are too easily abused, say by sending 25 MB files to 71,000 group members, or by sending virus-infected files. Email attachments are a great way to spread malware. Hence they are not allowed here.)
Go back and read the group's guidelines again on the group's main webpage. See where it says, "Do not attach" anything, followed by instructions for uploading files? Please read that again, and follow it next time.
You may have made things somewhat more difficult for yourself, and for us, in a few different ways.
Please do not paste the contents of any .ASC or .ASY file here in messages. It does nobody any good to look at your .ASY or .ASC code - including yourself! Everything should be edited ONLY using the normal editing features in LTspice itself -- NOT by editing code in the .ASY file. Please don't do that.
Were you trying to edit your symbol in the Symbol Editor, or in the Schematic Editor?
I assume the message you saw was, "This Component can not be edited," which happened when you tried to modify the symbol after it was already on a schematic, so you were using the Schematic Editor. LTspice has features (combinations of symbol attributes) that can make symbols not editable once on a schematic. It is documented in LTspice's Help. By not reading that, you may have missed the answers to your questions. As far as I know, every symbol can always be edited in the Symbol Editor, so it pays to open the symbol in the Symbol Editor and see what's actually there
As you can tell after clicking Ctrl-A in the symbol editor, this symbol is of type Block, and has Attribute values for Prefix, SpiceModel, Value2, and Description.
Quoting from the Adding Attributes page in LTspice's Help:
Note the part I highlighted above. By having Prefix=X, along with both the SpiceModel and Value2 attributes defined, that symbol can't be edited from the schematic. It can be edited only in the Symbol Editor.
DON'T EVER do that by editing the .ASY file in a text editor! Only change that in LTspice's Symbol Editor. Press Ctrl-A, then change the attribute values.
I don't claim that the Help is crystal clear and easy to follow about symbol attributes. It isn't. But everything is there. I recommend getting rid of its SpiceModel and Value2 attribute values, and use Value instead of Value2.
Andy
|
On 07/11/2024 02:35, Dick Freebird via
groups.io wrote:
It's not entirely clear what you are trying to do. You mention: ..but I can't hierarchy-descend by right click, as the Help claimsAre you trying make a hierarchical block, whereby you can right-click on the IdealXfmr symbol in the schematic editor, and you get an option to "Open Schematic"? If so, did you already create its schematic? You don't mention that. To get that option, several things must already be in place:
- this only works on some subset of symbols, no idea why.Did you look inside any hierarchical symbols to see how they differ from your symbol? Once you are able to get the "Open Schematic" option by right-clicking on the symbol, you will also get the "PARAMS" field. It is there that you can add "TurnsRatio" parameter. However, that won't do anything unless the "TurnsRatio" parameter exists in your lower level schematic. The syntax for putting anything in the PARAMS field is: ParameterName=<NumericValue> ..or ParameterName={AnotherParameterName} In the second case, "AnotherParameterName" must resolve to a numeric value in the top level schematic. I don't know what you mean by: flexible definition of netlistingNetlists are not flexible. They must obey syntax rules just like any other language. If you don't want a hierarchical block with a lower level schematic, you have two options:
Do you have a .subckt that defines your basic component? As a minimum, it should contain two inductors, each with an inductance value that resolves to a numeric value. It must also contain a coupling directive in order to behave as a transformer. The coupling directive looks something like this: K1 L1 L2 0.99 K1 L1 L2 {Kval} .. where "Kval" resolves to a numeric value defined elsewhere. This is described in: Help > LTspice > LTspice® > Circuit Elements > K. Mutual Inductance This "junk" is not hidden at all, but as Andy says, it cannot be edited from within the schematic editor because the specific arrangement of the attributes prohibits it. You need to open the IdealXfmr symbol directly in the symbol editor. From there, press ctrl-A to edit the symbol's attributes. There, you will find listed: attribute Value Prefix X SpiceModel Contrib/Wurth/WE-FB.lib Value Value2 750310471 SpiceLine SpiceLine2 Description WE-FB Flyback Transformer\n25uH, ... \nPlease note the disclaimer in lib/sub/Contrib/Wurth/WE-FB.lib. Modelfile .. just as it was in the original Würth symbol. -- Regards, Tony |
On Thu, Nov 7, 2024 at 04:56 PM, Dick Freebird wrote:
Did you try the suggestions? Did you open the symbol in the Symbol Editor and remove the SpiceModel and Value2 attributes? That would have fixed the first LTspice problem.
Andy
|
Did you consider uploading the rejected material as the group's
directions specify. We can't help if we can't see what you have. Donald. On 11/7/24 16:56, Dick Freebird via
groups.io wrote:
|
Повідомлення
Більше