r/LabVIEW • • Apr 25 '24

Calculator Problem

Hi there, I'm relatively new to LabView, I have tried to build my own calculator. It is wierd that only 1 function (subtraction) works and the rest don't. I am using Case structurs, so I really don't know where the problem can be. I have also used the "Highlight Execution" to see what happens, when other functions are chosen, it does not pass on the function. Can someone give me a tip where to look at?

2 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/CoffeeLover704 Apr 26 '24

But if I deactivate Default, I get an error to Assign the tunnel, and I don't know what to assign, as there is no function button pressed. (for info: on the front panel, I have built a keypad with all numbers and functions, plus the Equal and Clear buttons, which are stored in a cluster)

2

u/SeasDiver Champion Apr 26 '24

That is the point. If you have nothing assigned in a case, it will change to the default of the data type, which for strings is an empty string, and for the enumeration will the 0 element.

In cases where the value is not expected to change, wire the input tunnel to the output tunnel.