LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading an INI file to cRio and reading/writing

Solved!
Go to solution

I'm using an INI file to write/Read config data on a cRio. If I run my Vi on my development laptop, everything works fine once I specify the path. The issue I am having once I try to use the Vi on the cRio is that the file isn't deployed.

 

How do I get my INI file on to the cRio and set the path address up correctly?

0 Kudos
Message 1 of 32
(6,174 Views)
Solution
Accepted by topic author Lbee11

Hi LBee,

 

you need to include this file as "additional data" in your AppBuilder spec for the RTEXE. It will be stored in a "data" subfolder of the RTEXE filepath…

 

That's what I call in my cRIO main VI first to get the "data" folder path:

check.png

(The subVI just strips any filenames from "current VI path" and outputs a verified folder path.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 32
(6,167 Views)

I just use Application Folder and it gives the path to the folder containing the executable (or project file).  Makes that subVI obsolete.

 

As far as the in file, you can also use WebDAV or FTP to copy the file to the cRIO.


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 3 of 32
(6,146 Views)

File Snippet.png

I used the following in the end to achieve the result I needed, obviously the string is supposed to be wired!!

0 Kudos
Message 4 of 32
(6,136 Views)

Hi LBee,

 

your file path handling really looks "strange"…

Why not use StripPath/BuildPath? (It would be much more safe because of differences in filepaths between Windows and Linux/whatever might be used on your cRIO!)

And as crossrulz said: use the AppDir constant!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 32
(6,132 Views)

Plus that code will not work in a built executable.

 

Here is the VI I keep in my library for such an occasion.  It creates a path relative to the folder containing the executable.  If in the development environment, the folder of the project file is used.


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 6 of 32
(6,129 Views)

I've changed the path wiring to this:

File Snippet.png

This gives me the same result as before. If I try your setup, for some reason my Vi does not see it as a valid path when running on a cRio

0 Kudos
Message 7 of 32
(6,120 Views)

У меня такая же проблема, как вы ее решили?

0 Kudos
Message 8 of 32
(5,664 Views)

Hi Andry,

 

you should write English in this LabVIEW board.

I have the same problem as you solved it?

 

Could you attach your current VI you have problems with?

Did you store the ini file in the cRIO?

Did you check the file to be in correct folder?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 32
(5,654 Views)

Или вам нужно полностью?

 

С уважением)

0 Kudos
Message 10 of 32
(5,641 Views)