Print

Creating Blueprints

To start a new project with a blank blueprint, select “New Project” from the “Blocks” pulldown menu in the Stackbuilder application’s menu bar.

You will see a new entry in the “Projects” palette called “Unnamed Project”. To rename it, click in the text area and edit the name. To open the new project, double click in the rectangular box containing its name. You are now free to compose your blueprint.

Loading a project to the stack


When you have composed your blueprint and are ready to test in in the stack, make sure your stack is powered via the AC power adapter and the USB cable is connected between the Base of your stack and your computer. Then, click on the Send to Stack button in the top middle of the blueprint area. It will take some time to transfer the blueprint to the stack.

When completed, the stack will initialize and run the blueprint you sent to it. You will see a trace of messages running in the stack in the console trace area in the bottom rail. If Stackbuilder indicates that your blueprint is not being sent to the stack properly, unplug the USB cable connected to your computer and plug it back in. This will initialize your stack.

Once your blueprint is working properly, you can disconnect it from your computer. Subsequently, every time your stack is powered on, it will load the blueprint you sent to it. The computer is only needed to develop the blueprint and send it to the stack, not to operate the stack.

Testing with console trace


When you are ready to test your blueprint, make sure your stack is powered via the AC power adapter, and the USB cable is connected between the Base of your stack and your computer. Once connected, click on the Send to Stack button in the top middle of the blueprint area. It will take some time to transfer the blueprint to the stack. Your stack will reset itself and start running the blueprint you sent to it.

An example of trace messages appearing in the bottom rail.

You will see a trace of messages running in the stack in the console trace area in the bottom rail. The bottom rail will automatically expand when you send a blueprint to the stack. You can collapse it by clicking anywhere in the white area to the right of the bottom rail tabs. You can expand it by clicking on the bottom tab labeled “Console”.

Each line in the trace indicates the block (in blue) and output terminal (in green) a message was sent from. To see only the messages from one block, click on the blue area in the trace for that block. To go back to seeing all messages, click in the text box at the top of the trace and delete all of the text. That text filters the trace i.e. only trace entries that match a portion of that text will be listed. Selecting other buttons at the top of the trace will cause only certain types of entries to be listed. By checking the Pause Log box, the trace will stop displaying new messages. The Clear button will clear the trace. You can use your computer’s normal scroll methods to scroll forward and back in the trace.

If any software blocks contain the Python statement I.debug, its text will be printed in the console trace when it runs. For example: I.debug(“this will print in the trace”, variable_name)

By using the console trace to see messages flowing in your stack, and optionally the use of I.debug in software blocks, you can test and debug your blueprint. In addition, if you hover your mouse cursor over an output terminal in your blueprint, a tooltip will appear that will display the last message sent from that terminal.

Once your blueprint is working properly, you can disconnect your stack from your computer. Subsequently, every time your stack is powered on, it will load the blueprint you sent to it. The computer is only needed to develop the blueprint and send it to the stack, not to operate the stack.

Creating custom software blocks


To make your own software block to use in Interstacks blueprints, select “New My Blocks Software” from the “Blocks” pull down menu in the Application’s menu bar. You will see a new entry in the “My Blocks” palette labeled “Untitled Script”. Click on that text and rename your block. Double click on the new entry to open a new tab in the Stackbuilder interface with the editor for software blocks.

An example of custom software blocks containing Python code

Notes summarizing the functionality of the software block editor above:

  • Interstacks software blocks are made using the Python scripting language.
  • Every Interstacks block has input terminals that receive messages and output terminals that send messages.
  • You can add an input terminal, and its associated input message handler, by clicking on the “+” icon in the top right, then selecting New Message Handler from the pop up menu that appears.
  • You can add an output terminal by clicking on any of the “+” icons on the right side of any handler.
  • The output terminals are not bound to any message handler in any way, i.e. any message handler can send a message out of any output terminal.
  • The “X” icons will delete a respective message handler or output terminal.
  • You can rename any input or output terminal by clicking on the text and editing.

The message received by an input terminal’s message handler is in the variable “message”. You send a message out of an output terminal by using I.sendmessage. For example:

  • I.sendmessage(2, ‘hello world’) sends the message ‘hello world’ out of terminal 2.
  • I.sendmessage(4, mylist[3] ) sends the fourth entry of the list “mylist” out of terminal 4.

Using I.debug will display its arguments on the console trace. This is useful for testing your software block. For example:

  • I.debug(“Put this on the console trace”, mylist[3] )

There is another type of handler, called Startup Handler that can also be added to a software block. Its contents are run once, before any other handlers, when the block receives its first message.

When you want to put your new software block in a blueprint, drag and drop its entry from the “My Blocks” palette into the blueprint. You must click in the area to the right of the text name but inside its bounding rectangle.

In This Article