How an Eagle PCB ULP User Language Program Can Alter a Schematic

I have used a ULP ( User Language Program ) called Smash.ulp to smash all the parts on the schematic many times.  ULP's by themselves are said to be unable to modify a schematic.  Smash.ulp generates a script file named Smash.scr.  Inside of Smash.scr you will see something like the following:


grid mil;
smash (2700 1400);
smash (3800 1400);
smash (500 6900);
smash (1400 7000);
smash (8500 6400);
smash (3100 6800);
smash (3400 6800);
smash (3700 6800);
smash (4000 6800);


The integers shown are in units of mils which is called out at the top of the list.  I verified indeed that these coordinates correspond to parts origins on the schematic which I ran Smash.ulp on.  So what Smash.ulp does is the following:

  1. create a list of smash commands for each component with their respective coordinates
  2. At the exit of Smash.ulp there is a statement that calls the script file named Smash.scr. That line is shown below:

exit("; SCR '" + ulp_path + "smash_all.scr';\n");

An Ultra simple Eagle PCB ULP User Language Program Tutorial to write to a file

I like simple examples for purposes of learning a programming language.  Something that does not clutter everything up leaving me with a million doubts.  The following Eagle ULP tutorial file writes an ASCII string to two different files.  The first file write demonstrate the default location of file writing and the second shows how to specify where you want the file written.  Notice the backslash character needs escaped because it is the escape character!  

 


output("fudge.txt", "wt"){ printf("Directly printed to file with output statement\n");}           //w= Write new file / t= Text mode
                                                                                                  //This did not work when located at bottom of file. Must not have been executed.  
                                                                                                  //It writes to the Eagle program directory! 
output("C:\\Users\\freemonsandlewould\\Documents\\Schematics\\Reader\\ULP\\farge.txt", "wt")
      { printf("Directly printed to file with output statement\n");}          
                                                                                                  //The backslash character must be escaped with another backslash
                                                                                                  //When you specify the entire path then it goes where you plan that it should
      
exit (0);   // Must have this or it errors out


A simple Eagle PCB ULP User Language Program to Open a file dialog and write to the file specified by it

This ULP ( User Language Program ) opens a file dialog automatically using the schematic name to form a file name in the dialog opened.  If you want you can change the name in the open dialog box.  It is a fairly simple program without all the extra stuff you see in this mind boggling script files.  I checked and was able to cut and paste the following into NotePad++ without getting html characters.

Writing Eagle PCB ULP User Language Program Tutorials

I have googled for tutorials on how to write ULP's but have found very little.  The main ULP reference is called User Language and it is very short on examples.  What they do have does not work when you first copy and paste it.  You must first do a snipe hunt to find out why it does not work.  Thus I am placing my simple experiments here.  Please leave comments and / or email me your tutorial and I will add it here.

References

Eagle PCB User Language Program tutorials.  ( ULP ) 

Soup Madness

I need to use up some vegetables from down on the Crook farm.  Thus I am placing these recipes here to hold them until I make and they get their own entries.

Beef, Okra, Potato And Carrot Soup

1/2 red onion, diced
2 ribs celery, thinly sliced
1 medium carrot, thinly sliced
3 tablespoons olive oil
1 pound beef stew meat (chuck or round roast), cut into 1/2-inch cubes
3/4 pound okra, cut into bite-sized pieces
3 medium waxy potatoes, cubed
1/2 pound cherry tomatoes, cut in half
5 cups water
2 cloves garlic, minced
1/2 cup finely chopped parsley
2 tablespoons lemon juice

1. Prep the onion, celery and carrot. Heat the olive oil in a large pot over medium heat. When the oil is hot, add the vegetables 
and season them with a generous sprinkling of salt and pepper. Cook, stirring occasionally, 8-10 minutes.

2. Meanwhile, prep the beef, okra, potatoes and tomatoes. Season the beef generously all over with salt and pepper. Add these to 
the pot and stir. Cook, stirring occasionally, 4-6 more minutes.

3. Add the water and bring the soup to a boil. Immediately reduce to a simmer. Cook, stirring occasionally, until the beef and 
potatoes are tender, 20-30 minutes. 

