LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: when I open a path a subvi doesn't fnd a file no more

Dear members,

 

I have the following problem:  I have a sub-vi (a call library node) which initialize a certain device  which needs in Input the name of a specific file (Note not the path of the file just a small name like "file1"). During the execution the main vi then Open or create a path (with the express VI File Dialog) . The initialization of the device occurs before the File dialog in the Block diagram.

At the first run of the program everything goes well. Then after a stop and a restart of the VI an error occurs which declares that is no possible to find the specific file.

I have checked: If I exclude the "File dialog " VI no errors appears.  Additionally if I place the file in the directory I choose with the File Dialog I become other errors but the file can be found anyway.

It is like when I have closed the application and I restart it , it restarts from the location I have chosen with the file dialog, and the sub-vi starts to search the file in the start directory.

Could someone give me an hint how to solve this problem?

 

Many thanks

 

principiant

0 Kudos
Message 1 of 5
(2,325 Views)

Hi Principiant

 

Attach your vi so that can help you much better.

---
Silver_Shaper | CLD
0 Kudos
Message 2 of 5
(2,317 Views)

Just a quick shot in the dark, but are you using a file path control to select the file?  I  You may need to set the file path as default.  t would be helpful if you could attach your VI.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 3 of 5
(2,307 Views)

Hello and sorry for the dealy I was on a trip andI have forgotten to reply.

I attach here a model of my VI. As I said the first time it runs it finds everything.

Then I stop and re-satrt and he find the file filename no more.

The responsible is 100% the File Dialog since without it I cabn run everytime I want without problems.

My question is how to reset the path of the VI after the first run.

 

Thanks

 

Principiant

0 Kudos
Message 4 of 5
(2,281 Views)

Unfortunately, you did not include the subVI, or provide details on how it works. You said it uses a CLFN. To do what? Based on your description of the problem it sounds like the issue is inside that subVI.

 

Also, do not create paths using string functions. That's what the Build Path function is for. Also, do not hard-code directory paths. Always use a file path control so the program can run from other accounts and other computers. 

0 Kudos
Message 5 of 5
(2,271 Views)