05-07-2015 11:19 AM
@cpschnuffel wrote:
...
Is there any chance to evaluate the fully qualified name of the SubVI via the SubVI property node, so that I can build the relationship between a VI and its position?
...
I believe that the answer to this question is NO. The reason being, you are mixing VI scripting functions (really an edit-time tool) with VI Server functions (really a run-time tool). Clones are a run-time thing and do not exist in the edit-time space. Therefore when you have a VI Server reference to a VI you can get information about clones (what are the clone names of all of your SubVI's, what is your clone number, etc.), but when you have a scripting reference to a SubVI GObject the concept of a clone doesn't make sense.
After following the thread and now re-reading your original post a few times, I still do not understand what your objective is. I think that you probably aren't using the correct approach (mixing VI scripting and VI Server functions), and understanding your objective may make this clearer.
05-07-2015 01:19 PM
Hi VItan,
this earlier post explains in detail what I intend to do:
My solution at that time was using the DETT API. DETT is the link between VI and SubVI: It contains the fully qualified VI name (accessable via VI property node, unknown in SubVI property node) as well as the VI UID (vice versa). It works, but IMHO it is like using a sledgehammer to crack a nut; I'm looking for a simpler solution.
Regards,
cpschnuffel
05-07-2015 05:52 PM
Sorry, I didn't realize the nature of your requirement. I have no idea how to do what you describe, nor do I quite understand why you want/need to do this. Is there perhaps another way to accomplish your ultimate goal? Why are you doing this in Development (as opposed to Executable) mode, anyway?
BS
05-08-2015 01:00 AM
Hi Bob,
to make it short: Assume you have to create and run many different test procedures with pre-defined functions, you want to use loops, parallelisms, cases, sub-functionalities etc., AND you want to have a visualisation of the test progress ("where am I ?"). You build a VI following some rules (e.g. using a strictly defined connector pane), let it call, check and run dynamically by a main program, copy the block diagram of your VI into a picture control on the front panel and let flash (or similar) the "icon" of the VI (as part of the image) which is currently running...
Regards,
cpschnuffel
05-08-2015 07:05 AM
Aha! I've done that, but I wasn't as clever as to think of using a picture to show progress. I do agree that it is very helpful, particularly when doing initial development and debugging.
I've got my Big Complicated Routine configured as Action Engines (I used to call them State Machines, but one of my students, who had a Computer Science background, said "That's not a State Machine!!!"). The Calling routine passes a reference to a Front Panel Indicator to the sub-VI running the Action Engine. As the Action Engine runs, and calls for specific "Actions", it passes the current Action back to the caller via the Reference, where it is displayed on the Caller's Front Panel.
Instead of having a string or Enum Indicator on my caller, I could have a Picture, and could pass a reference to the Picture Indicator to my sub-VIs. Can't a sub-VI produce an image of itself? I think there's a Method (hmm, seems to be called VI Icon.Get as Image Data) that can do this. Will this do what you want?
Bob Schor
05-08-2015 12:39 PM
Hi Bob,
well, that's a nice idea. But this shows "only" the currently executed VI, not its context ("Where I am in my block diagram?"). If you use a subVI several times, you don't know which of them is currently executed.
It seems that there's nothing besides DETT that can give me the functionality I need - for the moment.
If anyone has an alternative, he is welcome.
Regards,
cpschnuffel
05-08-2015 02:40 PM
OK. I went back and read the original post, and see that you want to do this in the context of running in the LabVIEW Development Mode, with scripting enabled. I don't really have any (other) good idea how to do this, and I'm also puzzled about why to do this. If you are debugging code, I would think that there are easier ways to do this (probes, watching data flow through a Block diagram, selective log files) that don't involve the Heavy Artillery of DETT. I know that in a recent situation where code was "doing the wrong thing", I added additional data to an existing data file to enable me to see "What parameters are being set, and when", and found the problem that way.
Bob Schor
08-16-2018 04:33 AM
A bit of thread necro, sorry.
I have the same requirement. I am implementing a layered event handler (don't ask) and I want to be able to get a string of the current event frame (for debugging purposes). I can do this within a single VI, but trying to cross the VI / Sub-VI boundary as the OP describes just doesn't seem to work. If I can find the VIs on my diagram at run-time, why doesn't the scripting return callsite-specific information? I mean, the IDE knows it, if I double-click the sub-VI, it opens the clone. If I try to find the sub-VI programatically, it opens the parent.
So this is really not supported?