Telnet connect using SOCKIT
vishalran
I have been trying to establish text based interface in Igor with "Zurich Instruments Lock In" through TCP/IP sockets using a telnet connection type. I found an XOP file for sockit on this forum and have placed that in my igor extension folder. However the help file does not compile for some reason so i am unable to understand the flags in commands (e.g. sockitopenconnection).
I need to setup following options, which can be seen easily seen in the Telnet client Putty.
Terminal category, Implicit CR in every LF - set
Session category, Host Name - localhost
Session category,Port - 8005
Session category, Connection type - Telnet
Does someone know if it is possible to incorporate such settings. if yes, how?
Thanks a lot for any help,
------------------------------------
Vishal
Graduate Student
Department of Physics
Uni Basel, Switzerland
Briefly:
variable sockitID
SOCKITopenconnection sockitID, "localhost", 8005, buf
//you have to add in the CRLF yourself.
SOCKITsendmsg sockitID, "mymessage" + "\r\n"
August 16, 2013 at 02:26 am - Permalink
August 16, 2013 at 02:38 am - Permalink
August 16, 2013 at 02:54 am - Permalink
I am not able to open a connection with my instrument using sockitopenconnection socketID, host, port, buf
and keep getting error in the command window "SOCKIT err: socket not connected -1"
I tried some of the examples from this forum, e.g. connect to www.example.com or www.wavemetrics.com at port 80 and these work nicely.
Since, I can access the port using Putty, this all makes me confused if there is some problem with the igor XOP settings. Does it always assume a telnet connection type for opening sockets?
thanks again
Vishal
August 16, 2013 at 04:59 am - Permalink
SOCKIT simply opens a TCP connection to the host/port of choice. http://en.wikipedia.org/wiki/Berkeley_sockets You should be able to do what you do with telnet with SOCKIT.
August 16, 2013 at 05:25 am - Permalink
August 16, 2013 at 05:33 am - Permalink
i also need to choose telnet as the connection type. it does not work for other options in putty.
thanks,
Vishal
August 16, 2013 at 06:35 am - Permalink
Possibly you have put the XOP and the help file in the Igor Extensions folder inside the Igor Pro Folder. This is the wrong place to put it. Instead put it in the Igor Extension folder inside the Igor Pro User Files folder. Then restart Igor.
For details execute:
August 16, 2013 at 07:57 am - Permalink
August 16, 2013 at 08:23 am - Permalink
hi andy,
I can connect to my instrument through Putty using "localhost" as the hostname and port number 8005. But I am still unable to communicate using igor (SOCKIT command) and keep getting error messages of unsuccessful connection.
thanks for any suggestions,
Vishal
September 2, 2013 at 02:42 am - Permalink
Note that SOCKIT is just raw TCP packets. This means it's not totally the same as telnet. Telnet also has control characters.
I recommend using a program called wireshark (http://www.wireshark.org/). This enables you to inspect all traffic on your network card. Set this program up so it just looks at the traffic going to/from this equipment with Putty. Then compare to the communication with SOCKIT. If the two aren't the same then this will tell you something. You can then alter the messages sent by sockit. I have used wireshark before and it's quite easy to use.
A.
September 2, 2013 at 04:16 am - Permalink
You can see them echoed back.
September 2, 2013 at 05:23 am - Permalink
thanks for all your help and sorry for the hassle.
cheers,
Vishal
September 2, 2013 at 06:05 am - Permalink
I've just been searching for this. It seems that on Windows 7 localhost resolves to the IPv6 address (::1) by default rather than the IPv4 one (127.0.0.1). Glad you solved your problem. I wouldn't classify that as a noob problem, but you probably should've tried 127.0.0.1 at some point.
For future information you can use the nslookup program to see what IP address a host resolves to. Try using the following from the Windows command line:
nslookup localhost
What happens?
September 2, 2013 at 05:12 pm - Permalink
it spits out the server names and addresses
name: localhost.unibas.ch
address: 127.0.0.1
September 3, 2013 at 01:05 am - Permalink