01-15-2010 10:54 AM
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
01-15-2010 11:39 PM
01-17-2010 02:56 AM
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.
01-17-2010 07:17 AM
The Obtain Queue function has an output called: Created New? which will is true the first time it's obtained.
Felix
01-18-2010 08:22 AM
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.
01-18-2010 06:27 PM
01-18-2010 07:08 PM
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
01-19-2010 01:21 AM
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.