08-21-2014 03:47 PM - edited 08-21-2014 03:53 PM
Hi. I'm trying to program a triangle calculator, but I can't seem to get it to work. I'm new to LabVIEW, so that kinda sets me back as I'm still learning functions. what I have so far is in the attached file. I'm thinking might be better to setup different event structures for each possible combination instead of what I have allready.
Any input is appreciated.
Regards
08-21-2014 04:16 PM - edited 08-21-2014 04:23 PM
If you want the controls to be read with every iteration of the while loop, their terminals belong inside the while loop.
You should also place a small delay (e.g. a 20ms wait) inside the loop to prevent 100% CPU use.
08-25-2014 07:04 AM
Hi Anders.
Did you try what altenbach suggests?
If that didn't help, can you then explain in more details what you are trying to achieve?
08-25-2014 08:43 AM - edited 08-25-2014 08:45 AM
Hi. I tried altenbachs solution, and that help on the loop. The code in the formula node was not correct though, and I've had quiet some trouble getting if-else statements to work. So I've made a new design, and only need to program for when you known 2 sides and 1 angle.
The program I'm trying to make is a solver for triangles. You input 3 values and the reminder is calculated.
I have attached the new Vi. It looks a bit primitive (I think) but my knowledge of advanced functions is still limited.
08-25-2014 08:57 AM
Just a quick note: avoid using local variables. Instead pass the values out of your case structures. That way you can write directly to the terminal outside of your case structure and you don't have to worry about potential race conditions. It will also make it a lot easier to read.
08-25-2014 09:13 AM
Thank you. I'll keep that in mind. I've had some trouble with open tunnels beforehand, which is why I've been using local varibles.