PJM_labview Posted September 16, 2008 Report Share Posted September 16, 2008 I am trying to make a VI that can get a class inheritance paths from a LV Object. Additionally I want the VI to be able to do the following: Run in the runtime engine Get the inheritance without loading the classes in memory I got one way of doing it right now that involve this VI (LabVIEW Root\vi.lib\Utility\LVClass\Get LV Class Path.vi) and getting the linker info of the parent classes recursively. Unfortunately this would not work when build in an exe. There is a wiki article from Stephen Mercer on the LVClass Data Storage Format but this is more about the inherited class version that the inherited class path. Has anybody already achieved this? Thanks Side Question to Stephen: Is the call to LV.exe method (LVClassPathFromInstance) in the Get LV Class Path VI implemented in the runtime engine? PJM Quote Link to comment
gb119 Posted September 16, 2008 Report Share Posted September 16, 2008 QUOTE (PJM_labview @ Sep 15 2008, 07:53 PM) I am trying to make a VI that can get a class inheritance paths from a LV Object. http://lavag.org/old_files/monthly_09_2008/post-121-1221504333.png' target="_blank"> Additionally I want the VI to be able to do the following: Run in the runtime engine Get the inheritance without loading the classes in memory Ummm, if that LV Object input is an instance of the class you want to get the inheritence tree for, don't you have to have all the parent classes in memory for the runtime dynamic dispatch to work ? The lvclass xml file does appear to contain a class genalogy property which (if one could parse the binary data) might be the key.... Quote Link to comment
Aristos Queue Posted September 16, 2008 Report Share Posted September 16, 2008 QUOTE (PJM_labview @ Sep 15 2008, 01:53 PM) Side Question to Stephen: Is the call to LV.exe method (LVClassPathFromInstance) in the Get LV Class Path VI implemented in the runtime engine? I will say this: Get LV Class Path.vi works in the run time engine. Your question about the content of that VI's a password-protected block diagram I will decline to answer. Quote Link to comment
PJM_labview Posted September 16, 2008 Author Report Share Posted September 16, 2008 QUOTE (Gavin Burnell @ Sep 15 2008, 12:54 PM) Ummm, if that LV Object input is an instance of the class you want to get the inheritence tree for, don't you have to have all the parent classes in memory ... Good point. I actually forgot I now use/need the Get Class Inheritance for lvclass file path. QUOTE (Gavin Burnell @ Sep 15 2008, 12:54 PM) The lvclass xml file does appear to contain a class genalogy property which (if one could parse the binary data) might be the key.... Ya, I noticed that too. This what actually gave me the idea to try the linker info app.method on an lvclass file. PJM Quote Link to comment
Aristos Queue Posted September 16, 2008 Report Share Posted September 16, 2008 QUOTE (Gavin Burnell @ Sep 15 2008, 02:54 PM) Ummm, if that LV Object input is an instance of the class you want to get the inheritence tree for, don't you have to have all the parent classes in memory for the runtime dynamic dispatch to work ? This is correct. You're never going to get this VI to work in any case where the class and its full ancestry are not already loaded into memory. You'll have to write something that takes a path in and gives a path out. Quote Link to comment
PJM_labview Posted September 16, 2008 Author Report Share Posted September 16, 2008 QUOTE (Aristos Queue @ Sep 15 2008, 01:57 PM) I will say this: Get LV Class Path.vi works in the run time engine. Thanks QUOTE (Aristos Queue @ Sep 15 2008, 01:57 PM) Your question about the content of that VI's a password-protected block diagram I will decline to answer. I am not sure what you mean by that (because I did not ask anything about the content of the password-protected Get LV Class Path.vi). If you infer about how I get the info about the method name, LV 8.6 hierarchy window now shows CIN/CLFN info (see image below). My question about this specific part was just about whether this work in the runtime engine. I am more interesting in finding an answer about how to get the lvclass inheritance. Thanks PJM Quote Link to comment
Aristos Queue Posted September 17, 2008 Report Share Posted September 17, 2008 Why do you want to know the inheritance? If you're working on some sort of editor tool, there are some solutions. If you're wanting something to be part of a built application or deployed VIs, I'm likely to suggest a different architecture is going to be more efficient than any type testing we come up with (even if such facilities were easily available). Quote Link to comment
Francois Normandin Posted September 17, 2008 Report Share Posted September 17, 2008 QUOTE (PJM_labview @ Sep 15 2008, 05:09 PM) I am more interesting in finding an answer about how to get the lvclass inheritance. Have you looked at this post from Darren about Inheritance hierarchy? The VI is password-protected but should work at runtime. I guess that's the output from LVClassPathFromInstance call you're looking for. I've used it to get the complete class hierarchy recursively. I don't have the result on my daytime computer, but could find it tonight. It's simply an implementation of Darren's VI with the tree control API from Norm the Captain. Quote Link to comment
PJM_labview Posted September 17, 2008 Author Report Share Posted September 17, 2008 QUOTE (Aristos Queue @ Sep 15 2008, 11:55 PM) Why do you want to know the inheritance? If you're working on some sort of editor tool, there are some solutions. If you're wanting something to be part of a built application or deployed VIs, I'm likely to suggest a different architecture is going to be more efficient than any type testing we come up with (even if such facilities were easily available). Yes, I am working on an editing tool that need inheritance information, among other things, in order to generate the configuration files used to configure the classes. At the moment, this is not critical that it work without having the class in memory (this would be nice and faster if this were possible). Ultimately the editing capabilities will be built in the executable, hence the reason I am trying to have a way of doing it in the runtime engine. QUOTE (normandinf @ Sep 16 2008, 05:26 AM) Have you looked at this post from Darren about Inheritance hierarchy? The VI is password-protected but should work at runtime. I guess that's the output from LVClassPathFromInstance call you're looking for. I've used it to get the complete class hierarchy recursively. I don't have the result on my daytime computer, but could find it tonight. It's simply an implementation of Darren's VI with the tree control API from Norm the Captain. Ah, I search LAVA before I start this thread and I did not found this post From what I see I came up with a similar solution than Darren (using the linker info). I believe that this solution does not work in the runtime engine. About, the "LVClassPathFromInstance", this was just a side question to know if the Get LV Class Path.vi work in runtime (which it does). I am looking forward to see your recursive solution. PJM Quote Link to comment
Aristos Queue Posted September 17, 2008 Report Share Posted September 17, 2008 QUOTE (PJM_labview @ Sep 16 2008, 02:56 PM) hence the reason I am trying to have a way of doing it in the runtime engine I know of no way to do this in the run time engine. You'll have to hack something together by scanning the XML. Quote Link to comment
Francois Normandin Posted September 18, 2008 Report Share Posted September 18, 2008 QUOTE (PJM_labview @ Sep 16 2008, 03:56 PM) Ah, I search LAVA before I start this thread and I did not found this post Yeah, I get that a lot too... QUOTE (PJM_labview @ Sep 16 2008, 03:56 PM) From what I see I came up with a similar solution than Darren (using the linker info). I believe that this solution does not work in the runtime engine. About, the "LVClassPathFromInstance", this was just a side question to know if the Get LV Class Path.vi work in runtime (which it does). I tried it and it does not work in EXE. (If AQ says it, I'll believe him). I wonder if you could load them dynamically at runtime, check their inheritance and then close them all? If that's possible in EXE, I bet it would be slow and not memory-effective but it would get you there... :2cents: It is not available either at runtime... QUOTE (PJM_labview @ Sep 16 2008, 03:56 PM) I am looking forward to see your recursive solution. Well here it is. This is saved in LV86. I didn't include Norm's Tree Control API vis, neither the OpenG packages I used, to keep the llb small. I'm sure you don't need them , but if someone else does, please follow the links to get them as it makes too large a file to upload. Download File:post-10515-1221609011.llb Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.