Open socket comms to from PLC

taward31

Member
Join Date
Nov 2012
Location
Dublin
Posts
51
Trying to get a connection from siemens s7 1500 cpu to PC over tcp

Using hyper terminal on PC to see if connection can be established

anyone done this before or know if it can be done ?
 
You will probably be able to establish a TCP connection but then you have to use a protocol that the PLC understands, which is not easy since Siemens never made it public.
 
You can use TCON and TSEND, or TSEND_C (combined connection and send) in the S7 to connect to your PC-Program and send any data you want.

Do you really mean the Hyperterm which was in Windows XP used for modems? Or do you just have a TCP server program which starts a server and prints out the received data?
 
I wrote a S7-300 program that uses the socket blocks mentioned by Thomans_v2 but I didn't use TSEND_C. It was a pain in the @$$. Fortunately, ProfiNet came along.
The packets were UDP packets. I still had to build a header to specify the what kind of data was in the packet and where it came from or where it should go.
 
Parsing and processing the data may be complicated, even when you have to process strings and can't use SCL.

If you can develop the protocol for yourself, I'd design it so you can process it easy inside the Plc (I'd prefer a binary protocol instead of strings).

But the TCP or UDP connection itself is very easy to setup.

I've posted a simple demo for the S7-1200 some years ago, where the 1200 is the passive partner and a python script on the PC the active partner. It still works the same way inside the S7-1500. the _C blocks make it still easier now.

http://www.plctalk.net/qanda/showthread.php?p=609433#post609433
 
Parsing and processing the data may be complicated, even when you have to process strings and can't use SCL.
I was just passing floats back and forth but I did it in LAD and STL.

If you can develop the protocol for yourself, I'd design it so you can process it easy inside the Plc (I'd prefer a binary protocol instead of strings).
We did. We call it the DMCP for Delta motion control protocol. We made sure all the data was DWORD aligned and there was a file and offset for Rockwell and Datablock and offset for Siemens.

But the TCP or UDP connection itself is very easy to setup.
Yes, but that is the easy part.

I've posted a simple demo for the S7-1200 some years ago, where the 1200 is the passive partner and a python script on the PC the active partner. It still works the same way inside the S7-1500. the _C blocks make it still easier now.
We have many examples. One of them uses python but it also requires using our .net assembly, RMCLink. The problem is that only works on Windows.
I have yet to write a python sockets interface that would be non-denominational and run on anything that supports python.

The OP should get wire shark. I don't know how hyper terminal will work.
The PLC IDE should be able to show the data in the PLC and there are plenty of good debuggers for the PC.
 
Hi everyone,

Thanks for the replies, Gives me something to chew on,

I have set up open socket communications plenty of times before from S7 1500 but usually only to printers and the like.

pretty easy process.

Just when I tried to do the same thing with a laptop instead of a printer I cant seem to establish a connection.

I tried opening the laptops ports via the ''windows firewall and advanced security'' but it didnt help.

I have a customer who wants to communicate with our system over tcp. So I want to verify I can do it with my laptop so I know it can be done before they attempt etc.
 
A printer has a TCP port listening for connections, usually port 9100, that's why you can connect to it.

To connect to a PC you will also need that the port you are going to connect to be listening.
You can do it with a utility like the one already proposed, or writing and executing a program on the PC.
 

Similar Topics

I would like to communication with application installation in my printer server via TCP port 5450. i.e ., 71.16.40.200:5450 . How can i write...
Replies
1
Views
400
Hi all, Having some issues with socket connections on a 5069-L306ERMS3 guardlogix and tech support have not been able to help me so far. I'm...
Replies
2
Views
1,118
CIP Generic access to the Open Socket interface on the MicroLogix 1400 Hi guys, Looking for some help on getting 1 socket opened for a ethernet...
Replies
5
Views
5,646
Hello! I am new to PLC programming and am required to interface a Symeo radar with a CompactGuardlogix L45s PLC. The Symeo radar uses tcp/ip...
Replies
26
Views
5,658
Hello, I'm having an issue with creating a socket using a message instruction. I've attempted to copy the data structures from sample programs...
Replies
2
Views
3,809
Back
Top Bottom