From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Degrees to Radians SUBVI

Hi, I am currently creating a subvi for my calculator that is suppose to convert degrees to radians. I understand the math concept but it should have 2 inputs, the number to convert and a Boolean which you do the conversion if true otherwise return the original number. I am confused as to how I wire the boolean. I also need to make an indicator on my calculator vi that can show the user if they are working in radians or degrees. Any help is appreciated.

Download All
0 Kudos
Message 1 of 2
(2,328 Views)

Your problem is more basic, for example your inner greedy loop (in calculator) possibly causes a race condition such that the code above it potentially operates on the values the controls had when the iteration started, and not when the calculate button was pressed. (could happen with a slight difference in wiring). The 1000ms wait is pointless, because the outer loop stalls after each iteration, burning  all CPU in the innermost loop doing nothing but poll the buttons as fast as the computer allows. Have a look at a simple state machine architecture.

 

I would recommend some basic tutorials before tackling the subVI problem. For that you need to know how to edit the connector pane. Are you familiar with that?

0 Kudos
Message 2 of 2
(2,319 Views)