It's the first time I have to send some states of pvss datapoints to an external system via a tcp/ip connection using a stream of characters in XML format.
A test master is echoing all received data to a console window.
Generally it is working, I get a connection and the data I sent is displayed at the console window.
But, it looks like I have some problems with string of different length, in some cases strange characters are displayed at the server, like >$³? and others.
I build the string like
Code: Select all
string GetXMLFBFSYSTEM(int idx)
{
string tmp1, xt;
xt = formatTime("%Y.%m.%d %H:%M:%S", gSystemeZeit[idx]); //gSystemeZeit ist a dyn_time
tmp1 = "";
return tmp1;
}
Code: Select all
sendbuffer = GetXMLFBFSYSTEM(s); //sendbuffer is a string
DebugTN(gVers + ":ThreadWriteData","INFO", sendbuffer);
rc = tcpWrite(gSocket, sendbuffer);
in PVSS log it looks like:
PVSS00ctrl20:2011.12.13 11:49:47.556["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:47.665["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:47.775["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:47.884["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:47.994["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.103["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.212["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.322["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.431["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.540["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.650["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.759["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.869["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:48.978["1.1X:ThreadWriteData"]["INFO"][""]
PVSS00ctrl20:2011.12.13 11:49:49.087["1.1X:ThreadWriteData"]["INFO"][""]
which looks like expected
the TCP server outputs:
server: [$³?]
server: [$³?]
server: []
server: []
server: []
server: []
server: []
server: []
server: []
server: []
server: []
server: [N"/>]
server: [N"/>]
server: []
server: []
which has some strange characters at the end of some lines
Anyone a idea why this happens and how I can solve the problem?