04-13-2010 01:43 PM
JeffL,
If Conditional Disable structures can be evaluated at run-time, then I can understand why subvis therein have to be included in a distribution. I thought the Conditional Disable was evaluated at compile time. In that case, it makes no sense to include sub-vis. I was trying to do the second. I guess for source running within LV, the first must be the case. But when you build an .exe, why include sub-vi's from non-executable Cond Disables? Aren't the conditions fixed by the Project? Or are there conditions (which I obviously haven't tried using) that can be determined at run time? For example, the OS is going to be targeted at run time. If there were a Conditional Disable based on OS, why include sub-vi's for other platforms?
Perhaps we need another option in the Cond Disable, so that we can choose NOT to include sub-vi's during a build if they are inside a disabled Cond Disable. This is the use case I was specifically trying to hit. I want to make the build smaller if the target has no NI Daq devices. Including the entire call chain for NI Daq blows up the build tremendously. Also, if those sub-vi's are included in the build of an .exe, but the NI Daq driver (or some other dll used by the disabled sub-vi's) is not present on a machine that tries to use the code, will the VI be broken or not?
DaveT
04-14-2010 02:46 AM
I think the assumption is that if you're doing a source distribution then the source will be worked with. Thus, it's quite feasible that the current setting for the conditional disable will change and NOT including the DAQmx files will break the code at that point.
I can understand the logic of including the files when saving as source sidtribution. Maybe we need an additional saving method? Source code sSnapshot where only the current conditional diables are used?
Shane.
04-14-2010 10:23 AM
04-14-2010 03:48 PM
And because it's a DIFFERENT use case, there should be a different option for it I reckon. Want to suggest it on the idea exchange?
Shane
04-16-2010 10:50 AM
Put it on Idea Exchange and I'll vote for it :).
I tested it myself and it works as expected (copies the DAQmx files but runs fine on a system without DAQmx). Let me know if you guys are still having problems with it not running.
04-16-2010 01:44 PM
Let me share my use case
We have a large app whose some class that have with mathscript structure inside, built into an exe. The exe doesn't use the structs, and loading these structs causes the "Matlab command window" open when the exe is launched. That's annoying an raises questions for the non-tech user, so
— "OK, put them SubVIs, pat cond disable around the subVIs calls, and build with the right condition variable"
In this case, the VIs are still included, and the matlab command still raises.
— "Ah, so I have to load them dynamically? but they are in a conditional disable!!"
That's right
I finally ended up by programmatically modifying the lvclass in my build script, that removes the VI's before building, and restores them. Uh.
04-16-2010 02:24 PM
>If you build a source distribution with conditional disable around VIs, the VIs will be pulled into the source distribution. That is what is expected.
>When you get to your machine without the DAQmx driver installed (thus breaking the included VIs), as long as they're still inside the conditional disable it should still run (and be able to be built into an EXE). If it's not letting you, then that is unexpected. I will confirm the error is occuring.
Jeff,
There is one significant difference between what I describe doing and what you say will work. You say that after the distribution is created, the VI's will run because the broken VI's are still inside the conditional disable, and that they can still be built into an executable. Based on your second phrase, it is implied that your first phrase means that they will run inside LabVIEW. That I don't doubt.
What I am doing is calling the source code from the distribution dynamically from an executable that was already built. This is a plug-in for an existing program. Perhaps this is the difference that prevents it from working in my case.
Furthermore, it worked in a previous version of LV. Apparently the behavior has changed...
Dave
04-19-2010 10:42 AM
Dave,
My tests were
a) running it in LabVIEW without DAQmx installed
b) running as an EXE without DAQmx installed
Both ran fine without error.
Dave, to clarify your use case, you're leaving the 'plug-ins' in VI form and calling it from a built EXE dynamically? And the conditional disable is in the plug-in VIs?
04-19-2010 10:58 AM
Jeff,
Yes, that is correct.
DaveT
04-20-2010 03:52 PM
Is this the error you are seeing, Dave?