LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

select instance of polymorphic vi at compile time

Solved!
Go to solution

quick question:

 

I have a fairly significant labview project that i'm deploying to several compactRIOs.  However, I have two possible configurations of that code.  The difference between the two configurations is a single VI.  That is, within my project, there's one VI that I replace with another (same connector pane) for the alternate configuration.

 

What I want to do is to make that VI into a polymorphic VI, then have the instance of that polymorphic VI be set at compile time.  That is, I would have two build specifications.  Each build specification would build a configuration of the project by having the selection of which instance of the polymorphic VI to use be included as a parameter of the build specification.  If it is possible to do, I can't seem to find the option in the build specification preferences to do so.

 

Does this make sense?  Any help is appreciated.

 

Cheers.

0 Kudos
Message 1 of 8
(3,032 Views)

Why not load the VI you want to use dynamically?

Depending on what you want to do, open a reference to the other VI, and run it

 

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 8
(3,028 Views)

Sounds like a Conditional Disable-structure to me. You should be able to set the flags from the Build-specification, though i haven't tried it much.

Basically like a ordinary Disable structure, place your two vi's in a frame each and then have the compiler enable a frame.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 8
(3,026 Views)

ABCPrograms: that's fine, i don't have a problem with the dynamic run thing, but how would the program detect which build specification it's being run from?

0 Kudos
Message 4 of 8
(3,023 Views)

yamaeda, i'm unclear about what you're suggesting.  are you suggesting that i use the VI scripting VIs to programmatically edit the VI to switch which state is enabled by using a VI that runs before building, but as part of the build process?

0 Kudos
Message 5 of 8
(3,020 Views)
Solution
Accepted by topic author Keith_W

@Keith_W wrote:

yamaeda, i'm unclear about what you're suggesting.  are you suggesting that i use the VI scripting VIs to programmatically edit the VI to switch which state is enabled by using a VI that runs before building, but as part of the build process?


The Conditional disable seems to work like a script at compile time. As you stated your problem it sounds like you wanted 2 builds anyway, and this would enable one of the conditional frames when building the exe.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 6 of 8
(3,013 Views)

I understand what you're saying now.  This looks like just what I wanted.  I'm off to go lookup how to set custom symbols.  Thanks!

0 Kudos
Message 7 of 8
(3,005 Views)

@Keith_W wrote:

I'm off to go lookup how to set custom symbols.


As far as I know, you can't do this in the UI. I believe there's an idea in the idea exchange to allow this, and you can probably also set the build to run a pre-build VI which will use VI server to set the symbol for the build. There are probably examples of this either here or in the LAVA forums.

 

 


___________________
Try to take over the world!
0 Kudos
Message 8 of 8
(2,999 Views)