03-18-2009 07:58 AM
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
Solved! Go to Solution.
03-18-2009 08:06 AM - edited 03-18-2009 08:09 AM
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
03-18-2009 10:03 AM
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
03-18-2009 10:09 AM - edited 03-18-2009 10:10 AM
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
03-18-2009 10:16 AM
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
).
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
03-18-2009 11:00 AM - edited 03-18-2009 11:03 AM
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.