LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unable to read datafrom txt file when build exe application file when installed on other PC

Solved!
Go to solution

Hello every one,

i developed a code that calculate servings of food , to achieve calculation must be the base values stored in a txt file. i have been trying to build an exe application using labview 2020, the code and application was built an went well on my PC, but when it installed on client PC somthing went wrong, it seems like the application can not read data from txt file or the file wasn't included in the application program. 

i have the main vi and 3 sub vis included inside the main vi notice that the txt path coded in serving_calc_with_grams.vi . the txt file and subvis is located in other folder. in other words the sub vis and txt file located in certain folder and main vi located in other folder.

i tried to locate the txt file with same folder but  the problem still exists.

 

i read the help and serched in ni site to solve this problem but i didn't find the solution.

could you help me for this?

 

anas alhraine
0 Kudos
Message 1 of 7
(1,394 Views)

Hi 2WP,

 


@ANAS_ALHRAINE wrote:

i tried to locate the txt file with same folder but  the problem still exists.

 

i read the help and serched in ni site to solve this problem but i didn't find the solution.

could you help me for this?


So there is a problem with your code but all we get is an image of the project explorer window???

 

What's the filepath you try to access?

How do you access the file?

 

There is no text file in your project: do you need to deploy that file to the other computer?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(1,384 Views)

i put the subvis and main vi "untitled" to see, the problem is the file can not deploy on other PC so , the application can not read the data that stored in it

anas alhraine
0 Kudos
Message 3 of 7
(1,380 Views)
Solution
Accepted by topic author ANAS_ALHRAINE

@ANAS_ALHRAINE wrote:

i put the subvis and main vi "untitled" to see, the problem is the file can not deploy on other PC so , the application can not read the data that stored in it


So you are saying the text file does not get deployed with the program?

 

Did you include the text file in your Build Specification as "Always Include"?

 

inc1Capture.PNG

The header files shown are automatically included in a subdirectory of the program itself.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 7
(1,337 Views)

Is the application installed on the other machine or are you just copying the exe?

Are you sure the application has permission to access that file location?

Do you get any error codes?

 

 

Overall, the code is quite fragile and has many questionable constructs:

 

  • Why is the table a control if you are exclusively using it as indicator?
  • Why is the tab control a control if you seem to exclusively operate it via extra buttons (tail wagging the dog!)
  • Your FOR loop inside "serving calc..." can be replaced by a few "add array elements". Why so many "index array" for the same array. One, resized to five inputs is enough!
  • Why all these coercion dots?
  • Why so many local variables and value property nodes?
  • Why is everything in the timeout case, e.g. recalculating the same thing on page 1 over an over, even if nothing changes?
  • etc. etc.
  • Why that bewildering collection of different connector panes?
  • Why all these formula nodes?
0 Kudos
Message 5 of 7
(1,329 Views)

I built the reference indicator on subvi to see where the path going, and then, correct the path of file where it located in same way that you have explained.

anas alhraine
0 Kudos
Message 6 of 7
(1,290 Views)

thank you for the notes you mention, i'll get it and edit my application.

the problem solved . the wrong path make it,

anas alhraine
0 Kudos
Message 7 of 7
(1,281 Views)