12-11-2018 02:48 PM
Hi experts,
I need a way to get the vi package versions (i.e, v1.0.0.20) for some of my packages. I have many classes that are derived from a single class. Each subclass is packaged into vi package (*.vip) then distributed. When we instantiate these classes, I would like to have each subclass to tell the caller what version of vi package it is.
There are several ways I can think of.. to achieve this.
Solution 1) Use Pre-Build Action VI to store the version into a global. Then reads the global to get the version.
Solution 2) Use 'Edit All VI Description' option to add {version_number} then reads it through VI property.
That being said, I really appreciate if someone can share any other way to achieve it more easily.
Thank you
Solved! Go to Solution.
12-11-2018 03:29 PM
@SKTheLimit wrote:
Solution 2) Use 'Edit All VI Description' option to add {version_number} then reads it through VI property.
That's how I do it. We have a Pre Build VI that does many things and one is edit the VI Description. I realize that pro has that option to edit VI descriptions but it is carried over from before I had pro. Anyway it edits the VI description to have the following text added to every VI, control, class, and library.
-------------
Package Information
Product Name: XXX
Package File Name: XXX
Package Version: 2.0.1.15
Minimum LabVIEW Version: 17.0
The VI description can then be ready and package versions can be pulled. If you don't like adding to the descriptions you could probably also just edit the class description.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-11-2018 04:52 PM
Thank you Hooovahh,
Glad to hear my solution is a valid one. I'll proceed with it.
While I was exploring, I found this very useful particularly for my project. I can place this code at the base class, then any subclass will be automatically benefit as soon as inheriting from it. This code will pick the object class type then reads the vi description, followed by extracting the version information. You do not have to override this VI.