10-30-2009 09:39 PM
Hi guys,
I have this problem.
I'm planning to plot X and Y movements onto a XY plot.
My concerns:
1. Have individual boolean buttons to operate the running of a number.
(I have the individual buttons but I cant seem to keep the number running)
(Meaning, once i click the button the the number starts running till i let go, den it stops at whatever value it is at)
2. The data is not shown in the XY graph.
PLs do advice.
Thks N Rdgs
Titano
Solved! Go to Solution.
10-30-2009 11:21 PM
You describe a couple issues, but don't know if they are actually caused by the several problems I see with your code. So I can't answer your points #1 and 2. All I can do is point out the problems that are caused by not understanding the way data flows through a LabVIEW block diagram.
1. You have two separate event structures within a while loop. The problem is that only one will run at a time. The loop won't iterate again until the other event structure has a chance to run.
2. You have buttons outside of the while loop. They are only read once at the beginning of the program. They should be located inside the appropriate event structure so that when they can be read and actually reset.
3. What are you doing with the For loop? Why do you have it iterating 5 times to feed X Y pairs to the graph.
4. You are using local variables. You almost certainly have a race condition that is compounded by the problems with the duplicate event structures in parallel with the For loop.
5. Several of your event cases Lock front panel until the Event completes. That in conjunciton with #1 causes your program to lock up. You hit a button, the front panel locks up until that event completes. But that event can't complete until you hit a different button to allow the other event structure that is waiting to execute and allow the loop iteration to finish. But you can't hit the button needed because the front panel is locked. A regular catch-22.
See the attached VI for a much simpler version that actually works.
10-30-2009 11:30 PM
Hi Raven,
Thanks for the huge enlightenment. I've got a better understanding.
Back to my point 1,
The current situation is , I press a button and release, the number increases or decreases accordingly.
My concern is, I want the number to run as long as I hold onto the button(Only for the increase and decrease buttons).
Once I release, it should stay at the current value.
How can this be done?
And 1 more thing.
Can the increment and decrement be done in smaller denominations like 0.001?
Pls do advice
Thanks and Regards
Titano
10-30-2009 11:51 PM
Then what you want is the mechanical action, switch until released. I think an architecture where the buttons are polled would be easier to work with in this case. For .001, then you just have to add or subtract .001.
See attached.
10-31-2009 12:13 AM
Hi Raven,
Thanks alot. I didnt know the operation can be done this way too.
Actually, I'm simulating a needle's movements in X, Y and Z axis.
I kind of simulated it in 3D but the movements seem to be revolving around the centre point.
How do I simulate it to move left or right, up or down and not by revolving around the centre.
Please pardon me for my ignorance. I'm very new to LabVIEW. Trying to learn as much as possible to my very best.
Please do advise.
Thanks and Regards
Titano
10-31-2009 01:06 AM
Hi Raven,
I have another query. Is there an icon to select different delay timings?
My concern;
I want to have a list of 5 different delay timings.
So when I choose a particular delay timing and press my any-increase or any decrease button,
the point in the XY graph moves accordingly to the delay timing.
I searched but could not find one to suit the need.
Please do advise.
Thks and Regards
Titano
10-31-2009 01:18 PM
I don't know anything about the 3-D plot controls. So I can't help much there. It looks like you are basically drawing a line from 0,0,0 to whatever your defined point is. So you just need to write your code so that the starting point is also dependent on your X, Y, Z controls.
For the speed question, you can use a ring control and assign different values for each of the items you enter. Then wire the ring control into the VI in place of the .001 constant.
10-31-2009 03:44 PM
Titano wrote:Hi Raven,
I have another query. Is there an icon to select different delay timings?
My concern;
I want to have a list of 5 different delay timings.
So when I choose a particular delay timing and press my any-increase or any decrease button,
the point in the XY graph moves accordingly to the delay timing.
I searched but could not find one to suit the need.
Please do advise.
Thks and Regards
Titano
You are already being helped with this issue in your other thread. PLEASE STOP POSTING THE SAME QUESTIONS OVER MULTIPLE THREADS.