6 Replies Latest reply on Sep 16, 2013 6:01 AM by robert_davies

    Quick Pin Out - DxDesigner

    andrew_french

      I had a request for a script in Dx (EE7.9.4) so that the end user could select a symbol in the schematic and run a quick command that would dump into a text file the ref des, part number, pin number, and then the name of the net connected to that pin.  So the output looks something like the following, one line for every pin on the symbol.

       

      J1     somePnum     A1     GND

      J1     somePnum     A2     +5V

      ....

       

      I figured out a way to do this and all was good for a while until someone decided to do pin swaps.  For some reason the script only reports the original way the symbol was hooked up despite what the schematic shows and yes I checked to make sure that the front end and the back end were in sync with each other first.  I'm not sure if this is due to the way I coded my script or if it has to do with a discrepancy on Mentor's end.  Any help figuring this out would be awesome!  I believe my issues start after the comment //grab the connections to the part

      here are the meat and potatos of the script, its in C#.net

       

      //Creates a handle to a running instance of DxDesigner

      ViewDraw.Application VdApp = (ViewDraw.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Viewdraw.Application");

       

      //Creates a handle to the current view in DxDesigner

      ViewDraw.IVdView VdView = VdApp.ActiveView;

       

      //A list to store all the Part Info in

       

      List<PartInfo> PIList = new List<PartInfo>();

       

      //Variable that will hold the collection of symbols

      ViewDraw.IVdObjs compObj;

       

      //Query the view for the collection of symbols

      compObj = VdView.Query(ViewDraw.VdObjectTypeMask.VDM_COMP, ViewDraw.VdAllOrSelected.VD_SELECTED);

       

      //Verify that at least one symbol was selected

       

      if (compObj.Count >= 1)

      {

       

           //iterate through the collection of symbols selected

           for (int x = 1; x <= compObj.Count; x++)

           {

           ViewDraw.Component comp = compObj.Item(x);

           PartInfo PI = new PartInfo();

       

           //Attempt to grab the Part Number

       

           try

           {

                PI.PartNumber = comp.FindAttribute("Part Number").Value.ToString();

                PI.RefDes = comp.Refdes;

           }

       

           catch

           {

                //If it fails finding the part number the item is a Hierarchy Block/Composite Symbol

                PI.PartNumber = "Composite Symbol";

                PI.RefDes = "No Refdes";

           }

       

           //grab the connections to the part

           ViewDraw.IVdObjs connectObj;

           connectObj = comp.GetConnections();

       

           //iterate through the connections

           for (int y = 1; y <= connectObj.Count; y++)

           {

                ViewDraw.Connection conn = connectObj.Item(y);

       

                //get the pin name at the connection

                PI.PinName.Add(conn.CompPin.Pin.GetName(ViewDraw.VdNameType.FULL_PATH_FROM_BLOCK));

       

                //Attempt to get the segments(nets) attached to the connection

       

                try

                {

                     ViewDraw.IVdObjs segmentObjs = conn.Net.GetSegments();

                     PI.NetName.Add(conn.Net.GetConnectedNetName(segmentObjs.Item(1)).ToString());

                }

       

                catch

                {

       

                //if there are no segments(nets) connected report it

                PI.NetName.Add("No Connection");

                }

        

           }

       

      //Add the current part to the list of Part Information

      PIList.Add(PI);

      }

       

       

        • 1. Re: Quick Pin Out - DxDesigner
          andrew_french

          I finally got to revisit this issue and I found a built in command "List Connected Nets" that does a very similar function to my code and it too has the same problem of not properly reporting connections after pin/gate swapping.  I went ahead and opened an SR and Mentor is opening a DR on the issue.

          • 2. Re: Quick Pin Out - DxDesigner
            lary.e

            Not reporting swapped pins is a defect that should be corrected.

             

            Maybe consider generating a "Quick Connection View" netlist and filter/report the pins that are connected to the required referenced device.

            • 3. Re: Quick Pin Out - DxDesigner
              robert_davies

              List connected nets is looking at Pin Name not Pin Number, so what it reports is correct as in Expedition only the pin number swap is back-annotated, not the pin name. I don't see from your script where you look for Pin Number, you only seem to be listing Pin Name, so the result will be the same.

              There will be a new option in Quick Connection View for VX.1 that may address this an there is also an enhancement request on the Ideas site for List Connected Nets to report pin number rather than or as well as pin name

               

              https://na5.brightidea.com/ct/ct_a_view_idea.bix?c=FDA2FA5D-237C-48D7-A66F-5DA754706D6C&idea_id=7BB23B49-39FC-4724-94E8-3D7C460C4B5B

              • 4. Re: Quick Pin Out - DxDesigner
                andrew_french

                It seems silly and useless to report anything but how the design is logically drawn.  No?  Why wouldn't the pin name also be updated on a back annotation?  What if I wanted both pin name and pin number to be reported accurately?

                 

                Can you elaborate on how pin name is correct?  Because I'm not following what you are trying to say there and it looks wrong to me.

                9-16-2013 8-05-28 AM.jpg

                • 5. Re: Quick Pin Out - DxDesigner
                  andrew_french

                  I updated my script to use Pin Number instead and things look better now.  I guess I don't really understand the difference between pin number and pin name and how Mentor uses them.  I also don't understand why one would be updated with the correct connection information but the other gets ignored.  Any insight would be appreciated.

                   

                  9-16-2013 8-40-22 AM.jpg

                  • 6. Re: Quick Pin Out - DxDesigner
                    robert_davies

                    Pin Name is generally used to describe the logical function, say Clock, whilst the pin number is the physical pin on the device on the PCB. You map the logical name to the physical pin number. In the case of simple logical gate, say a two input AND gate you might have Pin Names A, B for inputs and OUT as the output, and these are physically connected to pins 1,2 and 3. Pins A and B are logical equivalents and so may be swapped without affecting the behaviour od the circuit, but it is only necessary to swap the pin numbers 1 with 2. As these are logically equivalent pins the name is not displayed on the symbol, the symbol itself describes the logical function.

                    Of course with more complex gates that are available now it is not always possible to draw a 'logical' symbol that fully describes the function of  a pin and some other means of adding additional information might be advantageous, this could include the pin name. But this is not how it works in Expedition at this time.