Fixing LabVIEW bugs with VI Scripting and VI Package Manager (VIPM) Post Install
|In a environment where there’s a large user base, you may find that there’s up to 4 versions of LabVIEW in the wild and these all need to be supported. If the earliest version is 2010, the code base will need to be maintained in that version. We know that by using VI Package Manager (VIPM), the packaged code (.vip) can be deployed on a client system in the LabVIEW version being used by triggering a mass compile at the end of the installation process. This can be used to fix bugs by adding some VI scripting into the process.
In LabVIEW 2013 and above (including LabVIEW 2015 Beta 2), there’s a bug with certain user event nodes which causes wires to break when upgrading code developed in versions previous to 2013. In the scenario outlined, code developed in 2010 that’s packaged into a .vip file will be broken when deployed onto a system with LabVIEW 2013 or greater. We can resolve this by combining the VI scripting feature (introduced in LabVIEW 8.6) along with the Post Install action in VIPM.
Here’s some code that has a user event node in LabVIEW 2010:
Here’s the same code when opened in LabVIEW 2014:
While it’s possible to simply delete and rewire, we can’t ask every user to manually modify the code upon deployment. That makes for a poor user experience. Instead, we can programmatically fix this.
Below is code that uses VI scripting to search for the Generate User Event terminal, delete the broken wire, rewire, and save. Add this as part of a post install VI action that executes at the end of a VIPM package installation process to fix the broken wires. With this, you can still maintain the code base in an earlier LabVIEW version and deploy to later LabVIEW versions despite the upgrade bugs.