LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subvi execution issue after building .exe

Solved!
Go to solution

Hi all,

 

I've seen a lot related to this topic but haven't found anything specific to my situation.

 

I built a simple wrapper to launch different subvi's depending on if it is saturday or not.

 

The vi works perfectly fine as a vi in LV2012. But when I build the application, both cases execute-that is, both subvi front panels appear and i get a message warning me that I can't run multiple instances of the same subvi.

 

I expect it to execute either the true or false case and open the correct subvi once and be done with it. Not sure why both cases try to execute more than once only after I build the application. Ideas?

0 Kudos
Message 1 of 9
(2,884 Views)

We probably would need to see more of the code.

0 Kudos
Message 2 of 9
(2,863 Views)
To begin with, you will never get a TRUE (Sat) output because you wired 3 to the offset input of the String Subset function. It should be wired to the length input.
edit: I also suppose your system is outputting the date in this format Fri, Jan 21, 1994 When abbreviated (2) is selected (mine is not outputting this format).

Ben64
0 Kudos
Message 3 of 9
(2,857 Views)

That's all of the code for the wrapper part. Literally just saturday detection.

 

This is one of the subvi's. The subvi in the other case is identical except for a different front panel background image and different table/cluster dimensions. I made the controls visible so you can see whats going on. Mind the unfinished front panel layout 🙂

0 Kudos
Message 4 of 9
(2,849 Views)

Good catch on the length/offset. Oops.

 

And you are correct, that's how the date is being outputted on my system

0 Kudos
Message 5 of 9
(2,845 Views)

@ben64 wrote:
To begin with, you will never get a TRUE (Sat) output because you wired 3 to the offset input of the String Subset function. It should be wired to the length input.

None of this can explain the observed behavior, mo matter how buggy the comparison is. 😉  Only one of the cases will execute. It is never possible that "both cases execute" as described.

 

What is the exact error message? Can you attach the full toplevel VI? What else is in there?

Once you build an application, the toplevel VI will run when opened, of course. Is this handled correctly in the code?

Can you attach the full project, including the build specs?

0 Kudos
Message 6 of 9
(2,824 Views)

This is the sequence when I run the build:

 

-The message pops up "A subVI is already running. You cannont run this VI until the subVI stops."

-I press OK

-I find the front panel of the subVI from the false case behind the warning message.

-I find the front panel of the subVI from the true case behind the subVI from the false case.

-On the bottom, I find the wrapper (main) VI sitting there with a broken run arrow. If I click the broken arrow, I get the same "A subVI is already running. You cannont run this VI until the subVI stops." message

 

If I run as a VI before the build, it works fine again.

 

I can't include the entire project as-is, but I will extract the vi's, duplicate the issue in a sample project, and post it tomorrow.

 

Thanks!

0 Kudos
Message 7 of 9
(2,811 Views)
Solution
Accepted by topic author Rdnfs2012

I figured it out when I went to go back and create a sample project to upload for you (which worked fine).

 

Turned out to be an error I made in the original build specification. I had accidently included the vi's in the case structure as startup source files. They opened on execution, then one tried to open again as a result of the code which wasn't allowed due to restricting re-entrant execution, thus giving me the warning.

 

I've remedied the issue in further builds by resolving to drink more coffee beforehand.

 

Thanks for the support!

0 Kudos
Message 8 of 9
(2,764 Views)

I am glad there was an easy explanation to the problem. Makes sense. 😉

0 Kudos
Message 9 of 9
(2,743 Views)