02-18-2020 03:50 AM
Hi,
I am trying to store data in text file with the vi shown bellow:
It seems to be working when the VI is saved on my computer but not when the VI it is saved on my cRIO (Test1/nick-Crio).
I think it has something to do with the path that i am using but i wasn't able to figure out what is wrong.
I would appreciate if you could help.
Thank you, David.
02-18-2020 04:22 AM
@DavidGikas wrote:It seems to be working when the VI is saved on my computer but not when the VI it is saved on my cRIO (Test1/nick-Crio).
Pretty sure the cRIO doesn't have a c:\users directory.
Either create that path on the cRIO (once, or from the program), or use a path that is available on the cRIO.
You can make this work for both targets with a conditional disabled structure.
@DavidGikas wrote:I think it has something to do with the path that i am using but i wasn't able to figure out what is wrong.
That is wrong.
But a lot more is wrong 🤔. The code that shows is a mess. I fear it's only a small part of the code.
Bugs hide in messy code. I'm pretty sure a lot more is wrong.
@DavidGikas wrote:It seems to be working when the VI is saved on my computer
With clear code, you would be able to say that with confidence. 😎
@DavidGikas wrote:I would appreciate if you could help.
I recommend doing (free) courses.
And straightening wires.
And a few well picked sub VIs.
I threw in some emoticons. This is me being seriously concerned and trying to help.
I know it isn't easy when starting, but at some point you will get tired of bug fixes leading into other bug fixes, and adding features will simply not be possible soon.
02-18-2020 04:45 AM
It is David again,
It wasn't allowing me to post again so i have to make another account,
Thank you for your concern,
How do add a path from my c RIO to my computer programmatically?
02-18-2020 04:56 AM
Use the Create Folder function.
02-18-2020 05:25 AM
I still cannot get the path to work.
The Vi is storing the information when save on my computer but i am not sure how to handle the path when it is saved on my cRIO.
I tried using the create folder function but cannot figure out what to use as my path.
Can you be a bit more specific please
Thank you,
David
02-18-2020 05:56 AM
If "C" exists, you can use Create Folder to create "C:\Users" to create a Users folder under "C". If you have the rights. Depending on the OS on the cRIO, it might return an error if you try that.
02-18-2020 06:09 AM
This gives me the same outcome:
No error when the program is saved on my c-RIO but i do not get anything out of it.
I am pretty sure i has to do with the path.
When the VI i saved on my c-RIO it doesn't seem to understand any of the paths because they are on my computer.
When i tried the same think with the vi saved on my computer i am getting the files and the folders.
02-18-2020 06:14 AM - edited 02-18-2020 06:15 AM
Hi skata,
@skata200 wrote:
No error when the program is saved on my c-RIO but i do not get anything out of it.
Surely there will be an error, but you don't use/check any of the error wires…
@skata200 wrote:
I am pretty sure i has to do with the path.
When the VI i saved on my c-RIO it doesn't seem to understand any of the paths because they are on my computer.
When i tried the same think with the vi saved on my computer i am getting the files and the folders.
The cRIO CANNOT ACCESS the harddrive of your computer. Point. (It's a computer on its own!)
You need to make sure to use path available to your cRIO - most probably on the "harddrive" of your cRIO!
02-18-2020 06:17 AM
Thank you that makes a lot more sense i will have a look at that.
02-18-2020
06:23 AM
- last edited on
10-09-2025
09:57 AM
by
Content Cleaner
I recommend giving this article a good read: Working with File Paths on Real-Time Targets