LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a 'compile time' if/else statement in LabVIEW

I have some LabVIEW software that includes subVIs to read from and write to digital IO lines. However, I need to also be able to run this software on systems which don't have an IO card (or associated drivers) installed and so I want to be able to allow the software to be on PCs that do or don't have the drivers installed.
 
Optimally, I would like to modify the software so that at runtime, by reading the settings in a configuration file, a boolean is set to determine whether the IO functions are called. I tried this but, unfortunately, am getting error messages when I try and start up the software due to the lack of the 'nidaq32.dll' file on the target PC. I'm guessing this is because the subVIs are only within case structures and so must be loaded into memory regardless of whether they are to be used.
 
Is there any way around this problem? If I were writing this in C I guess I would use '#if' statements to include/exclude the IO functions at compile time. Is there an equivalent in LabVIEW? I guess my options are:
 
1. Finding some way of allowing the IO functions to be included at runtime though I'm thinking this might not be possible.
2. Include/exclude the IO functions at compile time with some LabVIEW equivalent of the C '#if' preprocessor directive.
3. Give in and install the nidaq32.dll file with the software.
 
Just to complicate matters, I'm currently running LabVIEW 5.0.1 (I do plan to upgrade soon) so am limited to the functions available in this version.
 
Thanks.
0 Kudos
Message 1 of 4
(2,936 Views)
 
 

 


@CAS wrote:
Just to complicate matters, I'm currently running LabVIEW 5.0.1 (I do plan to upgrade soon) so am limited to the functions available in this version.

That's the main problem. 😮

On newer versions you can:

  1. define simulated devices (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x0PxCAI&l=en-US)
  2. use the conditional disable structure (see e.g.: [broken link removed], (see section 6))

Time to upgrade! 🙂

Message Edited by altenbach on 06-21-2007 07:32 AM

0 Kudos
Message 2 of 4
(2,930 Views)
A conditional Disable Structure has been added in a recent version of LV (8.0, I think). It definitely was not available in LV5. About your only option is to create two versions of your program, one with the DAQ drivers and one with homemade simulations of the drivers. I often did that in the early versions of LV.

Myabe you can accelerate the upgrade. A huge number of improvements have been made since LV5. The biggest issue in converting will be the DAQ drivers, if the original program was well written. It is worth the effort to change from NI-DAQ to DAQmx although the task is not trivial. If the original program structure is awkward or the program needs a number of modifications or enhancements in addition to the version upgrade, you may be better off writing a new program to replace the original.

Lynn
0 Kudos
Message 3 of 4
(2,927 Views)
I don't remember if 5.0 had the dynamic load functions. If it does, then you do not have to embed the DAQ VIs in the main VI and the VI will not be broken if the DAQ driver is not installed.
0 Kudos
Message 4 of 4
(2,918 Views)