Skip to content

Harnesses

A physical assembly that contains a set of electrical circuits that satisfies a channel map. Can also contain other parts and instructions about how to be built.


How to define a new harness

  1. Make a folder for the part number of your harness somewhere on your computer. Run Harnice Render, which will generate an example harness that you can then edit.

    Rendering a Product
    1. Navigate to your device folder (cd in command line). You don't need to make a rev folder yet, just make sure your command line is in a folder you want to represent the device you're working on.

    2. Harnice render it (harnice -r). It should walk you through the following steps then render an example:

      1. No valid Harnice file structure detected in 'your_part_number'. Create new PN here? [y]: hit enter

      2. Enter revision number [1]: hit enter for rev1 or type "A" or whatever you want your first rev to be called

      3. What product type are you working on? (harness, system, device, etc.): type "device"

      4. Enter a description of this device [DEVICE, FUNCTION, ATTRIBUTES, etc.]: self-explanatory

      5. Enter a description for this revision [INITIAL RELEASE]: hit enter, otherwise type the goal of the first revision

    You can also lightweight render if you want to bypass some of the checks.

    Lightweight Rendering a Product

    If you need to build a KiCad block diagram quickly, without specifying channels and signals, you can with --lightweight.

    Run harnice -l device or harnice --lightweight device from your device directory.

    This will follow the same flowchart as --render, but truncate the validation process.

    You will not be able to map channels with --lightweight

  2. Edit the attributes of your new harness.

    Editing the Attributes of a Product
    1. Navigate to the device folder, find the new rev folder you just made, open *-attributes.json.
    2. Change the default reference designator here, as well as any other attributes you may want to record.
    3. In the command line, render it again after you cd into the rev folder.
  3. Edit the formboard graph of your new harness.

    Editing the Formboard Graph of a Product

    How to edit formboard graph documentation needed

File Structure

Reference the files in your product by calling fileio.path("file key") from your script. They'll automatically use this structure:

fileio.dirpath("part_directory")       |-- yourpn/
                                           |-- earlier revs/
fileio.path("revision history")            |-- revhistory.csv
fileio.dirpath("rev_directory")            L-- your rev/
fileio.path("feature tree")                    |-- yourpn-revX-feature_tree.py
fileio.path("instances list")                  |-- yourpn-revX-instances_list.tsv
fileio.path("library history")                 |-- yourpn-revX-library_import_history.tsv
fileio.path("flattened network")               |-- yourpn-revX-flattened_network.tsv
fileio.path("available network")               |-- yourpn-revX-available_network.json
fileio.path("chosen network")                  L-- yourpn-revX-chosen_network.json