LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue reference genesis location

Background: 
I am running multiple vis simultaneously.  Each vi contains several queue references which are written and/or read. 
I created a debugging vi to monitor the # of elements in all of my queues.
 
Question:
Is there any way to indicate which vi obtained the first reference to a particular queue (i.e. what vi generated the initial reference).  Along the same lines is there any way to programmatically determine which vis are using particular queues?   Any thoughts?
 
Thank you,
 
-David

0 Kudos
Message 1 of 8
(3,861 Views)

hi dchip,

   Ofcourse you can know which VI is using which queue by knowing the queue reference number.Always if you create a queue automatically you can type cast the queue reference to a U32 value.That value will give the queue value.

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 8
(3,838 Views)

NI has a product called the desktop execution trace toolkit which can show you the various resources your VIs use and it probably includes that information.

 

Another option is to add a wrapper to the obtain primitive, so that every time you call it, it logs the caller (using the Call Chain primitive).

 

I wouldn't use the other method suggested, simply because it's not guaranteed to work - the 32 bit representation of the reference is an internal thing, so you can't rely on it to always increase.


___________________
Try to take over the world!
0 Kudos
Message 3 of 8
(3,829 Views)

The Obtain Queue function has an output called: Created New? which will is true the first time it's obtained.

 

Felix

0 Kudos
Message 4 of 8
(3,821 Views)

The Desktop Execution Trace Toolkit is probably the way to go to get the information you want.  It will give you a list of which VI calls what queue in what order.  It also shows which VI acquires what queue in what order.  The toolkit is available starting at LabVIEW 8.6 (earlier versions did not include the needed hooks in the LabVIEW code).

 

An alternate method is to add hooks to your code which will post timing information to another process.  In Windows, you can do this by writing to the debug output using the Windows system DLLs.  This method is described here. There are also replies which should give enough info to do this for Linux and Mac OS X users.

0 Kudos
Message 5 of 8
(3,789 Views)
when a VI creates the queue, why not create an unique queu name that not only holds the name of the queue but also the VI name that has created the queue (or any other static information you might need). If another VI reads this queue, and suddently needs to know who initiallt created the queue, you can get out the Queue name by using the "get queue status VI" on the queue reference?
0 Kudos
Message 6 of 8
(3,763 Views)

dchip wrote:

Background: 
I am running multiple vis simultaneously.  Each vi contains several queue references which are written and/or read. 
I created a debugging vi to monitor the # of elements in all of my queues.
....

 


Thank you,
 
-David


How are you getting the refs to the queues?

 

How are you handling different queue types?

 

Are after the call chain that created the queue or the exact VI with the create primative in it?

 

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 8
(3,756 Views)

Corny wrote:
why not create an unique queu name...

Because then you need to know who created the queue in order to know the queue name so you can obtain a reference. Kind of circular.
Either that, or you would need to transfer the reference around using some sort of global, which is a bad idea.

 

And if you move the creation into a subVI, you're basically back to my original suggestion of a wrapper.


___________________
Try to take over the world!
0 Kudos
Message 8 of 8
(3,737 Views)