BOM Tool makes new entry if symbol has additional Field

Hi,
I created the BOM out of a schematic. Thean I realized that every part is inserted two times.
The reason for this I think is that I added new fields with mouser number and so on to symbol properties.

The picture below shows the BOM with its tow entries for one component.

Can anybody tell me why this happens and how I can avoid it?

BOM reporting isn’t hardcoded into KiCad, it’s done with “plugins”, so you should give us the plugin. This is probably a bug in a plugin.

1 Like

Well which BOM plugin did you use?

Hi,
thanks for your fast answer. I tried “bom_csv_grouped_by_value_with_fp” and also others. When I gnerate the BOM there are made two files:

If i open the first it looks like this:

what is kind of difficult to handle.
The second one would be nice if there wasn’t the problem of the doubled cpmponents.

I also watched some tuturials on youtube. Like KiCad 5.0 - Exporting BOMs from
“Contextual Electronics”. There the plugin shown in the picture was used. But in the latest KiCad Version
it isn’t listed.

I think the XML file is generated directly by KiCad, so that would be a bug.

What version of KiCad are you using (Paste data from Help->About KiCad->Copy version info).

Application: Eeschema
Version: (5.1.4)-1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.68.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.61.1
Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

Is it really possible that nobody before has realized this? I actual wanted to export mouser numbers and so on automatically, Not deleting every second line.

It may be an artifact of the way you are viewing the XML file, can you post the XML file here?

test.xml (1.8 KB)
Here it is. I made a small test circuit and added to the resistor two fields, test1 and test2.
I used the bom2csv which KiCad has in its default settings.

Here is the testcircuit I made:

Now I found a way to import the data. Open Excel -> “Daten abrufen” -> “Aus Datei” -> “Aus Text/CSV” and than choosing the created BOM file which has no ending. Using the .xml file didnt bring sucess for me.

I don’t see any problem with that test.xml, but it is not quite the same as the original. For example, field names with characters -.: in could cause a problem.

OK. Maybe I missunderstood the .xml file. Why is it actual created? When I use the BOM Tool there is a second file whic hasn’t a ending. This one works fine if I impoert it like .csv in Excel.

The BOM system in kicad is a bit of a hack. It first creates a xml file that holds all information of the schematic. This file is then given to the plugin you select. (The plugin really runs as a separate process. It has no access to kicad internal data and gets the xml file as one of its input parameters.)

The output file is created with the file ending you specify. The default command line generated when adding a plugin does not add a file ending. See: How to create a bill of materials (BOM)?


This will be much better sometime in the future when eeschema offers a python API as BOM tools can then use this API to read out data and would not need to rely on an indeterminate file.

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