02-13-2007 09:15 PM
Hello
I am having trouble with reading OPC URL link in correct format form the System.ini file. (LabView 8.2)
I am able to read the OPC URL link from System.ini file and save it as a string, but in the OPC URL link it contain some back slash and that is where the problem start.
I have old EXE file created in LabView, which read the same OPC URL and able to communicate. I cannot provide this EXE file because it is very big.
Please take a look the System.ini file where OPC URL link are stored, and the OPC test.vi.
I try to add some extra back slash to take care of escape sequence, but I could not communicate with OPC server.
Please help me
Thank you,
02-14-2007 02:37 AM
02-14-2007 04:29 PM
Amitt:
Are the OPC url contained in the System.ini file the correct ones that you need for your application? Let me know
Rudi N.
02-14-2007 09:11 PM - edited 02-14-2007 09:11 PM
Message Edited by Ravens Fan on 02-14-2007 10:13 PM
02-15-2007 01:54 AM
What is wrong about the "read raw string (F)" boolean input that skips this entire VI?
@Ravens Fan wrote:
I think I found where your problem is occurring.I opened up the Read Key.vi. Inside of that is a Parsed Stored String.VII was able to open that up and saw it had special code for handling backslashes.(I guess someone figured there was a need to store non-printable characters in config files by saving them as backslash codes. I think this probably hurts more people than it would help.)Perhaps you could make copies of these VI's and rename them. Then edit the new version "Parsed Stored String.VI" and eliminate the special treatement of backslash characters. It is a confusing little VI, so this task may not be easy.Message Edited by Ravens Fan on 02-14-2007 10:13 PM
02-15-2007 02:16 AM
02-15-2007 07:20 AM
02-15-2007 10:18 AM
Hello Guys
Thank to Rolf, Ravens and GerdW
As Rolf point out that read raw string flag on the Read key.vi takes care of all escape sequence problem. Also do the same thing when you use the Write Key.vi. So if the Value type is String then this flag comes up, but if not careful we can easily miss that.
Here is the some more info.
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.
write raw string? specifies whether to write the string without escaping unprintable and backslash (\) characters. If FALSE (default), the VI converts any backslashes (\) to double backslashes (\\) and replaces any remaining 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.
I think this is very important point to keep in mind.
Thank you