component-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseComponent Search
元件搜索
Find and add components, modules, and reference designs to a Zener project. Use this workflow any time you need a part or subcircuit that isn't already in the workspace or covered by stdlib generics.
在Zener项目中查找并添加元件、模块及参考设计。当工作区中没有所需的元件或子电路,且标准库通用元件也无法满足需求时,即可使用此工作流程。
Search Priority
搜索优先级
Always search in this order. Move down only when the higher tier doesn't have what fits.
- — Pre-designed, validated subcircuits (modules and reference designs). Best option: the design work is already done, with passives, layout, and validation included.
pcb search -m registry:modules <query> -f json - — Pre-packaged component definitions in the registry. Good: symbol, footprint, and
pcb search -m registry:components <query> -f jsonfile already exist and are ready to use..zen - — Diode's web component database (CSE, LCSC sources). Fallback: returns a
pcb search -m web:components <MPN> -f jsonthat must be imported withcomponent_id.pcb new component
If the user asks for a specific MPN, still try registry first before falling back to web.
请始终按照以下顺序进行搜索。只有当更高优先级的层级无法找到合适的内容时,才向下进行。
- —— 预先设计并经过验证的子电路(模块和参考设计)。这是最佳选择:设计工作已完成,包含无源器件、布局及验证内容。
pcb search -m registry:modules <query> -f json - —— 注册表中预先打包的元件定义。优势:符号、封装及
pcb search -m registry:components <query> -f json文件已存在,可直接使用。.zen - —— Diode的网络元件数据库(来源为CSE、LCSC)。备选方案:返回一个
pcb search -m web:components <MPN> -f json,需通过component_id命令导入。pcb new component
如果用户指定了具体的MPN,仍需先尝试注册表搜索,再降级使用网络搜索。
Search Tips
搜索技巧
- Registry search is richly indexed — it supports MPN search, manufacturer name search, semantic/functional queries, and lexical keyword matching. Use descriptive queries freely: ,
"buck converter 3.3V","Texas Instruments LDO"."USB-C connector" - Web components search is strict MPN-only. Only use exact or partial manufacturer part numbers: ,
"TPS54331". Do NOT include descriptions, keywords, or functional terms in the query — they will cause the search to fail or return irrelevant results. Strip everything except the MPN."STM32F103C8T6" - All commands output JSON with . Parse results programmatically to evaluate options.
-f json - Registry results include (what they use) and
dependencies(who uses them) for context.dependents - Web results include showing whether ECAD and STEP models are available. The same MPN may appear from multiple sources (DigiKey, CSE, LCSC) with different model availability; check all returned results before concluding models are unavailable.
model_availability - Try multiple queries. Parts go by different names — full MPN, base family, orderable variant, manufacturer alias. If the first search doesn't find what you need, try alternative names before giving up.
- Use to inspect a registry module's io/config interface before using it.
pcb doc --package <url>@<version>
- 注册表搜索拥有丰富的索引——支持MPN搜索、制造商名称搜索、语义/功能查询以及词汇关键词匹配。可自由使用描述性查询,例如:,
"buck converter 3.3V","Texas Instruments LDO"。"USB-C connector" - 网络元件搜索仅支持严格的MPN查询。只能使用精确或部分制造商零件编号,例如:,
"TPS54331"。请勿在查询中包含描述、关键词或功能术语——这会导致搜索失败或返回无关结果。请仅保留MPN部分。"STM32F103C8T6" - 所有命令添加参数后将输出JSON格式内容。可通过编程方式解析结果以评估选项。
-f json - 注册表结果包含(该元件依赖的内容)和
dependencies(使用该元件的内容),以便了解上下文。dependents - 网络结果包含字段,显示ECAD和STEP模型是否可用。同一MPN可能来自多个来源(DigiKey、CSE、LCSC),且模型可用性不同;在判定模型不可用前,请检查所有返回结果。
model_availability - 尝试多种查询方式。元件有不同的名称——完整MPN、基础系列、可订购变体、制造商别名。如果首次搜索未找到所需内容,请尝试其他名称后再放弃。
- 使用命令,可在使用注册表模块前查看其IO/配置接口。
pcb doc --package <url>@<version>
Choosing Between Results
结果选择
Pick when there's a clear winner. Present tradeoffs and ask only when genuinely ambiguous.
Selection heuristics in priority order:
- Functional fit — does it meet the electrical requirements?
- ECAD + STEP availability — strongly prefer results with both models available.
- Package — prefer leadless packages (QFN, DFN, LGA, WLCSP) over leaded alternatives (SOIC, TSSOP, QFP) when multiple package options exist.
- Sourcing — prefer in-stock parts. Check fields for stock counts and pricing.
availability - Source quality — for web:components, prefer CSE source over LCSC.
- Registry adoption — more in registry results means more battle-tested.
dependents
当有明确最优选项时直接选择。仅当结果确实存在歧义时,才呈现权衡方案并询问用户。
选择优先级如下:
- 功能适配——是否满足电气要求?
- ECAD + STEP模型可用性——优先选择同时具备两种模型的结果。
- 封装类型——当存在多种封装选项时,优先选择无引脚封装(QFN、DFN、LGA、WLCSP)而非有引脚封装(SOIC、TSSOP、QFP)。
- 采购可用性——优先选择有库存的元件。查看字段获取库存数量和价格信息。
availability - 来源质量——对于web:components,优先选择CSE来源而非LCSC。
- 注册表采用率——注册表结果中数量越多,说明该元件经过更多实际验证。
dependents
Using Registry Results
使用注册表结果
Registry modules and components (Flows 1 and 2) are used directly via with the registry URL. Auto-dep handles updates automatically — just use the URL and build.
Module()pcb.tomlpython
undefined注册表模块和元件(流程1和2)可通过直接使用注册表URL。自动依赖管理会自动更新——只需使用URL并构建即可。
Module()pcb.tomlpython
undefinedReference design from registry:modules search
来自registry:modules搜索的参考设计
LDO = Module("github.com/diodeinc/registry/reference/AP2112Kx/AP2112Kx.zen")
LDO(
name="LDO_3V3",
VIN=vbus_5v0,
VOUT=vdd_3v3,
GND=gnd,
)
```pythonLDO = Module("github.com/diodeinc/registry/reference/AP2112Kx/AP2112Kx.zen")
LDO(
name="LDO_3V3",
VIN=vbus_5v0,
VOUT=vdd_3v3,
GND=gnd,
)
```pythonComponent from registry:components search
来自registry:components搜索的元件
TPS54331 = Module("github.com/diodeinc/registry/components/TPS54331D/TPS54331D.zen")
Use `pcb doc --package <url>@<version>` to check available io/config before wiring into a design.TPS54331 = Module("github.com/diodeinc/registry/components/TPS54331D/TPS54331D.zen")
使用`pcb doc --package <url>@<version>`命令,可在将元件接入设计前查看可用的IO/配置接口。Importing Web Components
导入网络元件
Web component results (Flow 3) require an import step before use.
- Search:
pcb search -m web:components <MPN> -f json - Pick a result and extract its ,
component_id, andpart_number.manufacturer - Import:
bash
pcb new component --component-id <ID> --part-number <MPN> --manufacturer <MFR>This downloads the symbol, footprint, and STEP model, scans the datasheet, and generates a file into . If the component already exists in the workspace, it skips and reports the existing path.
.zencomponents/<manufacturer>/<mpn>/- Use the imported component via with the local workspace path:
Module()
python
ESP32 = Module("./components/Espressif_Systems/ESP32-S3-WROOM-1-N16R8/ESP32-S3-WROOM-1-N16R8.zen")网络元件结果(流程3)需要先导入才能使用。
- 搜索:
pcb search -m web:components <MPN> -f json - 选择一个结果,提取其、
component_id和part_number。manufacturer - 导入:
bash
pcb new component --component-id <ID> --part-number <MPN> --manufacturer <MFR>此命令将下载符号、封装及STEP模型,解析数据手册,并在目录下生成文件。如果该元件已存在于工作区中,将跳过导入并报告现有路径。
components/<manufacturer>/<mpn>/.zen- 使用本地工作区路径,通过使用导入的元件:
Module()
python
ESP32 = Module("./components/Espressif_Systems/ESP32-S3-WROOM-1-N16R8/ESP32-S3-WROOM-1-N16R8.zen")Command Reference
命令参考
Search
搜索
bash
undefinedbash
undefinedModules and reference designs (fast, local index)
模块和参考设计(快速,本地索引)
pcb search -m registry:modules <query> -f json
pcb search -m registry:modules <query> -f json
Pre-packaged components (fast, local index)
预先打包的元件(快速,本地索引)
pcb search -m registry:components <query> -f json
pcb search -m registry:components <query> -f json
Web component database (network, slower, MPN-ONLY queries)
网络元件数据库(需联网,速度较慢,仅支持MPN查询)
pcb search -m web:components <MPN> -f json
undefinedpcb search -m web:components <MPN> -f json
undefinedImport
导入
bash
undefinedbash
undefinedImport a web component into the workspace
将网络元件导入工作区
pcb new component --component-id <ID> [--part-number <MPN>] [--manufacturer <MFR>]
undefinedpcb new component --component-id <ID> [--part-number <MPN>] [--manufacturer <MFR>]
undefinedInspect
查看
bash
undefinedbash
undefinedRead a registry package's io/config interface
查看注册表包的IO/配置接口
pcb doc --package <url>@<version>
undefinedpcb doc --package <url>@<version>
undefinedVerifying Sourcing with pcb bom
pcb bom使用pcb bom
验证采购情况
pcb bomAfter adding components to a design, use to check sourcing and availability:
pcb bombash
pcb bom boards/MyBoard/MyBoard.zen -f jsonThe JSON output is a list of BOM entries, each with:
- ,
designator,mpn,manufacturer,package,valuedescription - — per-entry sourcing data:
availability- /
us— regional summary withglobal,price,stockalt_stock - — individual distributor offers with
offers,region,distributor,stockprice
在向设计中添加元件后,使用命令检查采购和可用性:
pcb bombash
pcb bom boards/MyBoard/MyBoard.zen -f jsonJSON输出是BOM条目列表,每个条目包含:
- 、
designator、mpn、manufacturer、package、valuedescription - ——每个条目的采购数据:
availability- /
us——区域汇总信息,包含global、price、stockalt_stock - ——各个分销商的报价,包含
offers、region、distributor、stockprice
Fixing BOM issues
修复BOM问题
- "No house cap/resistor found" warnings during build mean no pre-qualified generic part matches the spec. Adjust the value, package, or voltage rating, or specify an explicit where appropriate.
part=Part(mpn=..., manufacturer=...) - Low stock or no offers — search for alternative parts using the component search flows above, then update the design.
- Checking availability — look at counts across regions. Parts with zero stock and only
stockmay have long lead times.alt_stock
- 构建过程中出现“未找到内部预认证电容/电阻”警告,说明没有预认证的通用元件符合规格。请调整参数值、封装或电压等级,或在适当位置指定明确的。
part=Part(mpn=..., manufacturer=...) - 库存不足或无报价——使用上述元件搜索流程查找替代元件,然后更新设计。
- 检查可用性——查看各区域的数量。库存为零且仅有
stock的元件可能交货周期较长。alt_stock