LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

conditional disable no longer works

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

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 11 of 41
(1,864 Views)

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.

0 Kudos
Message 12 of 41
(1,848 Views)
That does indeed seem to be the logic.  And it works for that use case.  Perhaps that is the common use case.  But I am describing a very real use case that works the other way.  And I do believe I've seen other people describe this use case, though not in context with the conditional disable structure.  The basic reason for saving a source distribution where the code won't be altered is for distributing plug-in type components for a system that is built into an .exe.
-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 13 of 41
(1,830 Views)

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

0 Kudos
Message 14 of 41
(1,817 Views)

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.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 15 of 41
(1,791 Views)

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.

 

0 Kudos
Message 16 of 41
(1,784 Views)

>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

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 17 of 41
(1,769 Views)

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?

Jeff | LabVIEW Software Engineer
0 Kudos
Message 18 of 41
(1,738 Views)

Jeff,

   Yes, that is correct.

 

DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 19 of 41
(1,733 Views)

crashVI.png

 

Is this the error you are seeing, Dave?

Jeff | LabVIEW Software Engineer
0 Kudos
Message 20 of 41
(1,710 Views)