05-20-2020 06:53 AM - edited 05-20-2020 07:59 AM
Hi,
First of all I am big fan of G# framework and I manged to propagate this feeling to rest of my team so that we use it as standard OOP LabVIEW framework in most of our projects :).
One thing which I was never able to do properly in project is to make plugin based architecture with .lvlibp like explained in this thread:
If for example when I make top level G# class in a library and build it into lvlibp it will work.
For any derived class to be plugin oriented I need to relink dependancies to top level class from source code (.lvlib) to packed library.
Problem is relinking G# related stuff because I would need to relink it to G# objects in previously build .lvlibp for parent class.
It would be much easier if G# stuff could be in lvlib. This would enable creating .lvlibp from that lib and in my project replace dependency from lvlib to lvlibp before building packed library. With standard labVIEW classes I tried this few times and it worked fine. I tried doing this manually for G# (create library and add G# objects in it) and all I managed to do is broke IDE and make some impossible mess.
Recently on Interfaces thread: https://forums.ni.com/t5/G/LabVIEW-2020-Interfaces/gpm-p/4052262 it was mentioned that AddQ considers making new G# framework in parallel to the stable one (because of new LV features that emerged).
Question and request from my side: Since it is new source without legacy stuff, would you consider in this new version you make simple update and put all G# stuff inside lvlib by default? I suppose it was kept out of lvlib for historic reasons. I think it would make plugins with build packages doable in practice without any major downsides (I only see work on rewritting G# IDE code because of new namespace but I may be wrong).
Regards,
05-20-2020 07:52 AM
As G# fan I second all said by vuk.
Here all our code is based on G# adopting plugin architectures. We have an hardware controller Taj could roll out hardware drivers updates without updating itself. Unfortunately this is not currently possible due to the fact that G# Is not contained in a lvlipb.
Best regards and thank for your efforts
Andrea
05-20-2020 08:48 AM
Hi,
Glad to hear that you like G#. Yes. lvlib is something that we have been thinking about a lot during the years. The main reason G# is not in a lvlib, is because it was originally released in LV2009 and I do believe that lvlibs and packed libraries, didn't exist until LV2010. The problem by moving it inside a lvlib, is that we break backward compability with old code and it is not that easy to relink (at least it wasn't, haven't really tried lately). It would cause a lot of pain trying to upgrade.
In order to come arround this issue, there is an empty G#.lvlib just next to the G#Object.lvclass with a small instruction how to add it to the lvlib. It has been there for many years. However, I am not 100% sure this is included if you are using VIPM, but in the "old" installer it was included.
If lvlib had been around when G# was created, it would by sure been put inside an lvlib.
Best regards,
Mattias Ericsson
ADDQ
05-21-2020 07:52 AM
I actually followed those instructions just a few days ago to convert to lvlibp. The instructions are correct except for one thing: I believe LabVIEW messes up the linking when G# is loaded with the IDE. I think that was the reason I made a mess of my project a couple of weeks ago and ended up having some code still linking to the G#.lvlib and some linking to G# outside the lvlib even. I could be wrong and haven't had the time to try and relink everything again. But what I did this time was to make sure that G#-IDE was not loaded when I started LabVIEW. This can be done by temporary moving the file <LabVIEW>\resource\Framework\Providers\GProviders\AddQ.ini when starting LabVIEW. I haven't tried relinking a project this time but only G# so far. Wait, there could be one more thing wrong regarding the instructions/G#-install: I think I already had a G#.lvlib file, which I had to overwrite as I followed the instructions.
I have made a few attempts a couple of years ago relinking to lvlibp but that was on very large projects and it just took several hours to relink everything and I think LabVIEW even hit the memory roof then too.
What I am exploring and want to work is to not have to relink ALL projects at once, but that it would be possible to have some projects linking to the old G# and some to the new, and to have a way to move to lvlibp in a known way that does not risk messing with my environment if I make one bad click-choice. This is possible when moving to NXG. The migration API handles relinking, renaming and reconnecting VIs by just specifying it in an XML. I think that a few years ago I was expecting to soon be moving to NXG and kind of put these thoughts to rest until then. But now, moving to NXG (for me) seems to not be likely in years.
Since some LabVIEW-version (2019?) it is possible to replace lvlibp with lvlib (it only work the other way around before), and maybe since then some improvements have been made that makes it easier to relink, I dont know, but it would be interesting to explore again. I have tried automating this before, but changing namespace when relinking was impossible in reality. I don't remember now if there were crashes or that it just didn't work. But it should definetely be worth a try again on newer LabVIEW-versions.
So in short, it may not be such a pain anymore to relink old projects to lvlibp-G#, but it should be explored and at first described how to manually safely do it. And hopefully someone can automate it...
06-05-2020 07:56 AM
I'm working on a method/description of how to safely convert to G#.lvlibp on a per-project basis without affecting existing/old projects. This makes it possible to choose which projects use G#.lvlibp and when to move to G#.lvlibp per project. In short I can say that there is not much to it, except that it is easy to mess up (as I did last time).
In the meantime, I have some info regarding linking G#IDE to G#.lvlibp.
I was struggling with getting G#IDE to relink to G#.lvlibp and even though I unloaded the IDE I still had VIs linking to G#.lvclass. My guess was that some VIs were not loaded although the project was loaded and therefore were not saved. What gets loaded when a project is opened has changed over the years, so that is reasonable. What I did to make it work was to open all top-level VIs in the project at step 1 in the "G# packed library" instructions and then continue with the instructions. No need to unload the G#IDE as I thought. The top-level VIs I opened were everything under the top folder in G#IDE.lvlib, the vi in the plugins folder, the VIs directly in the G# debugger virtual folder (G#Debugger_GUI and _Start).
Hope that helps anyone struggling with that.