![state machine labview state machine labview](https://3.bp.blogspot.com/-LUHDDMGfRE0/VTujCPUSczI/AAAAAAAAAPI/79vz_VWllMg/s1600/test.png)
Click right on the boundary of the case structure and from the dropdown menu select Add case after as shown in the figure below, By default case selector have only two case, but in our case we need four cases so we have to add two more cases.Connect the input side of this block to the input nodes of the case structure and the output side to the output node of the case structure as shown in the figure below,.Now change the selector label to subtract and from the function palette select numeric and then select subtract as shown in the figure below,.Right click on the case structure boundary and from the drop down menu select make this case add as shown in the figure below,
![state machine labview state machine labview](https://img.yumpu.com/3831961/1/500x640/labview-state-diagram-toolkit-user-guide-national-instruments.jpg)
The case for this operation will be automatically selected as subtracts.Now, connect the enum control we created previously o the case selector node of the case structure as shown in the figure below,.Place the add block on the block diagram inside the case structure and all other indicators and controls outside it as shown in the figure below,.From the function palette select structures and then select Case structure as shown in the figure below, add subtract etc depending upon the enum controls’ input Therefore we will need a case structure as we have already used in previous tutorials. We will need to select the case for each operation i.e. this will display a window and we have also discussed this in previous tutorials, create 4 items in the enum control window named as add, subtract, multiply and divide as shown in the figure below, and click okįigure 7: Adding items in the enum control.On this block click right and from the drop down menu select edit items as shown in the figure below,.On the front panel click right and from the control palette select rings and enums and then select enum control as shown in the figure below, We will need an enumerated control here to select the case for operation.The complete block diagram for adding two numbers is shown in the figure below,.Now, at the output of this block one node is present, click right on that node and from the drop down menu select create and then select indicator, this will create an indicator to display the output as shown in the figure below, Do the same for the second input of the add block too.At the input side of this block two nodes are present right click on that node a dropdown menu will appear from that menu select create and then select control this will create an input control for the input of the operands as shown in the figure below,.
![state machine labview state machine labview](https://flylib.com/books/3/352/1/html/2/images/13lve74.jpg)
From the function palette on the block diagram select numeric and then select add as shown in the figure below,
![state machine labview state machine labview](https://www.yottavolt.com/wp-content/uploads/2019/09/State_machine.png)
At the end of the tutorial you are provided with an exercise to do it by yourself, and in the next tutorials I will assume that you have done those exercises and I will not explain the concept regarding them It will first ask you to enter two digits you want to use as operators, after that you will have to select the operation and the VI will return the output the operation applied to the operands you entered. In simple words I will guide you to design a simple calculator that will allow you to add, subtract, multiply and divide two numbers. In this tutorial I will guide you to design a VI that will help you to do simple mathematical operations.