12-07-2018 04:44 PM
I have cleaned up what I have. Now how do I limit the increment and/or decrement so that it does not go below zero or above four? The way I have it written it will achieve 5 or -1 and then it won't increment or decrement any longer. So if it increments up to five and then my level increases, it will not decrement the number of pumps needed anymore.
12-07-2018 05:30 PM
You still have several major program errors.
1. Your initial while loop will either run one time or run infinitely. The Call for Vacuum control gets read a single time at the beginning of the program. If false, your while loop runs a single time. If true, it will run forever and the only way to stop your program is to abort it.
2. In the case structures after your loop, you are comparing values with the numbers 1, 2, 3, 4. But those values are floating point numbers. You can't guarantee that 1 will equal 1 exactly. Only rely on integers when comparing for equality
3. Your case structures look like they should be running in parallel code. But they are dependent on the output of the while loop. And as we established in point 1, that will run once, or you'll never get to the case structures because you'll have to abort the program to stop the while loops.
12-07-2018 05:49 PM
I don't think there is much I can do about relying on the output of the while loop. I have changed the pump positions to bytes. I don't really understand why the while loop would only run once or run infinitely. How does the toggle switch differ from a boolean stop button?
12-07-2018 06:31 PM
Your terminal is outside the while loop. It is read once. That value is passed into the loop. The loop executes all the code in the while loop. Because the terminal is not inside the while loop, it isn't read again.
Turn on highlight execution and watch how the code runs.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
12-07-2018 06:59 PM
Okay, it is all starting to make a little bit more sense now. I still have not found a good way to increment the hour timer and put it back into the array to be sorted. Thank you guys for the help so far. I told you it was a mess!
12-07-2018 07:03 PM
The array wire should go to a shift register. Use replace array subset to replace elements in the array. Or use Build Array to build back up from scratch.
12-07-2018 07:13 PM - edited 12-07-2018 07:43 PM
So I increment a float in another case structure within the while loop, and use that to replace the array subset?
I tried that in the attached file but it is not putting the incremented hour back into the unsorted array.
12-07-2018 08:21 PM
I got it working the way I want it to. Thanks again for all of the help!