# Adding a variable to a program

1. Start editing the real-time application.
2. In the menu bar, click Program.
3. On the worksheet, click Add.
4. A dialogue box is opened.
5. Select the Local variables tab, the Global variables tab or the Data storage tab.
6. Mark the variable you want to add.
7. Click OK.
8. The variable is added to the worksheet.

9. If a Program Organisation Unit written in Function Block Diagram contains multiple networks, the order of execution depends on the last element's position on the worksheet:

   1. From top to bottom.
   2. On the same level from left to right.
10. Drag-and-drop the variable to the desired position in the worksheet.

Creating a local variable

Creating a global variable