LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file path indicator changes \ to /

Solved!
Go to solution

I have been trying to write a file path so that I can create a tdms file to write data to.

The problem is that when I start to type the path namely:

C:\Users\RMC\Documents\LabVIEW Data\0112\hello.tdms

the file path indicator adjusts it to:

/C/Users/RMC/Documents/LabVIEW Data/0112/hello.tdms (Though when copying this it changes back to the original).

I have tested this on other VIs and other projects and this does not occur.

 

My goal is to write a tdms file however it will not open the file as it says that it cannot be found (Error 7 occurred at TDMS Open in Events.vi  LabVIEW:  File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.) and this is the only reason thing I can see that is different from the other VIs. I also dont understand why it says that the file cannot be found as I have set TDMS Open to create one not open one.

 

Please help 🙂

0 Kudos
Message 1 of 9
(4,460 Views)

The path constant is a special type of string which adapts the path separator (e.g. / or \) on different operating systems and can also identify relative versus absolute paths.

 

Generally it is better to use the path functions like build path / strip path from the file I/O palette than to use strings.

 

Can you show us your code (upload the VI or take a screenshot) where you use the path so we can see what you might be doing wrong? Also, your code is under 'my computer' and not running on a different target, right?


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 9
(4,454 Views)

@Sam_Sharp wrote:

 

Can you show us your code (upload the VI or take a screenshot) ...


If the code is more than 3-4 functions, do not submit a "screenshot" (unless it is an executable LabVIEW Snippet).  The reason to post code is so that we can "try it ourselves" -- the best is a VI, as we can (a) open it in LabVIEW and run it, seeing what it does and modifying it so it "does it right", and (b) it allows us to figure out which version of LabVIEW you are using and return "fixed" code that will run on your machine.

 

Bob Schor

Message 3 of 9
(4,439 Views)

Hi there,

I am adding a screen shot of the snippet of code. I created the tdms file hello using another VI (just to test that it is possible). I am just trying to send it a simulated signal to see if it can open and write into the tmds file:

file path screenshot.png

0 Kudos
Message 4 of 9
(4,430 Views)

I have tested further and my problem only occurs when the project is open, when I create a VI in the project it does not work. If I close the project and open only the VI it works.

0 Kudos
Message 5 of 9
(4,417 Views)
0 Kudos
Message 6 of 9
(4,409 Views)
Solution
Accepted by JanelleTheron

You have the VI listed under an RT target and not 'my computer' - hence why I asked about that. It's trying to access the C:\Users\RMC......folder on the target, which doesn't exist. You need to save the file to a valid folder on the target or run the VI under 'my computer' by moving it in the project. The /C/Users format of paths is used on RT targets. When you open 'just' the VI, it always runs on your computer - you'll probably notice the path changes back to a windows path (e.g. C:\Users\RMC....).

 

Bob: I personally prefer screenshots in a lot of cases, it saves me downloading a VI, having to open it in a version of LabVIEW (I might not have installed) and quite often I can see what's up just from the picture. Of course, the ideal is both Smiley Very Happy I don't have LV2015 installed so when I downloaded the VI, I then couldn't open it - so I can't do anything to help, at least with a screenshot there's a chance I can see what's wrong just from the picture, or on my phone etc. It's just a personal preference thing I guess.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 7 of 9
(4,399 Views)

Hi Janelle,

 

your cRIO cannot access the harddrive of your PC! That's it...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(4,391 Views)

You need to think of your cRIO as another computer.  You don't expect your coworker's computer to access a file on your computer, do you?  At least not with "C:\".  Typically, you will want to make a Windows application as well that can get data from your cRIO and save the data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 9
(4,350 Views)