An interesting telnet IP issue
Kenny
Posts: 209
I recently needed to control a device via IP.
I programmed the usual IP_Client_Open(3,'192.168.14.181,54774,1), downloaded and waited for the port to come online. Everything seemed fine.
Via telnet I sent the properly formatted string which I double/quadruple checked but nothing worked.
2 hours later I decided to add the send_string to code and send it via a normal Button_Event.
SUCCESS!!!
It seems that you can not send strings out ethernet when those strings come from a telnet client.
Hope this helps someone else
Kenny
I programmed the usual IP_Client_Open(3,'192.168.14.181,54774,1), downloaded and waited for the port to come online. Everything seemed fine.
Via telnet I sent the properly formatted string which I double/quadruple checked but nothing worked.
2 hours later I decided to add the send_string to code and send it via a normal Button_Event.
SUCCESS!!!
It seems that you can not send strings out ethernet when those strings come from a telnet client.
Hope this helps someone else
Kenny
0
Comments
Not sure I understand. I have code that sends strings to telnet clients without issue.
Paul
send_string dvIP_Client,'Some Damned String'
and it doesn't work.
If you have an rs232 port and connect to the master via telnet and type:
send_string dvRS232Port,'Some Damned String'
you get 'Some Damned String' out the RS232 port. Not so with an IP Client port.
I have tried using 0:3:0 and also just the port number without the D or S.
This is only an issue during development and debug. It works fine when sent from code.
Perhaps for IP devices (I haven't verified), but you definitely can use device names from Telnet for other devices.
Could you use a third party program like Hyperterminal to test strings and such? Might be less work if that's all you need to do. It sounds like you've isolated a short-fall of NS telnet? I have only used it for communications to masters and have not had any issues to date. Pretty convenient actually (thanks AMX).
I could use telnet and send strings out a serial port.
I was able to telnet into the IP device to be controlled and that worked fine.
The way that I knew it was only was by turning a relay ON when I got an online notification. It turned the relay off when the port was closed.
When you connect to the master via telnet and try to do a Send_String to an IP port from the command prompt, in essence it?s the same thing as trying to do a Send_String to an IP port with Control A Device via Netlinx studio. We aren?t allowed to do this. I?m not sure why we?re crippled this way, maybe it?s a security thing?
I?ve done something like the following in the past.
I turn debugging on and then I drop cTest and nSendIt into watch variables. When I want to send a string I modify cTest as needed and then set nSendIt to 1.
It?s only a few lines of code and you don?t have to bother with setting up button events and then emulating them just to fire off test strings.
What I ussually find is that it boils down to proper formatting of the command. Couple of examples are:
Icluding a "GET " if your device uses GET posts.
Or adding a needed <CR><LF> or what ever your device wants. I've seen several combinations includeing <LF><LF>, <CR><CR> as well.
Once you define your device and open the port via normal methods you should be able to enter something like this from Telnet:
SEND S dvDEV_NAME,"'SOME COMMAND',13,10"
Thanks, that's very good to know; I've been dealing with a similar issue. My only question is "why doesn't Tech Support know this?"
.