03-30-2010 04:13 PM
This is my first foray into communicating with a Telnet server.
I am upgrading my old code to navigate the menu structure on our previous devices that used a serial port to now communicate over Ethernet using Telnet.
Since the VISA read needs to know how many bites to read my older code depended heavily on the "bites at port" vi.
Is there a similar way to do this for a Telnet connection?
Right now I have to count the Bytes and put in a number try it out, play with the values until I find something that works.
The trouble is I do not know exactly how many Bytes will be returned after entering a command because the device will "inject" error and system messages right onto the telnet port.
Solved! Go to Solution.
03-30-2010 04:33 PM
03-30-2010 04:47 PM
Another option that I have used in the past is based o the Simple TCP Messaging Library. Basicly it sends a fixed message style where the first 4 bytes define the size of the message, the next 2 bytes are the message ID, and the remaining bytes are the message itseft.
I have found it schema very useful when the message size is unknown at code time or if the message size changes during operation.
03-30-2010 04:56 PM
rpodsim wrote:Another option that I have used in the past is based o the Simple TCP Messaging Library. Basicly it sends a fixed message style where the first 4 bytes define the size of the message, the next 2 bytes are the message ID, and the remaining bytes are the message itseft.
I have found it schema very useful when the message size is unknown at code time or if the message size changes during operation.
If I were implementing the complete system this would be the approach that I would use or a more robust defintion of the data if necessary. I got the impression from the original post that the OP does not have control over what the sending device transmits hence my suggestions.
03-31-2010 01:42 AM