VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Path value from property on Linux target, bad behavior ?

Solved!
Go to solution

Hi,

In my CD, users can set an absolute path where to save files on the target.

On my configuration page, users use a Path control : they choose a folder on their own computer. The same folder hierarchy will be then created on the target at run time (99% of the time c:\logs). It is made this way to ease FTP tranfer from the target to the Host computer when the acquisition is done.

This works fine on our 9082 (PahrLaps OS). But it doesn't seem to work the same way on our Linux target (9063). Indeed, when reading the property (path type) on the target, it returns 'c:\logs' (so Windows style) instead of '/c/logs' (Linux style). Is that a bug or am I thinking wrong ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 5
(2,903 Views)
Solution
Accepted by topic author CyGa

Hi zyl7,

 

You're right, this is undesirable behavior and looks like it may be a bug. I believe this is a known issue with the way LabVIEW handles filepaths among different targets, but I'm having trouble finding a CAR number associated with it.

 

To work around this issue, you can try passing a string as opposed to a filepath. As long as the filepath is typed in the appropriate format, this should work, and there are multiple ways you could build in error checking/handling depending on the target. You could even build in a conditional statement that checks the target OS and adjusts the filepath format accordingly for Linux targets by converting the filepath to string and parsing the string to replace "\" with "/" and remove ":".

 

I know this isn't ideal, so if anyone has a better idea of how to handle this, we'd like to hear your thoughts!

Andy F.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(2,862 Views)

Hi Andy,

The problem is indeed well known (I found a couple of comments inside NI's CD which address this problem ; in some CDs, Path are sent to the targets through 'Array of String') but was supposed to be fixed since VS2012 or VS2013...

I've got a lot of Custom Devices which runs on PharLap OS that we are migrating on Linux. It will require quite a lot of work to track all Path properties in the codes and, according to the OS, modify the path to be sure it will understood... Changing the Path properties into String properties will require a lot of work and I'm not sure that, once running on the target a 'String to path' function will return the correct path...

 

Most of the up-to-date cRIOs are Linux-based, it would have been nice that VS (LV in fact...) now handles properly this kind of subject...

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 5
(2,857 Views)

 Hi zyl7,

 

I'm not surprised that you would see "C:\" on the Windows side when referencing a Linux file structure. NI Linux Real-Time should coerce "C:\" to "/C/". However it still may read it as "C:\" on the Windows end. On the target itself, is it creating a new file path C:\logs? If you FTP or WebDAV into the target and view the file structure is there only a /c/ and /C/ folders or does this create a new file path?

 

Thanks,

 

Andy M

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

The problem is that it is NOT coerced from C:/ to /c/ as expected when the path is transmitted from the configuration to the RT using a Path property. So the entire path then is considered as invalid and the files are not generated.

Using WinSCP for example works fine to search into the target HDD. But this is not the point of original message...

 

Make a test : in the 'Main page' of a custom device, add a Path-type property and fill it using a Path control. This code will be played on your computer and the path control will be filled with Windows-style path.

In your Linux target (Engine code), read the path property : it will be returned Windows-style instead of 'target-style'...

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 5 of 5
(2,831 Views)