TCP Driver Non Ascii Characters Received are converted to unicode 0xfffd


I have successfully connected via the TCP Driver to Keyence Device which will return data via TCP when I send a command, I have an issue that the reply is being received, but , as the reply has any value between 0-255 in each byte i believe due to the tag type being a string it is being encoded to unicode, which is failing to convert some of the bytes an returns a 0xfffd value, this enlarges the returned data and means i cannot extract the correct values.

From research I really think I need to receive the data into a byte array which will mean using the SOCKETS library to open the port to be able to receive the raw data correctly. Unless there is anyway to get the TCP driver to provide this.

Any advice appreciated.

I have continued to search forums and found another thread related to this and confirms I need to use Scripted TCP Connection, the thread i found is below

1 Like