LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call by reference: in built executable

Hello wire workers,

I have a little problem that I cannot seem to work around (yet I know I have done so in the past).

I am using a call by reference node, with a ref control on the front panel to get the type. All works fine in the IDE, however when building into an executable, I can see that on my front panel the specific VI for the reference has changed into the default VI icon, and then this causes the open to fail with error code 1003 (VI is not executable), I suppose this is due to the incompatible connector pane?

I have tried to attach a picture to this post, however I have never had much luck with them showing up correctly (Firefox problem??)

For info, I am using LV7.1

Does anyone have any ideas how to make the reference permanent? As mentioned I am sure I have done this in the past (using LV 7.0), am I doing something stupid?

I have tried various methods including using a constant reference on the block diagram.

Any ideas would be most appreciated.

ps: off topic, well done to Dennis for his 10k posts!

0 Kudos
Message 1 of 4
(3,370 Views)
ok, some more investigation...

I made a very simple main VI and called VI to simulate the problem, and everything works fine!

I think the VI I am trying to call cannot locate all of its sub VIs, (this would explain the not executable message...).

stay tuned!

0 Kudos
Message 2 of 4
(3,362 Views)

Hello,

I am having a similar problem dynamically calling a subVI from an executable. The executable I am using is slightly different than the one in the original post for this thread, so I will describe my application and any other information that I've been able to gather.

I use a 1D string array to store the names for several subVIs which may be dynamically called by the executable. When I compile the project, I manually specify for the subVIs to be "Always Included" in the "Source Files" page, and the main application is the only specified "Startup VI". I've simplified the main application to the point that it selects the subVI from the string array, opens a VI reference, then closes the reference and ends the program. There are four subVIs in the list: the first three are all relatively large VIs intended for the final version, and the fourth is a simple template containing only the inputs and outputs corresponding to the type specifier (no other code to execute).

The error I receive is 1003 when I try to open the VI reference, however the conditions for this error are somewhat strange. Here is a list of several of the symptoms:

1) The first time the EXE is opened and run, any of the four subVIs can be dynamically opened and closed successfully.

2) After the first subVI is opened/closed, none of the first three subVIs can be opened again without receiving the 1003 error.

3) The fourth subVI (simple test) never fails to open and close the reference.

4) If I delete the wire connecting the type specifier to the "Open VI Reference" node, I no longer receive any errors. This is interesting for testing, but in the final version I need the type specifier in order to run the subVIs.

5) After the first time the error is received, none of the first three subVIs will load in subsequent runs until I close the executable and launch it again.

Here is some other information which may be helpful:

1) I am running LabVIEW 8.5

2) I checked that all connector panes match the type specifier (of course, if there had been such an error then the guilty subVI should never load properly).

3) All of the associated VIs are executable (not broken) when opened individually. As an additional check, I used Ctrl-Shift-Run Button to force the VIs to compile and received no warnings or errors.

4) I verified that none of the subVIs are making their own dynamic calls, although I don't think that should affect this problem anyway.

5) Similar to the post from nrp, the type specifier appears correctly in the IDE, but uses the default VI icon in the executable

 

There is one more interesting piece of information which I would also like to have clarified if possible. It seems that the dynamic subVI call will work identically for two VI paths. For example:

C:\Compile_Test\Compile_Test.exe\sub.vi

and

C:\Compile_Test\data\sub.vi

are both successful when trying to dynamically load the subVI "sub.vi" from within the executable "Compile_Test.exe". For this test the subVI is "Always Included" in the build instructions.

I would really appreciate any help that can be given with this problem. I used to be able to run this code with no errors, and now I am wondering what accidental/careless change I must have made to destroy the functionality.

0 Kudos
Message 3 of 4
(3,195 Views)

If the following does not resolve the issue for you, please start a new thread for this and then put ina  link to this particular thread (this means people will be able to see a new request).

Thanks for the detailed message, this is very strange behaviour indeed. From your post I gather you are calling the VI's with absolute paths rather than relative paths? Do any of the VI's share subVI's? I think this could be the problem. It sounds to me like one of your subVI's is letting go correctly, i.e. a refererence isn't being released correctly, and hence the new subVI is un runnable. Do you have a debug license on your system so you can connect to the exe and run the exe highlighter throughout the call of the first VI called dynamically? you could then check to see if there's a particular subVI which is causing the problem. You could then try disabling subVI's which you think may be the problem.

I realise this is a rather tedioius resolution, but it's got to be a subVI in those first 3 if the 4th, 'simple VI', always opens.

Keep me posted


Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
Message 4 of 4
(3,128 Views)