Using Excel to Generate an ODB++ Control File

It is possible to use XML schema functionality in Microsoft Excel to create stackup layer information that can then be exported to an ODB++ control file.

The schema is basically a set of rules (constraints) that define the structure and content (elements) of an XML file. Both XML and XML Schema documents (*.xml, *.xsd) are straightforward, user friendly text files, and Microsoft Excel offers an intuitive interface that "maps" elements in an XML schema to data cells in an ordinary worksheet. As such, and because the XML schema is quite simple, it is possible to use a plain-text XML editor in Microsoft Excel to create stackup layer controls that are suitable for Ansys electromagnetic tools. These controls can then be exported to an ODB++ Control File.

The schema used in the following example is shipped with SIwave and can be found at <AnsysEM_installation_directory>\Stackup.xsd.

This example uses Microsoft Excel 2016, but versions as early as Excel 2003 should be compatible:

  1. To access the XML import/export functionality in Excel, you must first activate the Developer tab.

    If the Developer tab is not already visible, enable it in Excel Options > Customize Ribbon.

    Excel Options

  1. Open the spreadsheet file (*.xls or *.xlsx) that you wish to export to the control file.

    From the spreadsheet file, make sure there is at least one empty row preceding the cells you wish to export. If appropriate, delete any tags or headers.

  2. On the Developer tab, click Source to open the XML Source task pane.

    XML Source Task Pane

  3. From the XML Source task pane, click XML Maps to open the XML Maps window.

    XML Maps Window

  4. Click Add to open the Select XML Source window. Browse to the Stackup.xsd file in the installation directory and click Open.

    Select XML Source Window

  5. Click OK to close the Source window.

    The XML schema is loaded into the XML Source pane.

    XML Source Window with Source

  6. From the schema element list that appears in the task pane, elements with a red star are mandatory fields that you must map to cells in the worksheet. However, you do not need to map a starred element if its parent is not also starred.

    For most Excel files, you will need to add at least one cell in the worksheet that contains the schema version number — which is currently fixed at "1.0" — you can add it anywhere, but it must be formatted as "text", instead of the default format "number", so that the literal string will be exported. You may add additional fields to the worksheet, such as a layer-thickness unit, but this is not required. From the following image, the Schema Version and Layer Thickness Unit have been added to column H.

    Control File

  7. Many pre-existing layer stackup files may contain names or symbols that are different from those used by the XML Schema. These names will be flagged as errors, even if they represent the same entity. Because of this, these names must be replaced with valid entries before being exported to XML.

    For example, "METAL" is not a valid layer type, so it is replaced with "conductor."

    Additionally, XML is case-sensitive, so "DIELECTRIC" is replaced with "dielectric".

    Revised Control File

    For a complete list of valid entries for each element, open the XML Schema document (*.xsd) in a text editor and search for the element name.

  8. Map the XML schema to the workbook by dragging each element from the XML Source pane to the corresponding cell in the workbook. Mapped areas appear in blue nonprintable borders. Repeat this mapping operation for each element by dragging it into the workbook.

    For columns of data, drop the element on the cell directly above the top row in order to make it the header.

    For a single cell, simply drop the element on the cell itself.

    Mapped Control File

  9. To export to an XML file, use the XML Source pane to select the elements you wish to export. All corresponding mapped cells will be highlighted in the worksheet .
    Note:

    To select all, click ns1::Stackup.

  10. On the Developer tab, click Export. From the Export XML window that opens, specify a name for the file. Click Save and the file is exported to XML.

    Developer Tab, XML Area

  11. Review the XML File in a text editor or your software of choice.

    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

      <ns1:Stackup xmlns="http://www.ansys.com/stackup" schemaVersion="1">

       <Layers LengthUnit='mil'>

        <Layer Name="'SIwave_DIE'" Type="conductor" TargetLayer="1" Material="copper" Thickness="17.5" />

        <Layer Name="'Top_dielectric'" Type="dielectric" TargetLayer="2" Material="epoxy" Thickness="57.5" />

        <Layer Name="'TOP'" Type="dielectric" TargetLayer="3" Material="epoxy" Thickness="25" />

        <Layer Name="'L01'" Type="conductor" TargetLayer="4" Material="copper" Thickness="15" />

        <Layer Name="'DRILL_1'" Type="dielectric" TargetLayer="5" Material="epoxy" Thickness="30" />

        <Layer Name="'L02'" Type="conductor" TargetLayer="6" Material="copper" Thickness="15" />

        <Layer Name="'DRILL_2'" Type="dielectric" TargetLayer="7" Material="epoxy" Thickness="30" />

        <Layer Name="'L03'" Type="conductor" TargetLayer="8" Material="copper" Thickness="15" />

        <Layer Name="'DRILL_3'" Type="dielectric" TargetLayer="9" Material="epoxy" Thickness="30" />

        <Layer Name="'L04'" Type="conductor" TargetLayer="10" Material="copper" Thickness="15" />

        <Layer Name="'DRILL_4'" Type="dielectric" TargetLayer="11" Material="epoxy" Thickness="30" />

        <Layer Name="'L05'" Type="conductor" TargetLayer="12" Material="copper" Thickness="15" />

        <Layer Name="'DRILL_5'" Type="dielectric" TargetLayer="13" Material="epoxy" Thickness="30" />

        <Layer Name="'L06'" Type="conductor" TargetLayer="14" Material="copper" Thickness="25" />

       </Layers>

      </nsl:Stackup>

There are also free tools available online to validate an XML file against a given schema.