4. Stir in the minced garlic, parsley and lemon juice. Add more salt and pepper to taste.

Celery potato Soup

NGREDIENTS
1 large bunch celery with leaves (about 2 pounds)
2 tablespoons olive oil
1 large onion (about 12 ounces), chopped
1 tablespoon fresh thyme leaves
Salt and coarsely ground black pepper
1/2 cup white wine
3 cans (14 to 14 1/4 ounces each) chicken broth (5 1/4 cups)
2 medium all-purpose potatoes (about 6 ounces each), peeled and cut into 1-inch chunks
2 cups water

PREPARATION
1. Trim ends from celery stalks. Reserve a few celery leaves for garnish; wrap with plastic wrap and refrigerate. 
Slice celery stalks and remaining leaves crosswise into 1-inch pieces; transfer to colander. Rinse and drain well.

2. In 51/2- to 6-quart saucepot, heat oil over medium heat. Add celery and leaves, onion, thyme, 1/2 teaspoon salt, 

I need to use up some vegetables from down on the Crook farm.  Thus I am placing these recipes here to hold them until I make and they get their own entries.

Beef, okra, potato, carrot soup
Celery soup
Roasted eggplant soup
Roasted egglplant and chickpea soup
Beef, Okra, Potato And Carrot Soup

1/2 red onion, diced
2 ribs celery, thinly sliced
1 medium carrot, thinly sliced
3 tablespoons olive oil
1 pound beef stew meat (chuck or round roast), cut into 1/2-inch cubes
3/4 pound okra, cut into bite-sized pieces
3 medium waxy potatoes, cubed
1/2 pound cherry tomatoes, cut in half
5 cups water
2 cloves garlic, minced
1/2 cup finely chopped parsley
2 tablespoons lemon juice

1. Prep the onion, celery and carrot. Heat the olive oil in a large pot over medium heat. When the oil is hot, add the vegetables 
and season them with a generous sprinkling of salt and pepper. Cook, stirring occasionally, 8-10 minutes.

2. Meanwhile, prep the beef, okra, potatoes and tomatoes. Season the beef generously all over with salt and pepper. Add these to 
the pot and stir. Cook, stirring occasionally, 4-6 more minutes.

3. Add the water and bring the soup to a boil. Immediately reduce to a simmer. Cook, stirring occasionally, until the beef and 
potatoes are tender, 20-30 minutes. 

4. Stir in the minced garlic, parsley and lemon juice. Add more salt and pepper to taste.

Celery potato Soup

NGREDIENTS
1 large bunch celery with leaves (about 2 pounds)
2 tablespoons olive oil
1 large onion (about 12 ounces), chopped
1 tablespoon fresh thyme leaves
Salt and coarsely ground black pepper
1/2 cup white wine
3 cans (14 to 14 1/4 ounces each) chicken broth (5 1/4 cups)
2 medium all-purpose potatoes (about 6 ounces each), peeled and cut into 1-inch chunks
2 cups water

PREPARATION
1. Trim ends from celery stalks. Reserve a few celery leaves for garnish; wrap with plastic wrap and refrigerate. 
Slice celery stalks and remaining leaves crosswise into 1-inch pieces; transfer to colander. Rinse and drain well.

2. In 51/2- to 6-quart saucepot, heat oil over medium heat. Add celery and leaves, onion, thyme, 1/2 teaspoon salt, 
and 1/4 teaspoon pepper, and cook 20 to 25 minutes or until celery is soft but not browned, stirring occasionally. 
Add wine and cook 2 minutes or until wine is mostly evaporated.

3. Add broth, potatoes, and water to saucepot; cover and heat to boiling over high heat. Reduce heat to low; cover 
and simmer 10 minutes or until potatoes are very tender.

4. In batches, ladle celery mixture into blender; cover, with center part of cover removed to allow steam to escape, 
and blend very well until pureed. Pour puree into large bowl. Repeat with remaining mixture.

5. Return soup to saucepot; heat through. Ladle soup into tureen; sprinkle with pepper and garnish with celery leaves.

INGREDIENTS

