08-13-2017 10:09 AM
Hi, I recently made a calculator. It works perfectly as far as I'm aware. (it's called Calculator Logic.vi and it's attached below).
My teacher saw it and asked me to add parentheses.
So I started working on a component that breaks down any expression into a number of "parenthesized expressions", and solves every one of them individually. This component is a key step in adding parentheses functionality to my calculator.
Now the problem is: The calculator solves the parenthesized expressions incorrectly! It solves the first one correctly, and then it's clear it keeps past values in memory and they mess up the next calculations! I couldn't find the source of it.
I know it's probably a little complicated to fix, but you guys got a better chance at it than I do.
08-13-2017 10:44 AM - edited 08-13-2017 11:56 AM
There are missing subVIs. From the symptoms, one of your missing subVIs probably has uninitialized shift registers or feedback nodes.
LabVIEW includes formula parsing VIs and the code can be inspected. Maybe it can give you some ideas.
08-13-2017 11:06 AM
On a side note, your while loop seems overly complicated. This does exactly the same thing:
(Of course this is not quite bulletproof because it does not deal correctly with mismatched or stacked parenthesis).
08-13-2017 11:57 AM
08-13-2017 12:29 PM
Okay thanks for the cleanup but I still can't solve my problem.
You said there were missing VIs so I uploaded all of them.