LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i conditionally execute code dependig to the LabVIEW Version (number and / or Type(Base,FD,prof))

I want to selectively change functionality depending on the LabVIEW Version (Base,FD,Prof).

How can i get the Version at runtime into a conditional disable structure?

0 Kudos
Message 1 of 12
(3,617 Views)

The App.InstalledPackage property returns a value representing the information you seek, however, this is a private property. You will need to use a case structure with this property as the selector, not a disable diagram structure. There may be a way to determine this with a different property. I won't tell you how to expose private properties beacuse I think NI frowns upon sharing this information (at least on this board [hint]).

 

 

0 Kudos
Message 2 of 12
(3,611 Views)

My image attachment was messed up and i couldn't find an edit button.

0 Kudos
Message 3 of 12
(3,607 Views)

Because it was already revealed in this forum, I recall by using 'SuperSecretPrivateSpecialStuff=True' in LabVIEW.ini, you could have access to method : App.License where your information is provided.

 

Moderators, don't hesitate to delete this post if needed.

0 Kudos
Message 4 of 12
(3,596 Views)

Thanks a lot for this Informations.

The Problem is, that i want to downgrade a VI if there is no FD or Prof Installed.

I use some Math VI´s that shall not be linked if the Version is Base.

This is only possible with the disable Structure, not programmatically because the VI is not executable then.

 

 

0 Kudos
Message 5 of 12
(3,588 Views)

Perhaps an extrem soluce but you could try to extract used function, make dll with your call of unsupported routine. It's long, tiring, delicate, non evolutive but perhaps helped.

 

No more soluce, sorry.

0 Kudos
Message 6 of 12
(3,574 Views)

You also could call (or not call) them via VI Server. This way you won't need different executables (or distributions) for the Types and you won't get it broken...

 

Felix 

Message 7 of 12
(3,565 Views)
Since you don't want code to be compiled based on installed package, like you said  a case structure won't work. It seems like in LV2009 you can only set conditional disable diagrams based on a combination of platform type (windows/embedded/etc.), proccessor bitness (32 bit / 64 bit) and run time engine (dev environment/executable), so conditional disable structure is out of the picture. The only solution I can think of would be to use a disable diagram structure, but this would only work if we could change what case is enabled at run-time. Does anyone know if there is a scripting property/method to change the enabled case of a disable diagram structure?
0 Kudos
Message 8 of 12
(3,564 Views)
Message Edité par J.DECHET le 01-22-2010 03:19 PM
0 Kudos
Message 9 of 12
(3,556 Views)
The solution Felix suggested, calling a VI by reference, is probably your best bet.  If you make the front panels of the VIs identical, you can use an Invoke node and your execution time will be just barely effected.  You will want to load the VI during your initialization sequence.  I used this method extensively back when I was trying to support both Traditional DAQ and DAQmx instruments in the same application.  It works well.
0 Kudos
Message 10 of 12
(3,554 Views)