This website requires JavaScript.

How to Generate BOM and Pick and Place File in DipTrace

How to Generate BOM and Pick and Place File in DipTrace

In this tutorial, let’s see how to generate BOM (Bill of Materials) and CPL (Component Placement List) [Also known as a Centroid file, Pick and Place File, XY File etc.] for JLCPCB SMT service in DipTrace.


This tutorial was written for DipTrace 4.0.0.5 and the osPID-Hardware Mainboard 1R20 project is used.


Generating the BOM


In the schematic editor, execute Objects → Bill of Materials… on the menu bar.



Figure 1. BOM Menu ItemIcon


Now the "Create Bill of Materials" dialog will appear.


  • Choose "Group Rows by: Name and Value"
  • Click Export to file button to export the BOM.


Figure 2. DipTrace Create Bill of Materials Dialog


The Save As dialog will show up, fill in the file name, click the Save button.



Figure 3. Save BOM


The software will ask for settings for CSV file, we use the default settings, so just click OK. The BOM is ready!



Figure 4. BOM CSV Settings


Edit the BOM Manually


Open the spreadsheet program and press Ctrl+O to find and open the BOM file. You’ll see the following dialog and set the options accordingly:


1. Use "Comma" as separator.


2. croll horizontally to Pattern column and select Text as the Column type to keep leading 0s in case you have 0603, 0805… for footprint names.



Figure 5. Import BOM into a Spreadsheet Program


Now you can do the changes. After editing, save the CSV file and use CSV as the file format.


Generating Pick and Place Files


First, open the board in PCB Layout windows. In the menu, execute View → Units → mm to change the unit to metric. JLCPCB’s system only recognizes Pick and Place file in metric (unit: mm).



Figure 6. Switch Units to Metric


Execute File → Export → Pick and Place…


Figure 7. Export Pick and Place Menu Item


Now the "Pick and Place Report" dialog appears.


1. Select the side (Top or Bottom) as JLCPCB currently can only solder one side.


2. Select "By Component Center" for Component Coordinates.



Figure 8. Set Output Options


Click Export to File button, a "Save As" dialog appears. Fill in the file name and click Save.



Figure 9. Save Pick and Place Dialog


The software will ask for settings for CSV. Just click OK.



Figure 10. Pick and Place CSV Settings


Now we get the file (it’s ospid-main-1R20-cpl.csv in the screenshot below).



Figure 11. The Generated Pick and Place File


But at this stage, this raw Pick and Place file still cannot be uploaded to JLCPCB website directly, we need to do some modifications to it.


Three modification methods can be used:


1. Edit it in a text editor manually.


2. Edit it in a Spreadsheet program manually.


3. Process it with a computer program.


Edit in a Text Editor


The Pick and Place file is nothing else but a plain text file so we can edit it with a text editor.


Open the file with your favorite text editor.



Figure 12. Pick and Place File Opened in Notepad


  • Change "X (mm)" to "Mid X (mm)"


  • Change "Y (mm)" to "Mid Y (mm)"


  • Save the file.


That's it!



Figure 13. Change X/Y to Mid X/Y


Edit in a Spreadsheet Program


Sometimes it’s more intuitive to edit a tabular file in a spreadsheet program.


Launch the Spreadsheet program (LibreOffice Calc, Microsoft Excel, Google Doc etc.)


Click the Open icon to locate and open the CSV file (Menu operation: File → Open… or just press the standard short-cut key Ctrl+O)




       Tip       Double click the CSV file will also invoke the spreadsheet program if CSV is associated correctly.



Figure 14. Click the Open Icon



Figure 15. Select the Pick and Place File


Here we need a few settings:


1. Use Comma as the separator.


2.Scroll horizontally to Pattern column, and select Text as the Column type otherwise the leading 0s for package names 0603, 0805… will be removed.


Then click OK.



Figure 16. Import CSV - Options


Now do the following changes:


1. Change X (mm) to Mid X (mm)


2. Change Y (mm) to Mid Y (mm)


3. Do the other changes you want.


Now, click the Save button to save the work (Or just press Ctrl+S)



Figure 17. Change XY and Save the Work


Confirm to use CSV as the file format.



Figure 18. Confirm to use CSV Format


Now we have the CSV file which can be used to place the SMT order.


Using a Conversion Script/Program


Modify the files manually every time after generating the files is tedious and error-prone.


As the BOM and Pick and Place files are all plain text files, so it’s very easy to write some scripts to process them to meet JLCPCB's spec.


To be done.


The Rotation Problem


After uploading Gerbers, BOM and Pick and Place files, if everything goes well, you’ll see a preview window which has a rendered PCB with components on it.



Figure 19. Wrong Rotation


In the above screenshot, you can see the rotations for lots of parts are incorrect. If this happens, you need to fix the rotation in the Pick and Place File and upload it again. This is a workaround though, JLCPCB will solve this problem in the near future.


Here's an example of how to fix the rotation by hand:


For example, the polarity of D5 (upper left of the board) is reversed, so 180 degrees must be added to the current value (270), 180+270 = 450, 450 Mod 360 = 90, so the correct rotation is 90.


Fix all the rotations and go back to the BOM/CPL uploading page, upload the CPL file again, now you can see some rotations has been fixed!




TipIf you use a script or a spreadsheet program to process the Pick and Place file, a rotation translation table can be set up and maintained to fix the rotation automatically.

Last updated on July 25, 2023