[Tutorial] Using Hierarchy Boards to create re-usable code by BrettG
Often in signal processing there is a need to have the same processing function applied to several channels, or to re-use the same functionality in several products. A good way to do this in SigmaStudio is with hierarchy boards. This is a tutorial for using hierarchy boards.
First, add a hierarchy board to the project by dragging it from the system folder in the toolbox.
The hierarchy board will appear as a blank rectangle labeled "Board1". You can rename the board by clicking on its name, if you want.
At the bottom of the project view, a new Board1 tab has now appeared. Click it to enter the board. At first, the board is simply empty.
Add a hierarchy input and hierarchy output to get an input channel and output channel to/from the board.
These appear as floating green rectangles in the project.
Place the desired signal processing between the input and output, and wire the cells together.
You can now return to the main project tab, where you'll see new input and output pins on the hierarchy board (corresponding to the inputs and outputs you created within the board). You can now wire the board into the rest of your project.
To re-use the board, right click it and select File...Save Board As...
You can now assign a filename to the board.
You can copy/paste the board as desired, or simply add a new blank board to a new project and select File...Load Board... in order to use the board in other projects.
Using this function, you can easily create modular code that can be reused within projects and across projects.