LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

debugging a factory pattern LVOOP plugin

A VI is an object under the hood (not LVOOP, but in LabVIEW - note the VI Server hierarchy).  While LabVIEW may load the information neccessary to "launch" or "start" or "instantiate" the VI, until that step is taken, the Code for the VI may be present in the RTE, but the data space, VI Reference and so forth is only created when the "Open VI Reference" is called.  This takes the data representing the VI in the EXE and turns it into an actual instance of the VI.

 

It's similar to the fact that a class definition and an object are not the same thing.  One is a template, the other can actually be used. It helps me, YMMV.

 

Or put another way.  Making a copy of a cake recipe and making a second cake are not the same thing.  The EXE loads the recipe when the EXE is called, but it only bakes the cake when you call "Open VI Reference" on it.

Message 31 of 34
(452 Views)

Thanks. That distinction makes sense.

But it still doesn't help us describe how the "Always Include" VI is "loaded" by Windows when the .exe is run, even though LabVIEW does not "Load" it until the Open VI Reference is called. Your front panel test showed the LV is not "Loading" these VI's. My "remove the USB drive" test shows that Windows does "load" it when the .exe is run.

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 32 of 34
(445 Views)

LV includes the recipe in the EXE.

 

Starting the EXE copies the recipe into memory.

 

Either being loaded as a dependency (where LV does all the hard work) or dynamically calling "Open VI Reference" with a path causes the recipe to create a cake.

 

If you want to make a cake, but can't find the recipe, hard luck.

 

Otherwise Bon apetit.

 

The weird part of the class loading is that baking a child requires a parent recipe.  Since the child doesn't know where the recipe is (It's being loaded from outside the EXE), it can't bake itself. That's a VERY stratched analogy but I'm getting hungry so I like it.

0 Kudos
Message 33 of 34
(441 Views)

@Dave_Thomson 

Any suggestions on how to debug further?
(The code base is huge and under NDA, so I can't share it.)

TIA,

     DaveT


Do you have a Minimal, Complete, and Verifiable Example? You should be able to recreate the issue with one main VI, a parent class with a dynamic dispatch method, and a child class that overrides that method.

 

Jason

 

0 Kudos
Message 34 of 34
(408 Views)