LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array of queues

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.

 

  • I can obtain 6 queues in a For loop and output into an array
  • I can access each queue using index array and which position I need 
  • I can create a VI which iterates through each queue in a for loop and if I only want to control say position 1 and 3 then ignore 2,4,5,6 i use the timed out? boolean

 

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?

0 Kudos
Message 1 of 14
(3,679 Views)

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.

0 Kudos
Message 2 of 14
(3,665 Views)

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.

0 Kudos
Message 3 of 14
(3,648 Views)

And where is the code where you initialize the queues?  It is possible you are reusing the same reference and/or named queue.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 14
(3,640 Views)

@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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 14
(3,639 Views)

@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.

0 Kudos
Message 6 of 14
(3,623 Views)

@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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 14
(3,619 Views)

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

0 Kudos
Message 8 of 14
(3,614 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 9 of 14
(3,609 Views)

@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.

 

Spoiler

 

Yes, some days I can be dense.

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 14
(3,600 Views)