Jump to content

Get calling node on the BD of the superVI


mzu

Recommended Posts

I am working on a tiny debugging tool. Say, we have a 2 vis, A.vi and B.vi. A.vi calls B.vi in multiple places on the BD. B.vi is being executed now. I would like to get the reference to the node on the block diagram of A.vi of a particular B.vi being executed right now (It may be paused, or just running). Same way as we  get clickable "stack trace" drop-down list on a breakpoint. How can I accomplish it?

 

A.vi BD:

post-2886-0-87864300-1369783596.png

 

1. If B.vi is reentrant, I could have used clone #. But if B.vi is not reentrant?

2. I can easily get an array of nodes of type "subVI" on A.vi BD. But the node does not have any property to show it's state (reserved, running, idle, bad etc).

3. Each VIRef of each subVI node has different numerical value. However, I was not able to find a VI property that would give me the distinction between a running VI and a reserved one.

4. I enabled supersecretprivate key in the ini file, but still no methods/properties I can use.

Link to comment

Thanks, Todd, no solution there.  :( Voted up Jim's suggestion, though.

May be I can do without determining the state of the node, if I can somehow get a reference to the exact node, that called my subVI.

Edited by mzu
Link to comment

mzu: There's a behind-the-scenes feature that I added a long while back for vugie that might help you here, if you don't mind turning on execution highlighting on the caller.

http://lavag.org/topic/9281-new-config-tokens-in-8-6-to-help-you-tap-into-exec-hilighting/

You could use the info about where exec highlighting has gotten to identify which nodes have already executed. Not what you're looking for, but perhaps useful?

 

You could also add a custom probe on caller diagrams for any diagram that has multiple calls to the same subVI. The custom probe could announce that it has executed. For non-reentrant subVIs, this would let you distinguish which one was executing unless they both tried to run at the exact same time (both probes would trip but you wouldn't know which one won the race for the mutex). For reentrant VIs, that wouldn't help because they could both go ahead and execute. [unless I'm wrong about the reference from a subVI node for reentrant VIs in previous paragraph, in which case the probes would solve the non-reentrant case and the reference comparison would solve the reentrant case.]

 

 

3. Each VIRef of each subVI node has different numerical value. However, I was not able to find a VI property that would give me the distinction between a running VI and a reserved one.

 

Just because you have different numbers, they all refer to the same VI. The different numbers are just independent references to the same object, no different than opening multiple references to the same named queue. I think you'll even get the same VI from a node for reentrant subVIs -- they'll all refer to the real VI from which the clones are made -- but you'll have to check my memory on that.

 

4. I enabled supersecretprivate key in the ini file, but still no methods/properties I can use.

 

I can't think of anything that will give you that information.

Link to comment

AQ, Thank you for the reply,

enabling the highlighting tool is not a problem, and if nothing else works I will resort to that. If we talk probe scripting then I can script some code inside (and outside) of each of B.vi which will pass the unique ID to each of the B.vis. But those solutions look like hacks and workarounds to me.

 

What I am actually looking at is the kind of functionality that the breakpoint provides. I mean, let us modify the code for B.vi as follows:

post-2886-0-74045100-1369988130_thumb.pn

Now it will stop when B.vi is called the second time. I go to the "stack trace" menu on the top:

post-2886-0-59743600-1369988453_thumb.pn

 

and the LabVIEW highlights the exact node out of 3 B.vi nodes where the breakpoint occured: the second one:

post-2886-0-91423600-1369988626.png

 

How is it done inside of the LabVIEW, and is there any easy scripting way to get an access to this functionality?

Link to comment
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.