05-04-2020 12:31 AM
I'm trying to create a LabVIEW calculator using OK buttons instead of using increment/decrement buttons. I'm trying to avoid using the Event Structure. Is there any suggestions anyone has to get me started?
05-03-2020 10:54 PM
Hi all,
I'm pretty new to LabVIEW and I'm having trouble figuring out how to store the data entered into the display. Below I attached what I have so far. For example, for case 1 I am trying to have the display show a 1 and store that value. Any ideas?
05-04-2020 12:33 AM
05-04-2020 07:40 AM
First, use Block Diagram cleanup to clean up those wires.
Second, make sure you have something going to those tunnels in every case of the case structure. That might be nothing but a wire passing a value through unchanged. Right not your VI is not executable because of the unwired tunnels.
05-04-2020 02:47 PM
Thanks for your input. I fixed it a bit, but when I run the program the numbers do not display. Although, if I press 1+1 then the equal sign then I hit the STOP button, it will display a 2. It doesn't seem to work for any other operator though.
05-04-2020 02:51 PM - edited 05-04-2020 03:02 PM
Hi yesyes,
@yesyes123 wrote:
but when I run the program the numbers do not display. … then I hit the STOP button, it will display a 2.
THINK DATAFLOW! is the basic principle of LabVIEW: your "string" indicator will only show data when the loop has finished…
Also you can invert the loop stop condition so you don't need this extra NOT operation.
Why is the constant wired to the timing function orange, when the function expects a blue U32 datatype?
You also allow only one-digit numbers as you overwrite previous values in the shift register(s): simple/cheap calculators usually allow upto 10 digits…
Using an event structure would allow much easier code…
Button "2" and "3" are exchanged in your cluster (see its element order!), so your case structure will give wrong results for those 2 inputs. Even worse: those buttons are labelled incorrectly, but the code does the required operation. So your code documentation is bad! Again: an event structure would allow for much easier code…
@yesyes123 wrote:
It doesn't seem to work for any other operator though.
Because you don't parse those inputs correctly as far as I can see in your code. Addition only works because it is set as default operation…