Menu
  • Use Cases
  • Stacks
  • Stackbuilder
  • MyStacks
  • Support
  • About Us
  • Contact
  • Use Cases
  • Stacks
  • Stackbuilder
  • MyStacks
  • Support
  • About Us
  • Contact
  • View Cart

Make a software block in “My Blocks”


Make sure you are running the current version of Stackbuilder by downloading it from interstacks.com/stackbuilder.

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.

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.

Refer to other support documents for more information on Python programming and Interstacks.

Refer to documentation on many other topics at interstacks.com/knowledge-base.
Please email info@interstacks.com with any questions.

Popular Articles

  • MyStacks Cloud Dashboard
  • Internet communication with HTTP block
  • Download and install Stackbuilder

Contact Us

Contact us with any questions or help with deploying your IoT projects.

CONTACT US

Connect

  • Facebook
  • Twitter
  • LinkedIn
  • Email

Sign up for the latest Interstacks news.

Join Our Newsletter
  Thank you for Signing Up
  Please correct the marked field(s) below.
1,false,1,First Name,2
Email:
1,true,6,Subscriber Email,2
Name:
1,false,1,Last Name,2

Copyright © 2023 Interstacks. All rights reserved. Privacy Policy | Terms and Conditions

Site by Imagebox