Custom rules: targeting unconnected pads

A pad’s Pin_Type property picks up the pin function from the schematic. It will be one of:

  • input
  • output
  • bidirectional
  • tri-state
  • passive
  • free
  • unspecified
  • power input
  • power output
  • open collector
  • open emitter
  • unconnected

If the pin is marked with a “no connect” in the schematic then it will have “-unconnected” added as a suffix. For instance “passive-unconnected”.

For brevity the “-unconnected” suffix will not appear on an “unconnected” pin.

So let’s say you want to give a bit more clearance to a high-voltage net, but want to allow it between unconnected pins.

This will target a netclass:

A.NetClass == 'HV'

This will target unconnected pins:

B.Pin_Type == '*unconnected' || B.PinType == 'free'

.
However, we want our condition to exclude unconnected pins rather than target them.

!( B.Pin_Type == '*unconnected' || B.PinType == 'free'`)

Note that:

B.Pin_Type != '*unconnected' && B.PinType != 'free'

will not do what we want it to. The test Pin_Type != 'free' means a “pin which is not of type free” rather than “an object which is not a pin of type free”. So it’s going to fail to match on tracks, zones, etc., which is not what we want.

.
The resulting condition is:

(condition "A.NetClass == 'HV' && !( B.Pin_Type == '*unconnected' || B.PinType == 'free'`)"
7 Likes

(I forgot to say thanks to @Aliasmk who was instrumental in testing this stuff.)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.