Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Labview establishes virtual instrument to realize calculator function. The realization of addition, subtraction, multiplication and division can best explain the problem.
Labview establishes virtual instrument to realize calculator function. The realization of addition, subtraction, multiplication and division can best explain the problem.
This is the front panel. The calculation is the value 1 (operation) and the value 2, such as the value 1- the value 2.

Change the operation control through the pointer slider. You can set it in the-> Properties-> Text tab. Each operation has a number, which can drive the background selection structure to select the operation. Don't forget to change the numeric type to integer, which is also set in the property. Just change it to u8 or i8.

The program block diagram is as follows:

As mentioned earlier, operation switching is realized by selecting the block diagram, and different operations are placed in each conditional branch.

Add a while loop externally, otherwise it will be re-run every time the input or operation changes. Waiting for 100ms is to reduce CPU utilization.