06-15-2009 02:22 PM
I have a LabVIEW 8.6 VI that I would like to build into an executable. This code includes several PXI drivers for motion control and power supply control. I have a hardware simulation mode built into the code that will allow me to run the front panel regardless of whether the software is running with hardware or not. There are case structures around each of the hardware driver VIs in the software. If I am running the code normally, the cases with the hardware driver VIs will be called and they will operate the connected hardware. If I am running the code in hardware simulation mode, the cases with VIs that fake hardware will be called. All of this works as I intended. The problem comes when I try to build the code into an executable and distribute it to people who I know don't have the hardware, and probably don't even have LabVIEW installed. The problem is that these people will have to install the NI runtime support (which I am perfectly fine with) but they will also have to install the drivers for the hardware that they don't have.
I am wondering if I were to change the case structures to conditional disable structures and disable the drivers, would that code still be included in the executable and require someone to install unused drivers to run the simulated code?
06-16-2009 01:52 AM
Hi Eric C,
i'm not sure if you can solve it with a conditional disable stucture, but you can use dynamic calls of your drivers. All your code is still in the exe, but it would only be loaded if you need it. The difference to a case structure is, that your drivers are only in memory if you really need it, but with a case structure they will always be in memory.
Hope it helps.
Mike
06-16-2009 05:23 AM
Hi Eric C,
Good Morning and I hope your well today.
Thanks for your interesting post!
I would like to highlight one aspect of the help file, " ..Has one or more subdiagrams, exactly one of which LabVIEW uses for the duration of execution,..". To me, this suggests at run time only one case will be valid. Thus, I don't believe this will act as you wish. Secondly, I am under the impression that this can't be used in an executable (compiled form - I got an error 1 when trying to). This maybe because the exe can't decide what case to use. Due to the above, I feel we should look at this issue from a different angle.
To make it clearer, once the code is deployed there is no longer the conditional structure OR the code in the other frames. (There are however if your making a source distribution).
I am guessing your driver would be calling third party dlls, and the exe will load these at the beginning. So this is likely to generate the browse window is the driver isn't installed. In your documentation you could include that this means you need to install the driver. If your user was then to run the code you could use a case structure and test that the file has been created by the installer for the driver (I.e. no install directory no driver). This would then prevent the end user running the application without the driver.
Thus, if you feel its not ideal the customer sees the browse window then you could run the installer for the driver at the end of the NI installer, which you could include when you distribute your application.
Please let me know your thoughts,
06-16-2009 11:04 AM
04-09-2010 01:26 PM
Hi Hillman,
According to this thread, what you say should not work. I tested on LV2009SP1, and SubVIs included in disabled conditional subdiagrams get included in my executable, which is not the expected behaviour (I checked that they are not called anywhere else, of course)
Best
Charles