03-17-2022 07:09 PM
I'm running an application that needs to communicate with a Lexium Servo Driver. But the issue here is that the TCP/IP Write receives a string that it can't process (or that is what it seems to happen here).
Right now I don't have access to the code, but I tried to replicate it on my computer and this is exactly what it looks like (including the error).
As you can see, the array is converted to a string which then is submitted into the TCP/IP Write, but this error appears and it doesn't send any info to my device.
Thanks in advanced!
03-17-2022 07:29 PM - edited 03-17-2022 08:13 PM
Its probably the Connection ID input parameter that is giving the error rather than the string. The Connection ID represents a reference (number) to a unique connection that exists within the OS, which you don't specify directly. You should be opening the connection first (TCP Open Connection), then the Write, then TCP Close Connection later (when you're done with the connection).
Without your actual code (and not the mock you've shown), its hard to say more.
03-18-2022 04:22 AM - edited 03-18-2022 04:22 AM
tyk007 basically nailed it although I think he was stating it a little cautiously. The network refnum constant connected to the TCP Write is NOT a valid connection but rather the canonical invalid connection. You MUST open a connection first to get a valid refnum that represents the connection to a valid existing remote connection point and then you can attempt to write something to that connection.