Isn't this the same question you posted yesterday?
Let me try again.
In LabVIEW, the order in which operations are caried out is determined by data dependency. What this means is that any piece of your diagram that requires inputs on another piece, has to wait on those pieces to finish before it can start.
A variation on this "dependancy" is that
"Any piece of code that has all of it inputs available is free to run at any time."
In your code, you pass the task ID from the inititalize and set-up tasks to your two loops. At that point, both of your loops have all of their inputs avaialable so both can and will runn at the same time. When your top loop finishes, it closes the task ID you are using to do the I/O. It is because the first loop closes this task,
that the second loop enounters the error.
If you want to keep using the same task ID for the second loop, you have to make sure the top loop does not close it before the bottom loop is done.
You can do this by putting both of your data collection loops inside a single frame sequence structure. Make sure the code that close the task ID's is outside this new seq structure.
Ben