question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Units: Cannot use the same alias for multiple pins

See original GitHub issue

Now this may be me not knowing python 😃

This code

part = Part('74xx', '74LS32')
part.make_unit('A', 1, 2, 3)
part.A.set_pin_alias('1A', 1)

gives this error

ERROR: Cannot use the same alias for multiple pins.

Looking at the Part.py source I think somehow my pin ‘1’ is interpreted as a list of pins. Not sure why.

Also I was surprised that the units were not already there, I can see them in the KiCad symbol editor? I call set_default_tool(KICAD) to make sure those are used…?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
xesscorpcommented, May 22, 2019

The newest modifications have been pushed. You can get them like this:

pip install -U https://github.com/xesscorp/skidl/archive/master.zip

Now when a part is read from a symbol library, the part units are automatically created with names like uA, uB, …

Python 2.7.16 (v2.7.16:413a49145e, Mar  4 2019, 01:30:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from skidl import *
>>> part = Part('74XX', '74LS32')
WARNING: Non-identical pins with the same number (1) in symbol drawing 74LS78
WARNING: Non-identical pins with the same number (5) in symbol drawing 74LS78
>>> part.unit    <= Print all the part units.
{u'uE':
 74LS32 (): Quad 2-input OR
    Pin U1/14/VCC/POWER-IN
    Pin U1/7/GND/POWER-IN, u'uD':
 74LS32 (): Quad 2-input OR
    Pin U1/13/~/INPUT
    Pin U1/11/~/OUTPUT
    Pin U1/12/~/INPUT, u'uA':
 74LS32 (): Quad 2-input OR
    Pin U1/2/~/INPUT
    Pin U1/1/~/INPUT
    Pin U1/3/~/OUTPUT, u'uC':
 74LS32 (): Quad 2-input OR
    Pin U1/9/~/INPUT
    Pin U1/8/~/OUTPUT
    Pin U1/10/~/INPUT, u'uB':
 74LS32 (): Quad 2-input OR
    Pin U1/6/~/OUTPUT
    Pin U1/5/~/INPUT
    Pin U1/4/~/INPUT}

For making pin aliases, just make an assignment to the .aliases member of a part or part unit. You can also assign multiple aliases to a pin by using the += operator.

>>> part.uA[1].aliases = '1A'
>>> part.uA['1A']
Pin U1/1/~,1A/INPUT     <= Pin 1 now has alias 1A.
>>> part.uA[1].aliases += 'A1'
>>> part.uA[1]
Pin U1/1/~,A1,1A/INPUT    <= Pin 1 now has aliases 1A and A1.
0reactions
xesscorpcommented, May 22, 2019

I’m getting ready to push it to Github. Once I do that, I’ll let you know how to install it. (It’s not ready for a full PyPi release.) This push will also enable automatic loading of part units when the symbol library is read, and it makes creating pin aliases a bit easier.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RemNote Tutorial - Aliases and Pins - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >
About Aliases - WatchGuard Technologies
An alias is a shortcut that identifies a group of hosts, networks, or interfaces. Your configuration file includes many default aliases.
Read more >
Multiple aliases referencing the same pin - Developers - Klipper
In klippy/pins.py#L45 is a check that ensures that multiple commands that use different aliases to “activate” the same pin cannot be used ...
Read more >
Using Alias In When Portion of a Case Statement in Oracle SQL
I'm just wondering if it's possible to use an alias in a case statement later in the select statement for Oracle (I know...
Read more >
assign same alias to multiple email accounts
You can follow the question or vote as helpful, but you cannot reply to this thread. I have the same question (144). Report...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found