04-16-2019 10:08 PM
I have 2 while loops running. When the Boolean <Optimum Vacuum> goes true, the while loop below starts counting up a soak time.
There are conditions where <Optimum Vacuum> in the top while loop goes false. At that point, I want the lower while loop to go false and stop adding up the soak time.
The <Optimum Vacuum> variable in the bottom while loop never changes state from true to false, as it changes state in the top while loop.
How can I make that variable change state as needed?
Thank you
Solved! Go to Solution.
04-16-2019 11:18 PM
Because you are stuck in that inner while loop down below until the time finishes. (PS, it makes more sense to use >= 420 and get rid of the NOT instead of <420 and have to use the NOT)
You have difficult code here where local variables are being abused and you are locked into program logic you can't get out of. First, does this need to be two loops?
Your code should be a large state machine where you have start and stop states, and idle and check timer states to determine when to turn stuff on or off. Google NI.com for "state machine".
04-17-2019 06:18 AM - edited 04-17-2019 06:19 AM
I originally had it in a single loop, but once the seconds started counting, the original value stayed at the trigger point of 27.5. The vacuum was still increasing but all I could see is the soak time increasing.
As far as the state machine, I'm not too familiar with it.
Would you be able to show me with some sample code for either situations?
Thank you.
04-17-2019 07:32 AM
Then attach that VI so we can look at it and see where the issues are.
I can't show some sample code. I'm getting paid to create code needed for my own company's needs. I'm not getting paid to program other people's code.
04-17-2019 07:39 AM
I’m not asking you to write all my software. Just asking for a small amount of assistance. But since you are so busy, maybe you should concentrate more on writing your company’s code than trying to help out beginners here in the support forums.
Because you aren’t any help.
Thanks.
04-17-2019 07:43 AM - edited 04-17-2019 07:43 AM
Then spend time more time reading and googling and don't bother asking questions on the forum because with an attitude like that you won't get any help.
04-17-2019 07:44 AM
When you attach code (rather than a picture), we can (a) see what version of LabVIEW you are using (so we can comment appropriately) and (b) can more easily see what you have done and provide "hints" (so you can learn by fixing your own code).
Absent that, do the following:
I don't know how this "maps" into your issue, as I don't have your code to examine.
Bob Schor
04-17-2019 07:52 AM
Thank you for your help Bob. I didn’t realize how to properly post so that I can get the best help possible. I’ll remember that for the next time I need assistance. Again thank you very much.
04-17-2019 12:19 PM
@Big_Guy wrote:
Thank you for your help Bob. I didn’t realize how to properly post so that I can get the best help possible. I’ll remember that for the next time I need assistance. Again thank you very much.
If you really want to blend in, you also press that kudo button to say thanks!
Only on Bob's post I assume, although the others did honestly try to help.
Accepting a solution (if you do feel it's solved) helps keep the forum tight. Then you won't get guys like myself opening this thread to find it's actually finished (and then writing OT advice). RavensFan did mention that solution in the first post, but it's OK if you'd mark Bob's reply (or both).
04-17-2019 01:47 PM
@Big_Guy wrote:
How can I make that variable change state as needed?
It is not the variable change, but giving the code a chance to read the new value, which is currently deadlocked. It seems your problem is solved, so here are a few more tips: