LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queues containing a 2D array?

Solved!
Go to solution

Hi,

 

I have taken over a program that set time stamps on neutron pulses coming from two different detectors. These time stamps are then put in a queue and if the queue contains any data these will be written to a file for later analysis. My problem is that I want to be able to determine from which detector a certain pulse came. So, I wonder if the queue could contain a 2D array where in the first column I put the times for the neutrons in the first detector and in the second column I put the times for the second detector. Is this possible?

 

If not, can I have more than one queue in the program (so that each detector has an own queue)?

 

Thanks in advance

 

Best regards,

Erika

0 Kudos
Message 1 of 6
(7,730 Views)
Solution
Accepted by ErikaN

Hi Erika,

you can use a 2D array as queue data, see the attached picture. You can also use two or more queues in your program. I would use two queues to solve it.

 

Mike

Message Edited by MikeS81 on 03-18-2009 02:09 PM
Message 2 of 6
(7,727 Views)

Hi Mike,

 

Thank you for your quick answer! Two short "follow-up" questions:

 

In the Enqueue Element can I specify in which column I want to add a value?

 

Is it faster to use two queues?

 

Regards,

Erika

0 Kudos
Message 3 of 6
(7,698 Views)

Hi Erika,

no you can't, you can only add a new 2d Array as new element. I think two queues would be faster, but the main advantage is that you can handle them independently.

 

Mike

Message Edited by MikeS81 on 03-18-2009 04:10 PM
Message 4 of 6
(7,695 Views)

MikeS81 wrote:

Hi Erika,

no you can't, you can only add a new 2d Array as new element. I think two queues would be faster, but the main advantage is that you can handle them independently.

 

Mike

Message Edited by MikeS81 on 03-18-2009 04:10 PM

My guts says the contrary since it would be double the work (but 2 X zero is still a small number Smiley Wink).

 

Two queues would introduce complications trying to figure which element from this queues goes with which element for the other queue.

 

Just my 2 cents,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 6
(7,686 Views)

ErikaN wrote:

In the Enqueue Element can I specify in which column I want to add a value?


If you simply want a 2D array in memory and replace elements, columns, rows, etc. as desired, you might want to create an action engine that contains a single 2D array in a shift register.

 

Detector 0 would write to row 0 and detector 1 to row 1, for example while the read action would read both columns.

Message Edited by altenbach on 03-18-2009 09:03 AM
Message 6 of 6
(7,669 Views)