LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

triangle Calculator

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

0 Kudos
Message 1 of 6
(4,749 Views)

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.

Message 2 of 6
(4,736 Views)

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?

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 3 of 6
(4,674 Views)

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.

Download All
0 Kudos
Message 4 of 6
(4,660 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(4,651 Views)

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.

0 Kudos
Message 6 of 6
(4,639 Views)