First Steps in Graphical Programming

This tutorial allows you to create graphical programming using the calculator node in optiSLang.

Task Description

This tutorial demonstrates how to do the following:

  • Generate a calculator node

  • Define a mathematical operation

  • Generate input and output nodes

  • Connect nodes with the calculator

  • Perform a mathematical evaluation

Tutorial Steps

Creating a New Project

  1. Start optiSLang.

  2. Create a new empty project.

  3. This tutorial provides instructions for manually connecting input and output slots. To display the slots in the node flyouts, from the menu bar select View > Slot flyout view mode > Full.

Creating Nodes

  1. Under Modules, expand Analysis.

  2. Drag a Calculator node onto the Scenery pane and let it drop.

  3. Under Modules, expand Advanced and Types.

  4. Drag a Variable node onto the Scenery pane and let it drop.

  5. Right-click the Variable node and select Rename from the context menu.

  6. Type A and press Enter.

  7. Repeat steps 2-4, renaming the node as B.

  8. Hover over the right side of the A node.

  9. Click OVar and drag it onto New slot on the left side of the Calculator node.

  10. Hover over the left side of the Calculator node.

  11. Right-click OVar and select Rename from the context menu.

  12. Type A and press Enter.

  13. Repeat steps 6-10, connecting the OVar input slot of node B to the calculator, and renaming the slot as B.

Updating Variables

  1. Double-click the A node.

  2. From the Data kind list, select Scalar.

  3. Double-click the row 1 cell.

  4. Type 2 and press Enter.

  5. To close the dialog box, click OK.

  6. Double-click the B node.

  7. From the Data kind list, select Vector.

  8. In the Entries field, type 3.

  9. Double-click the row 1 cell.

  10. Type 2 and press Enter.

  11. Double-click the row 2 cell.

  12. Type 1 and press Enter.

  13. Double-click the row 3 cell.

  14. Type 3 and press Enter.

  15. To close the dialog box, click OK.

Configuring the Calculator

  1. Double-click the Calculator node.

  2. Verify that nodes A and B appear as input slots.

  3. Click Add variable.

  4. Double-click the ID cell for the new variable, type result1, and press Enter.

  5. Double-click the Expression cell, type A+B, and press Enter.

  6. Repeat steps 3-5, naming the new variable result2 and giving it the expression A*B.

  7. Select both variables and drag them to the Output slots pane.

  8. To close the dialog box, click OK.

Creating the Monitoring Node

  1. Drag a Monitoring node onto the Scenery pane and let it drop.

  2. Hover over the right side of the Calculator node.

  3. Click result1 and drag it onto New slot on the left side of the Monitoring node.

  4. Repeat steps 2 and 3 for the result2 output slot.

    The new slots appear as inputs slots of the Monitoring node.

Saving and Running the Project

  1. To save the project, click  .

  2. Browse to the location to save the project and type a project name in the File name field.

  3. Click Save.

  4. To run the project, click  .

    The flow is executed and the calculation is performed. The results are displayed in the Message log pane

    All nodes should be successfully executed.

  5. Right-click the Monitoring node and select Pin Preview from the context menu.

    Both results vectors are shown in a diagram.