2 medium eggplants (about 1 1/2 pounds total), peeled and cut into 1-inch pieces
1 small yellow onion, diced medium
2 garlic cloves, unpeeled
6 teaspoons extra-virgin olive oil
Coarse salt and ground pepper
1 can (15.5 ounces) chickpeas, rinsed, drained, and patted dry
4 cups low-sodium chicken broth or water
Fresh oregano (optional)
Plain yogurt (optional)
DIRECTIONS

STEP 1
Preheat oven to 400 degrees. In a large bowl, toss together eggplant, onion, garlic, and 4 teaspoons of the 
olive oil; season with salt and pepper. Arrange in a single layer in a roasting pan or rimmed baking sheet, 
leaving a wide strip of empty space at one end. In bowl, toss chickpeas with remaining 2 teaspoons olive oil. 
Transfer to empty space on sheet. Roast until eggplant is golden and cooked through and chickpeas are slightly 
crunchy, about 35 minutes.

STEP 2
Set chickpeas aside. Peel garlic and add to a medium pot, along with eggplant, onion, and broth. Bring mixture
 to a simmer over medium-high. With a potato masher or back of a wooden spoon, mash some eggplant until soup
 is thick and chunky. Stir in chickpeas and season to taste with salt and pepper. To serve, top with fresh
 oregano and plain yogurt, if desired.

and 1/4 teaspoon pepper, and cook 20 to 25 minutes or until celery is soft but not browned, stirring occasionally. 
Add wine and cook 2 minutes or until wine is mostly evaporated.

3. Add broth, potatoes, and water to saucepot; cover and heat to boiling over high heat. Reduce heat to low; cover 
and simmer 10 minutes or until potatoes are very tender.

4. In batches, ladle celery mixture into blender; cover, with center part of cover removed to allow steam to escape, 
and blend very well until pureed. Pour puree into large bowl. Repeat with remaining mixture.

5. Return soup to saucepot; heat through. Ladle soup into tureen; sprinkle with pepper and garnish with celery leaves.

 

INGREDIENTS

2 medium eggplants (about 1 1/2 pounds total), peeled and cut into 1-inch pieces
1 small yellow onion, diced medium
2 garlic cloves, unpeeled
6 teaspoons extra-virgin olive oil
Coarse salt and ground pepper
1 can (15.5 ounces) chickpeas, rinsed, drained, and patted dry
4 cups low-sodium chicken broth or water
Fresh oregano (optional)
Plain yogurt (optional)
DIRECTIONS

STEP 1
Preheat oven to 400 degrees. In a large bowl, toss together eggplant, onion, garlic, and 4 teaspoons of the 
olive oil; season with salt and pepper. Arrange in a single layer in a roasting pan or rimmed baking sheet, 
leaving a wide strip of empty space at one end. In bowl, toss chickpeas with remaining 2 teaspoons olive oil. 
Transfer to empty space on sheet. Roast until eggplant is golden and cooked through and chickpeas are slightly 
crunchy, about 35 minutes.

STEP 2
Set chickpeas aside. Peel garlic and add to a medium pot, along with eggplant, onion, and broth. Bring mixture
 to a simmer over medium-high. With a potato masher or back of a wooden spoon, mash some eggplant until soup
 is thick and chunky. Stir in chickpeas and season to taste with salt and pepper. To serve, top with fresh
 oregano and plain yogurt, if desired.

Open Laptop

Interesting idea of making a laptop based on an ARM processor occurred to me.  I phoned the Center for Internet Research and they lept into action.

Research Links

If you have never heard about hacker, engineer, and activist Andrew ""Bunnie"" Huang, author of reverse engineering classic Hacking the XBox and the hardware lead on Chumby, you owe it to yourself to follow his story on our blog and elsewhere.   One of the hacker movement's most talented young engineers, equal parts the web's prized ""professor"" of reverse engineering and full-scale inventor, most conversations around Bunnie tend to start with: "What's Bunnie up to now!?" He's always up to something, and some of these things are products we'd like to carry, collected here. Stay tuned for new additions as they appear — rabbits pulled out of Bunnie's hat — as when he creates something new, we always take a look.