Shaun Hayward Posted April 29, 2009 Report Share Posted April 29, 2009 I have a LVOOP based plugin architecture (ie my customer can supply different drivers in the form of LLBs depending on what hardware they ship with the software)... Now, I would like to implement a method of my base class called GetDriverVersion (or something to that effect) so that my plugin-in manager can display to the user what version of a particular driver they are using (for debugging purposes / making sure the driver matches the hardware). This led me to thinking about the class version numbers - it seems to me to be logicial to use the class's built-in versioning so that I only have to set a number once and that number will also help with transitioning to new versions etc. However, I cant seem to find the property node (at least I would presume it is a property node somewhere). Am I looking in the wrong place / anybody have any ideas where this information may be hiding? (oh, and whatever method I use has to be supported in the run-time engine) Thanks, Shaun Quote Link to comment
Aristos Queue Posted April 29, 2009 Report Share Posted April 29, 2009 The property node does exist, but it doesn't work in the runtime engine. You can get the version in a very strange way... take an instance of the class and flatten it to a string. Then read this post for instructions on how to get the version number out of the flattened string. That's the only mechanism I can propose that will work in the runtime engine. QUOTE (Aristos Queue @ Apr 28 2009, 01:37 PM) That's the only mechanism I can propose that will work in the runtime engine. I thought of another option... you could read the XML file directly. The class version number is stored in plain text in the .lvclass file. Quote Link to comment
Shaun Hayward Posted April 29, 2009 Author Report Share Posted April 29, 2009 QUOTE (Aristos Queue @ Apr 28 2009, 02:38 PM) The property node does exist, but it doesn't work in the runtime engine. You can get the version in a very strange way... take an instance of the class and flatten it to a string. Then read http://forums.lavag.org/Flattened-LVOOP-Class-t11256.html&p=47637#entry47637' target="_blank">this post for instructions on how to get the version number out of the flattened string. That's the only mechanism I can propose that will work in the runtime engine. I thought of another option... you could read the XML file directly. The class version number is stored in plain text in the .lvclass file. Wow - you responded quickly - thank you very much! That seems to have got me out of a bind, and in case it helps anyone else, attached is the VI I put together (LV 8.6). Out of curiosity, do you know which method (file or flattened object data) would be faster / more efficient? (I'm thinking that it probably depends on how big the class file is vs how much data the current object is carrying around with it) 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.