// // This ULP scans a schematic for nets that hang in the air, // but have only a generated name (N$). // // Errors are displayed in a dialog box. No box means no errors! // // Written by vrs, 12/26/2014. // if (!schematic) { dlgMessageBox("
ERROR: No schematic!

\nThis program can only work in the schematic editor."); exit(1); } string outstr = ""; string tmp; int errors = 0; int pinrefs, hastext; string part; schematic(SC) { SC.sheets(SH){ SH.nets(N) { if (strchr(N.name, '$') >= 0) { N.segments(S) { pinrefs = 0; part = ""; S.pinrefs(P) { // A segment is considered hanging unless it has 2 or more pinrefs. pinrefs++; part = P.instance.name; } if (pinrefs < 2) { sprintf(tmp, "Signal %s needs a name (%s) in sheet %d\n", N.name, part, SH.number); outstr += tmp; errors++; } else { hastext = 0; S.texts(T) { hastext = 1; } if (hastext) { sprintf(tmp, "Signal %s needs a name (%s) in sheet %d\n", N.name, part, SH.number); outstr += tmp; errors++; } } } } } } } if (errors) { dlgMessageBox(outstr); if (errors > 50) { output("ulp.txt", "wt") { printf("%s", outstr); } } exit(1); } exit(0);