03-19-2009 02:26 PM
Look and run vt92's example. Your's will not work because you are constantly writing to the locals. His will because the of the event structure and the left and right are only changed when the master changes. I don't know what other help you need since you've gotten a way that works. You just have to replace the property nodes with locals and set the left and right to match the master instead of adding to the current value.
03-19-2009 02:45 PM - edited 03-19-2009 02:52 PM
03-19-2009 02:55 PM
03-19-2009 03:05 PM
Actually im using a book " Labview for Everyone...." by Jeffery Travis and Jim Kring. This is one of the activity in it, which I've to do accordingly. Here is the actual lines from the book.(its my bad that i've lost the CD somewher which include the solution)
.......In many applications, you may want some type of "master" control that modifies the values on other controls. Suppose you wanted a simple panel to control your home stereo volumes. The computer presumably is connected to the stereo volume control in some way. In the VI shown next, a simulated sound control panel has three slide controls: left channel, right channel, and master. The left and right channel can be set independently; moving the master slide needs to increment or decrement the left and right volumes proportionally.
Build the block diagram for the front panel shown in Figure 13.15. The fun part about this is that by moving the master slide, you should be able to watch the other two slides move in response....... You will need to use shift registers for this exercise.
Figure is actually the block diagram of my posted VI.
03-19-2009 03:11 PM
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-19-2009 03:18 PM
03-19-2009 03:20 PM
03-19-2009 03:23 PM
Some tips:
1... Nobody will do your homework for you.
2... If you can't use an event structure, you will have to use a "change-detector" which is how we did it before Events came along. A change detector puts the current value of a control into the right-side shift reg every time thru the loop. It also compares the new value with the old value (from the left-side shift reg.). If they're the same, you do nothing (except wait). If they're different, you react to the change.
3... You don't want to write continuously to a local variable - that leaves it unable to respond to user clicks/dragging/whatever. You want to write to a local only when you need to - i.e., only when something has changed.
4... That means your general philosophy has to be:
HTH
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-19-2009 04:56 PM - edited 03-19-2009 04:56 PM
Dennis Knutson wrote:
Your first post (or your second) does not mention shift registers.
Even the title says: "Local variable exercise problem" 😉
I'm one of those who believe that most people should not code using Locals simply because they will abuse them and cause more problem with the code than expected..
I think everyone is asking for you to describe how you want to tackle this, which may mean to step away from the exercise so that you can learn about better approaches to resolve this. In other words, how do you see the software doing this task of adjusting the volume based on different controls.
R
08-19-2012 08:15 PM
Here's the solution