element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE Support (Deutsch) ULP - Frage
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 180 subscribers
  • Views 373 views
  • Users 0 members are here
Related

ULP - Frage

shangxi
shangxi over 12 years ago

Hallo!

 

Ich habe da mal eine Frage.

Bei meiner ulp funktioniert

if(P.pin.direction != 1 && P.pin.direction != 6)

aber

if(P.pin.direction != PIN_DIRECTION_PAS && P.pin.direction != 

PIN_DIRECTION_PWR)

funktioniert nicht.

Weiß jemand warum?

 

Danke,

Zoran

 

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 12 years ago

    Am 26.03.2013 17:28, schrieb Zoran Stojkovic:

    Hallo!

     

    Ich habe da mal eine Frage.

    Bei meiner ulp funktioniert

    if(P.pin.direction != 1 && P.pin.direction != 6)

    aber

    if(P.pin.direction != PIN_DIRECTION_PAS && P.pin.direction !=

    PIN_DIRECTION_PWR)

    funktioniert nicht.

    Weiß jemand warum?

     

    Danke,

    Zoran

     

    Mir ist nicht klar, wie Sie auf P kommen?

    "P.pin.direction" erzeugt einen Syntax error.

     

    Hier ein funktionierendes Beispiel:

     

    if (schematic) {

       schematic(SCH) {

         SCH.parts(PA) {

           PA.device.gates(G) {

             G.symbol.pins(P) {

               if(P.direction != PIN_DIRECTION_PAS && P.direction !=

    PIN_DIRECTION_PWR) {

                 if (dlgMessageBox(PA.name+" : " + P.name + "\nHurra kein

    PAS oder PWR", "OK", "ESC") != 0) exit(-9);

               }

             }

           }

         }

       }

    }

     

     

    Mit freundlichen Grüßen / Best regards

     

    Alfred Zaffran

    --

    ______________________________________________________________

    Alfred Zaffran              Support

    CadSoft Computer GmbH       Hotline:   08635-698930

    Pleidolfweg 15              FAX:       08635-698940

    84568 Pleiskirchen          eMail: <alf@cadsoft.de>

                                 Web:   <www.cadsoft.de>

    Registergericht: Amtsgericht Traunstein HRB 5573

    Geschäftsführer: Thomas Liratsch

    ______________________________________________________________

     

    EAGLE V6.4 availabe now!

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • shangxi
    shangxi over 12 years ago in reply to Former Member

    Am 27.03.2013, 09:22 Uhr, schrieb A. Zaffran <alf@cadsoft.de>:

     

    Am 26.03.2013 17:28, schrieb Zoran Stojkovic:

    Hallo!

     

    Ich habe da mal eine Frage.

    Bei meiner ulp funktioniert

    if(P.pin.direction != 1 && P.pin.direction != 6)

    aber

    if(P.pin.direction != PIN_DIRECTION_PAS && P.pin.direction !=

    PIN_DIRECTION_PWR)

    funktioniert nicht.

    Weiß jemand warum?

     

    Danke,

    Zoran

     

    Mir ist nicht klar, wie Sie auf P kommen?

    "P.pin.direction" erzeugt einen Syntax error.

     

    Hier ein funktionierendes Beispiel:

     

    if (schematic) {

       schematic(SCH) {

         SCH.parts(PA) {

           PA.device.gates(G) {

             G.symbol.pins(P) {

               if(P.direction != PIN_DIRECTION_PAS && P.direction != 

    PIN_DIRECTION_PWR) {

                 if (dlgMessageBox(PA.name+" : " + P.name + "\nHurra kein 

    PAS oder PWR", "OK", "ESC") != 0) exit(-9);

               }

             }

           }

         }

       }

    }

     

     

    Mit freundlichen Grüßen / Best regards

     

    Alfred Zaffran

     

    UPS, mein Fehler. Zu wenig Input:

     

    Ich möchte für ein FPGA eine "Netzliste" ausgeben, d.h. alle 

    angeschlossenen Netze in einer Datei haben.

    Hierfür wäre es schön, wenn die Versorgungsleitungen und passiven pins 

    weggelassen werden.

    folgender code funktioniert (ein Ausschnitt):

    schematics(SCH) {

       SCH.nets(N) {

         N.pinrefs(P) {

           if(P.part.name == partname)     // check if e.g. "U1"

             if(P.pin.direction != 1 && P.pin.direction != 6)

               printf("%s\t%s\t%s\n", N.name, P.pin.contact.name, P.pin.name);

         }

       }

    }

    mache ich das mit PIN_DIRECTION_PAS usw., dann funkt's nicht.

    ich habe Ihren code eingebaut:

         SCH.parts(PA) {

           if(PA.name == partname) {

             printf("%s:\n",partname);

             PA.device.gates(G) {

               G.symbol.pins(P) {

                 if(P.direction != PIN_DIRECTION_PAS && P.direction != 

    PIN_DIRECTION_PWR)

                   printf("%s\t%s\t%s\n", P.net, P.contact.name, P.name);

               }

             }

           }

         }

    Hier kommt kein Netzname (P.net) zurück (leerer String) und es werden auch 

    fast (?) alle pins ausgegeben.

     

    So ganz verstehe ich das nicht.

     

    Danke,

    Zoran

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to shangxi

    Am 27.03.2013 10:00, schrieb Zoran Stojkovic:

    Am 27.03.2013, 09:22 Uhr, schrieb A. Zaffran <alf@cadsoft.de>:

     

    Am 26.03.2013 17:28, schrieb Zoran Stojkovic:

    Hallo!

     

    Ich habe da mal eine Frage.

    Bei meiner ulp funktioniert

    if(P.pin.direction != 1 && P.pin.direction != 6)

    aber

    if(P.pin.direction != PIN_DIRECTION_PAS && P.pin.direction !=

    PIN_DIRECTION_PWR)

    funktioniert nicht.

    Weiß jemand warum?

     

    Danke,

    Zoran

     

    Mir ist nicht klar, wie Sie auf P kommen?

    "P.pin.direction" erzeugt einen Syntax error.

     

    Hier ein funktionierendes Beispiel:

     

    if (schematic) {

       schematic(SCH) {

         SCH.parts(PA) {

           PA.device.gates(G) {

             G.symbol.pins(P) {

               if(P.direction != PIN_DIRECTION_PAS && P.direction !=

    PIN_DIRECTION_PWR) {

                 if (dlgMessageBox(PA.name+" : " + P.name + "\nHurra kein

    PAS oder PWR", "OK", "ESC") != 0) exit(-9);

               }

             }

           }

         }

       }

    }

     

     

    Mit freundlichen Grüßen / Best regards

     

    Alfred Zaffran

     

    UPS, mein Fehler. Zu wenig Input:

     

    Ich möchte für ein FPGA eine "Netzliste" ausgeben, d.h. alle

    angeschlossenen Netze in einer Datei haben.

    Hierfür wäre es schön, wenn die Versorgungsleitungen und passiven pins

    weggelassen werden.

    folgender code funktioniert (ein Ausschnitt):

    schematics(SCH) {

       SCH.nets(N) {

         N.pinrefs(P) {

           if(P.part.name == partname)    // check if e.g. "U1"

             if(P.pin.direction != 1 && P.pin.direction != 6)

               printf("%s\t%s\t%s\n", N.name, P.pin.contact.name, P.pin.name);

         }

       }

    }

    mache ich das mit PIN_DIRECTION_PAS usw., dann funkt's nicht.

    ich habe Ihren code eingebaut:

         SCH.parts(PA) {

           if(PA.name == partname) {

             printf("%s:\n",partname);

             PA.device.gates(G) {

               G.symbol.pins(P) {

                 if(P.direction != PIN_DIRECTION_PAS && P.direction !=

    PIN_DIRECTION_PWR)

                   printf("%s\t%s\t%s\n", P.net, P.contact.name, P.name);

               }

             }

           }

         }

    Hier kommt kein Netzname (P.net) zurück (leerer String) und es werden

    auch fast (?) alle pins ausgegeben.

     

    P.net ergibt einen Syntax error!

    Richtig ist ==>>  P.pin.net

     

     

    So ganz verstehe ich das nicht.

     

    Danke,

    Zoran

     

    Hier das funktionierende Beispiel:

     

    string PinDir[];

            PinDir[PIN_DIRECTION_NC]  = "Not connected";

            PinDir[PIN_DIRECTION_IN]  = "Input";

            PinDir[PIN_DIRECTION_OUT] = "Output (totem-pole)";

            PinDir[PIN_DIRECTION_IO]  = "In/Output (bidirectional)";

            PinDir[PIN_DIRECTION_OC]  = "Open Collector";

            PinDir[PIN_DIRECTION_PWR] = "Power-Input-Pin";

            PinDir[PIN_DIRECTION_PAS] = "Passiv";

            PinDir[PIN_DIRECTION_HIZ] = "High-Impedance-Output";

            PinDir[PIN_DIRECTION_SUP] = "Supply-Pin";

     

    string PartName = "U1";

    string s;

    schematic(SCH) {

       SCH.nets(N) {

         N.pinrefs(P) {

           if(P.part.name == PartName) {   // check if e.g. "U1"

             if(P.pin.direction != PIN_DIRECTION_PWR && P.pin.direction !=

    PIN_DIRECTION_PAS) {

               sprintf(s, "%s\t%s\t%s\t%s\t%s\n", P.pin.net, P.part.name,

    P.pin.contact.name, P.pin.name, PinDir[P.pin.direction]);

               if (dlgMessageBox(s, "OK", "ESC") != 0) exit(-27);

             }

           }

         }

       }

    }

     

    Aber Achtung: wenn keine Part U1 in der Schaltung ist, wird nichts

    ausgegeben!

     

     

    Mit freundlichen Grüßen / Best regards

     

    Alfred Zaffran

    --

    ______________________________________________________________

    Alfred Zaffran              Support

    CadSoft Computer GmbH       Hotline:   08635-698930

    Pleidolfweg 15              FAX:       08635-698940

    84568 Pleiskirchen          eMail: <alf@cadsoft.de>

                                 Web:   <www.cadsoft.de>

    Registergericht: Amtsgericht Traunstein HRB 5573

    Geschäftsführer: Thomas Liratsch

    ______________________________________________________________

     

    EAGLE V6.4 availabe now!

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 12 years ago in reply to shangxi

    Am 27.03.2013 10:00, schrieb Zoran Stojkovic:

    Am 27.03.2013, 09:22 Uhr, schrieb A. Zaffran <alf@cadsoft.de>:

     

    Am 26.03.2013 17:28, schrieb Zoran Stojkovic:

    Hallo!

     

    Ich habe da mal eine Frage.

    Bei meiner ulp funktioniert

    if(P.pin.direction != 1 && P.pin.direction != 6)

    aber

    if(P.pin.direction != PIN_DIRECTION_PAS && P.pin.direction !=

    PIN_DIRECTION_PWR)

    funktioniert nicht.

    Weiß jemand warum?

     

    Danke,

    Zoran

     

    Mir ist nicht klar, wie Sie auf P kommen?

    "P.pin.direction" erzeugt einen Syntax error.

     

    Hier ein funktionierendes Beispiel:

     

    if (schematic) {

       schematic(SCH) {

         SCH.parts(PA) {

           PA.device.gates(G) {

             G.symbol.pins(P) {

               if(P.direction != PIN_DIRECTION_PAS && P.direction !=

    PIN_DIRECTION_PWR) {

                 if (dlgMessageBox(PA.name+" : " + P.name + "\nHurra kein

    PAS oder PWR", "OK", "ESC") != 0) exit(-9);

               }

             }

           }

         }

       }

    }

     

     

    Mit freundlichen Grüßen / Best regards

     

    Alfred Zaffran

     

    UPS, mein Fehler. Zu wenig Input:

     

    Ich möchte für ein FPGA eine "Netzliste" ausgeben, d.h. alle

    angeschlossenen Netze in einer Datei haben.

    Hierfür wäre es schön, wenn die Versorgungsleitungen und passiven pins

    weggelassen werden.

    folgender code funktioniert (ein Ausschnitt):

    schematics(SCH) {

       SCH.nets(N) {

         N.pinrefs(P) {

           if(P.part.name == partname)    // check if e.g. "U1"

             if(P.pin.direction != 1 && P.pin.direction != 6)

               printf("%s\t%s\t%s\n", N.name, P.pin.contact.name, P.pin.name);

         }

       }

    }

    mache ich das mit PIN_DIRECTION_PAS usw., dann funkt's nicht.

    ich habe Ihren code eingebaut:

         SCH.parts(PA) {

           if(PA.name == partname) {

             printf("%s:\n",partname);

             PA.device.gates(G) {

               G.symbol.pins(P) {

                 if(P.direction != PIN_DIRECTION_PAS && P.direction !=

    PIN_DIRECTION_PWR)

                   printf("%s\t%s\t%s\n", P.net, P.contact.name, P.name);

               }

             }

           }

         }

    Hier kommt kein Netzname (P.net) zurück (leerer String) und es werden

    auch fast (?) alle pins ausgegeben.

     

    P.net ergibt einen Syntax error!

    Richtig ist ==>>  P.pin.net

     

     

    So ganz verstehe ich das nicht.

     

    Danke,

    Zoran

     

    Hier das funktionierende Beispiel:

     

    string PinDir[];

            PinDir[PIN_DIRECTION_NC]  = "Not connected";

            PinDir[PIN_DIRECTION_IN]  = "Input";

            PinDir[PIN_DIRECTION_OUT] = "Output (totem-pole)";

            PinDir[PIN_DIRECTION_IO]  = "In/Output (bidirectional)";

            PinDir[PIN_DIRECTION_OC]  = "Open Collector";

            PinDir[PIN_DIRECTION_PWR] = "Power-Input-Pin";

            PinDir[PIN_DIRECTION_PAS] = "Passiv";

            PinDir[PIN_DIRECTION_HIZ] = "High-Impedance-Output";

            PinDir[PIN_DIRECTION_SUP] = "Supply-Pin";

     

    string PartName = "U1";

    string s;

    schematic(SCH) {

       SCH.nets(N) {

         N.pinrefs(P) {

           if(P.part.name == PartName) {   // check if e.g. "U1"

             if(P.pin.direction != PIN_DIRECTION_PWR && P.pin.direction !=

    PIN_DIRECTION_PAS) {

               sprintf(s, "%s\t%s\t%s\t%s\t%s\n", P.pin.net, P.part.name,

    P.pin.contact.name, P.pin.name, PinDir[P.pin.direction]);

               if (dlgMessageBox(s, "OK", "ESC") != 0) exit(-27);

             }

           }

         }

       }

    }

     

    Aber Achtung: wenn keine Part U1 in der Schaltung ist, wird nichts

    ausgegeben!

     

     

    Mit freundlichen Grüßen / Best regards

     

    Alfred Zaffran

    --

    ______________________________________________________________

    Alfred Zaffran              Support

    CadSoft Computer GmbH       Hotline:   08635-698930

    Pleidolfweg 15              FAX:       08635-698940

    84568 Pleiskirchen          eMail: <alf@cadsoft.de>

                                 Web:   <www.cadsoft.de>

    Registergericht: Amtsgericht Traunstein HRB 5573

    Geschäftsführer: Thomas Liratsch

    ______________________________________________________________

     

    EAGLE V6.4 availabe now!

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube