04-16-2009 04:11 AM
Solved! Go to Solution.
04-16-2009 04:17 AM
I believe you need to toggle the read raw string? boolean input. Have a look at the Read Key VI Help.
read raw string? specifies whether the string was written without escaping unprintable and backslash (\) characters. If FALSE (default), the VI replaces any unprintable characters in the string, such as <ESC>, with a backslash and two Hex characters (\xx). If TRUE, the VI does not convert the unprintable characters in the string.
04-16-2009 04:54 AM
04-16-2009 06:28 AM
Do you mean the backslash as used in a path? eg C:\Program Files\National Instruments\LabVIEW 8.6\LabVIEW.exe
I had an issue with this myself, but referring to the 'Creating Configuration Files' in LabVIEW Help
http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/creating_configuration_files/
At the bottom of the page is the following:
LabVIEW stores path data in a platform-independent format, the standard Linux format for paths, in .ini files. The VIs interpret the absolute path /c/temp/data.dat stored in a configuration settings file as follows:
The VIs interpret the relative path temp/data.dat as follows:
I know that when I wrote my ini file (in Notepad) I put in the backslashes (\). When LabVIEW read the value of the key, the backslashes (\) weren't there, and there was an error because the path (without the backslashes) wasn't recognised.
So using the example above, it would need to be /C/Program Files/National Instruments/LabVIEW 8.6/LabVIEW.exe
04-16-2009 06:43 AM - edited 04-16-2009 06:47 AM
turbot wrote:
I use default, but replaced by mass code differently each time.
Do you mean replaced by LabVIEW? If so, the Write Key function will automatically adapt to the data type you wire to the value terminal. Write Key is polymorphic, and does not display the 'Write Raw String? (F)' option unless you right click on the function and switch from automatic to string.
I've attached a VI (LabVIEW 7.0) that shows examples of different ways to write and read a path to an INI.
Open the INI created by this VI and compare the ways the data is written and read from the file...
[Backslash]
PathAsString="C:\\Documents and Settings\\pbrooks\\Desktop\\Escaped Backslashes.ini"
PathAsPath="/C/Documents and Settings/pbrooks/Desktop/Escaped Backslashes.ini"
PathAsRawString="C:\Documents and Settings\pbrooks\Desktop\Escaped Backslashes.ini"