02-24-2016 06:17 PM - edited 02-24-2016 06:19 PM
Hi All,
I need help with a simple problem I cant figure out.
When I create a Xcontrol "run" button and use it with other buttons not xcontrols type using a event my front panel locks up.
If I run the vi from the "errow" run icon on the far left of my vi my clear and stop buttons do what they are supposed do. But if I click on just the "run" button I am not able to control the clear or stop buttons. New to Labview
02-25-2016 01:08 AM - edited 02-25-2016 01:09 AM
Your code makes very little sense.
Can you attach the actual Vi (and subVIs etc) instead of oversize picture? Thanks.
Which button are you actually pressing?
Where did you get the X-control and did you read the entire thread where you got it?
Using an xcontrol to run a Vi is pretty pointless.
What is the purpose of the inner while loop?
What's in the other events?
What's in the other case of the case structure?
Why did you attach a huge empty window of mspaint? Please crop all screenshots to relevant information.
02-25-2016 03:11 PM
Which button are you actually pressing? Two different ways I am running the vi: One way is that I just push the "run" buttonfrom the top menu, and the random waveform starts running and out-putting 5 waveforms. Then I push the "clear" button to clear the waveforms. Then last I push the "stop" button. Everything works. The other way I run this vi is that I push the "run" square green button first this time, and the vi runs, but the "clear" or "stop" buttons are not working now.
Where did you get the X-control and did you read the entire thread where you got it? I created it from the new vi Xcontrol menu.
Using an xcontrol to run a Vi is pretty pointless. So how do i get the vi to run by pushing the right arrow button on the left top part of screen and then the Green button to run the vi? And then be able to clear the waveform and stop the vi.
What is the purpose of the inner while loop? The vi wont run without it I think.
What's in the other events?The stop and clear buttons.
What's in the other case of the case structure? Just the "True" case the other case is empty.
I have attached the vi.
Note: I been learning by myself, so all my coding is bad to say the least. Do you know anybody that can teach me labview and good coding practice? I will pay for the tutoring. Do you have time to tutor me? I can't seem to find a good labview coder that has the time to help me. I have been learning labview for some time now and not getting any better. Just getting good at bad coding or unexplained coding as long as it works I guess. Not very happy with my progress. Been learing labview for about 2 years but not making good progress. Any advice would be appreciated.
02-25-2016 03:35 PM
Buy Peter Blume's book "The LabVIEW Style Book". Read it from cover to cover. Read it again. Start using what you (should have) learned and begin by completely rewriting every single VI and LabVIEW Project you've written. Did you create an icon for every VI? Do all of your VIs fit on a single screen? Are all of your VIs documented?
Following these steps (and re-reading Peter's book a third time) will definitely improve your LabVIEW coding skills.
Bob Schor
P.S. -- does this sound easy? It's not, but you Get Out what you Put In ...
02-25-2016 04:25 PM - edited 02-25-2016 04:34 PM
@orginal-iceman wrote:What is the purpose of the inner while loop? The vi wont run without it I think.
What's in the other events?The stop and clear buttons.
What's in the other case of the case structure? Just the "True" case the other case is empty.
You can delete the inner while loop without change in functionality. (Don't think, just try! :D)
You are running three different wait is parallel, so the longest one will win.
All you probably need is place the chart in the timeout case, set the timeout to 100, and place the history clear in the clear event (see image), saimilr for the otehr events. Keep it simple!
As for the x-control, this is pretty pointless. A completed program should either be closed or running. Edit mode is not a useful state for the end user. Create an idle state if you need to pause. Set it to run when opened.
And no, I have not investigated why the buttons don't work in your example if started this way. They do work in my old dumb proof of concept example, even if I use an event structure for the stop button.
02-25-2016 04:30 PM - edited 02-25-2016 04:33 PM
wrong window, ignore please
02-25-2016 05:53 PM
Thank you Bob, I will get the book.
Thanks again.
The orginal iceman
02-25-2016 05:55 PM
Thanks Knight I will give it try.
02-25-2016 06:56 PM
@orginal-iceman wrote:Thank you Bob, I will get the book.
Thanks again.
The orginal iceman
Man, that was my bible in the early days. Even though it is somewhat dated, just about everything in there is still very relevant. (Which is probably why it hasn't been updated regularly.)
02-26-2016 11:16 AM
Hi Knight,
I modified my code per your instructions and I placed the waveform code in the time out event. It looks much better and professional, but the "run" button next to the waveform chart is not working.
I wanted to be able to push the "run" icon next to the waveform so that it will start the vi only. In many codes I see that a operator selects the right arrow icon left side of window to run the vi, then the "run" button next to the waveform is the one that actually starts the program. Maybe I am confused on the way the the vi should run when a user runs this program.
Thanks again for any advice.
The Original Iceman