Stepper Posted August 8, 2012 Report Share Posted August 8, 2012 Hello, I have a front panel with a Numeric Control and a group of radio buttons. When a radio button is selected, I would like the value of this numeric control to be forced to a button-specific preset value. How can this be done (in LV 8.0)? I presume that it may be somewhat similar to initializing the captions of the radio-buttons to preset values, e.g., values read-in from an external file. I found an example of how to do this, see attached (though I am not sure how it works exactly ). Of course, that initialization is only done once, not upon an event such as radio-button selection.... Thanks in advance for any help! Quote Link to comment
asbo Posted August 8, 2012 Report Share Posted August 8, 2012 If the numeric control must be /locked/ to the specific value as well, you should use the Value Change event of the radio buttons to enable/disable the numeric. Quote Link to comment
Stepper Posted August 8, 2012 Author Report Share Posted August 8, 2012 Hi Shaun, I'd love to try it, but silly me, the Numeric Controls that I can conjure up in LV8.0 don't seem to have an input, and under "properties" (advanced or other), I don't see an intuitively obvious way (to me) that wil let me add such an input. Quote Link to comment
drjdpowell Posted August 8, 2012 Report Share Posted August 8, 2012 He’s using a Property Node: Right-click>>Create>>Property Node>>Value Should exist in 8.0. You could also use a local variable (Right-click>>Create>>Local Variable) Quote Link to comment
Stepper Posted August 8, 2012 Author Report Share Posted August 8, 2012 Got it - works like a charm, exactly what I needed/wanted! Did have to change the property node from "value" to "value (Signaling)" for the icon to have an input rather than an output... You guys are great, thanks for the help! :worshippy: Quote Link to comment
Shaun Hayward Posted August 8, 2012 Report Share Posted August 8, 2012 You can change the Value from a read to a right by right clicking on the property and choosing to "Change All to Write" or "Change To Write" from the pop-up menu. However, if your literaly just setting the value, right clicking the terminal and creating a local variable instead of the value property will create a faster setup (local variables are much faster than "Value" property nodes) Quote Link to comment
Stepper Posted August 10, 2012 Author Report Share Posted August 10, 2012 OK, got to bug you guys one more time (well, at least on this particular subject ) The "set value upon radio-button change" works, but the radio-button has to be in the while-loop. This means that the preset value associated with the selected radio-button gets (re)loaded into the Numeric Control each iteration of the while-loop. This effectively overrides/overwrites any value that the user inputs directly into the Numeric Control box, or increment(decrement via the up/down buttons of the Numeric Control. Me thinks that I need to put the radio-button selector and associated value selection into an Event Structure (a new adventure for me), that only executes once upon selection of a (new) radio button. My feeble and ineffective attempt to do this is in the attached jpg. Help, please !? Quote Link to comment
asbo Posted August 10, 2012 Report Share Posted August 10, 2012 Use the event structure with a case for the Value Change event of your "VFO - Band Selection". Move the property node for "Dialo frequency input" into that same case to keep all the logic contained (even if you have multiple cases setting the value, just use individual property nodes - little more BD space, but cleaner and easier to read). Also, you may not need to use a signalling value ("Val(Sgnl)") property node for the "Dial frequency input" unless you have other code in the event structure that reacts to value changes on that control. Quote Link to comment
Stepper Posted August 11, 2012 Author Report Share Posted August 11, 2012 OK, making some progress (thank you very much), but unfortunately: win some, lose some: now the while-loop only executes once, and not again until I select a different radio button . Tricky stuff! N4SPP-miniVNA-sig-gen-V17B.vi Quote Link to comment
Ton Plomp Posted August 11, 2012 Report Share Posted August 11, 2012 Try to run your code in execution high-lighting mode. This will show that your loop will wait on the event of the menu button. You can change this by adding a timeout of 100 ms (making your loop run every 100 ms.) However I advise you to look at some training. NI has 3 and 6 hours online courses (I believe they are free), or read a book. LabVIEW for everyone is a good start. Ton Quote Link to comment
Stepper Posted August 12, 2012 Author Report Share Posted August 12, 2012 Bedankt Ton! That did the trick! As to the training: sounds like a good idea. Not that I intend to do this for aliving (yet ), but it would be a more systematic approach to becoming knowledgeable. There are soooo many properties, parameters, options...Of course, that makes it a powerful tool as well. Thanks again for all the help everyone. Frank Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.