11-02-2010 10:55 AM
I've read all the posts on here regarding this topic, but can't seem to get my code to work. I have 3 tests that I want to run on demand. I have a setup VI that dynamically loads a data display window. The launched display loads data onto the graphs that were setup (you have to put in a job before hitting start in the setup VI). Everything seems to work fine, but if I didn't start the 3rd test I would like to be able to hit start again on the setup VI, but it does not respond. I can tell from the global that the status is changing, but it seems like the while timed loops will only execute once at the beginning of the launch until complete. I may be going about this whole thing completely wrong. Any and all help will be appreciated. Thank you.
11-02-2010 02:01 PM
This thing looks buggier than an ant farm, so it is not trivial to troubleshoot.
First of all, there are race conditions everywhere, for example you read the same global in parallel inside and outside event structures, so once the event structure completes, the value at the stop terminal might be stale and unexpected. LabVIEW does NOT execute left to right!
What is up with all these value properties everywhere? Why not keep things in shift registers instead?
If you would use "stop if true" for the loop termination, you would not need to invert first. All the boolean logic seem more complicated that it needs to be.
Maybe if you would clean up the race conditions, things will fall into place, maybe not. Try it!
11-02-2010 04:24 PM
altenbach,
Thanks for the advice (slap upside the head). I had gotten lost many hours before this and I just started digging making things worse. Once I started trying to simplify things, I realized I didn't need the event structures at all. Everything seems to be working exactly as I wanted now. Thank you very much.
11-03-2010 09:48 AM
Your 3rd loop will spin wildly if Data display 3 is false.
I personally prefer normal normal loops with a separate wait command instead of timed loops.
Some wiring could need some clean up, but it's definatly in the right direction!
/Y
11-03-2010 10:28 AM
Thanks. I actually posted the wrong data display VI last time. My actual result is attached here. I did add a small wait to keep the loops from spinning wildly when the individual displays are false. Thank you.
11-03-2010 10:53 AM - edited 11-03-2010 10:54 AM
Your code is still exceedingly complicated. Let's look at the code in the timed loop:
11-03-2010 03:11 PM
Thank you very much for your feedback...
I now only write the start time once
I got rid of the extra data shift register and property node
I replaced the insert into array's with build arrays
I looked into the "in place element" but I was worried I might re-over-complicate things by changing to that now.
Questions...
I've changed my first graph to an plain waveform graph. I didn't realize that was more efficient. (I guess that's not really a question, but a prompt for comment.
I was also curious about "..." and "..."
Thank you very much,
11-03-2010 04:30 PM
@asb9ab wrote:
I've changed my first graph to an plain waveform graph. I didn't realize that was more efficient. (I guess that's not really a question, but a prompt for comment.
An xy graph has at least twice as much data.
No, you changed it into a waveform chart, something entirely different. If you use a chart, you would wire the scalar random number directly. No need to keep the shift register at all because the chart has its own data buffer (which you configured for 50000 samples, a bit high for my taste). I meant a waveform graph as in the attached draft.