11-01-2019 08:10 AM
I've been able to control 6 seperate NI modules by having all 6 have their own queue and I put that into an array.
The issue i'm seeing is if I use index array to stop position 1 and say flush queue, it looks like it flushes the entire array of queues. Am i overlooking something?
11-01-2019 08:23 AM
You could be overlooking something. But we don't know because we can't look over your VI. When you don't attach code, we can't see what you overlooked. It is impossible to debug paragraphs.
11-01-2019 08:39 AM
attached is a snippet from my stop position code. It requests which position to stop and uses that enum control to set the index position for array. It flushes the test array queue for that individual position if its in the middle of a test.
11-01-2019 08:49 AM
And where is the code where you initialize the queues? It is possible you are reusing the same reference and/or named queue.
11-01-2019 08:49 AM
@PatrickMiller wrote:
attached is a snippet from my stop position code. It requests which position to stop and uses that enum control to set the index position for array. It flushes the test array queue for that individual position if its in the middle of a test.
I have used arrays of queues previously and had not trouble with them.
That image does not help since the problem is most likely elsewhere.
I suspect you are not keeping the queue refs in a shift register and when you stop to For loop you are loosing your refs.
Ben
11-01-2019 09:10 AM
@PatrickMiller wrote:
attached is a snippet from my stop position code. It requests which position to stop and uses that enum control to set the index position for array. It flushes the test array queue for that individual position if its in the middle of a test.
That's not code. That is a picture of code. It doesn't show everything we need to see.
11-01-2019 09:20 AM
@RavensFan wrote:
@PatrickMiller wrote:
attached is a snippet from my stop position code. It requests which position to stop and uses that enum control to set the index position for array. It flushes the test array queue for that individual position if its in the middle of a test.
That's not code. That is a picture of code. It doesn't show everything we need to see.
True.
From what little we see there is a possibility that is a FGV being used there which is as prone to a race condition as any global variable.
Ben
11-01-2019 09:33 AM
Assuming your project is developed using the LabVIEW Project file (.lvproj), compress the folder holding the Project (and most of the VIs, TypeDefs, etc. that you use) and attach the resulting ZIP file. We need to see as many pieces of this puzzle as we can to find the bug ...
Bob Schor
11-01-2019 09:49 AM
If you create named queues and have the same name, you'll in fact have 6 copies of the same queue, and then a Flush will empty it/them.
/Y
11-01-2019 09:57 AM
@Yamaeda wrote:
If you create named queues and have the same name, you'll in fact have 6 copies of the same queue, and then a Flush will empty it/them.
/Y
Nice post!
I now understand what Tim was hinting at in post #4.
Yes, some days I can be dense.
Ben