From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open or create file doesn't allow creation of file

Next problem to solve is the file, some reason when I type the file name I want, it tells me that file does not exist but I have the open or create selected. The labview file handling examples are not very useful since they seem to show writing to static files. Unless there is one I've missed

 

So how would I go about making it so the user can actually type in the file he/she would want?

 

 

0 Kudos
Message 1 of 38
(4,481 Views)

From the help window:

If file path is the path to a directory that does not exist, this function returns an error. Use the Create Folder function to create a directory.

 

The OpenG toolkit also includes some handy VIs for folder creation.

 

 

What is the exact error that you are receiving? What path are you trying to use? If the path you give it is a valid path, then the file should be created.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 38
(4,473 Views)

Thanks, I'll look that up

 

Yes the folder does exist and if I place a file in the directory and choose that file it works but I can only use a file name that exists

0 Kudos
Message 3 of 38
(4,467 Views)

Is the directory write-protected?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 38
(4,465 Views)

the path is in MyDocuments and I create a file with a text editor and place it in the directory then choose that file it will write to it but I can't seem to create a new file.

 

I've tried to add another case and file detector but that still doesn't seem to solve it

0 Kudos
Message 5 of 38
(4,456 Views)

What is the exact error that you are receiving?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 38
(4,452 Views)

What is your OS? If LabView is not running as admin, try running it as admin first, then try to create again.

0 Kudos
Message 7 of 38
(4,444 Views)

Has anyone told you about the "light bulb" yet?

 

That button that looks like a light bulb will put your code in execution highlighting mode.

 

I suspect that if you put your code in light-bulb mode and then run you V and then click the Measure button....

 

You will see the event case will fie and the value of the measure button BEFORE the event fired will be passed tot he loop. That same value will be used for every iteration of the internal loop.

 

For you to be able to stop that loop, you will have to read the button INSIDE the loop to get it's current value.

 

Also note that the stop contion can be set to "Stop if true" or "Run if true" by right clicking the stop terminal.

 

And while you are in light-bulb mode, you may also notice an error if any.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 38
(4,440 Views)

Attached is a screen shot, File not found but it shouldn't need to find it because I'm telling it to create the file?

0 Kudos
Message 9 of 38
(4,438 Views)

In the background of the error message it looks like you have a "open" enum wired to the Open/create file VI. Use the hand tool to select "Open or create" and try it again.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 38
(4,434 Views)