LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ini config file refnum invalid after executable build

Hello everyone.

 

I have a subvi that uses the Open Config Data.vi, when running my application in the Development Environment everything works fine.  However once I build the application into an executable the refnum created by the Open Config Data.vi seems to become corrupt.  Checking the refnum with the Not a Config Data Refnum.vi results in a TRUE output, but only while in the Run-Time environment.

 

I added a file path indicator to the application to verify that I was giving the Open Config Data.vi the proper ini file path once I was running the application, and the file paths are correct.

 

I built a small executable containing only the Open Config Data.vi, Not a Config Data Refnum.vi and a path control.  I give this executable the same path that the problem application outputs and the refnum checks out ok.  However, the same piece of code run as a subvi inside my problem executable gives me the refnum NOT OK error.

 

Any ideas that might help me squish this little bug?

 

LabView 2011.

 

Thank you very much in advance.

 

 

0 Kudos
Message 1 of 4
(2,708 Views)

Have you checked the "Error Out" terminal from the Config File VIs when running in an executable to see if they return an error that might help you identify the problem?  Is the path constant, or is it determined programmatically?  I understand you checked that the path is correct, but be careful about this - the filesystem layout is different in an executable than when running in the development environment, and using a path relative to the calling VI's location can lead you astray if you're not careful.

0 Kudos
Message 2 of 4
(2,697 Views)

Could you show the code where you are calling the Open config vi?

 

are you closing the config file in any other part of the vi before reading it where you are getting the issue?

 

where did you place the 'Not a Renum?' funciton? immediately after the Open Config vi?

 

What is the error coming INTO the Open Config vi? It is a constant or is an error coming in from previous part of the code?

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 3 of 4
(2,689 Views)

I guess all I needed was a little nudge in the proper direction.  The problem apears to have been a result of an invoke node placed before the Open Config ini file.vi.(shared error lines) Default Values:Reinitialize All To Default Method.

 


Placing a Simple Message Handler before the ini function calls and directly after the invoke node resulted in Error 15: Serial Poll byte que overflow.  I am not sure why this error was only being created in the Run-Time Environment, and I'm also not really sure why I placed the invoke node were I did, because I do not need it there.  I deleted the invoke node, re-compiled the program, and now the ini file functions are working perfectly.

 

So, thank you for  your responses and the hints to check up stream for errors that could be causing problems farther down the line.

 

Problem solved.

 

0 Kudos
Message 4 of 4
(2,666 Views)