Post Top Ad

Tuesday, March 7, 2023

Itapes pour configurer la communication TCP



Itapes pour configurer la communication TCP

TCP/IP Communication

It is the most basic layer in TCP communication which works in the backend of any famous communication protocol namely Profinet, Modbus TCP/IP, etc.

Sometimes it is really a headache when different third-party devices need to communicate with each other and they don't support any common protocols between them then this protocol holds to be very helpful.


It can be configured in the following method.

One device acts as a TCP Client and the other device acts as TCP Server.


AT First TCP server opens a single socket port and behaves as a passive device and now this device is ready to share data once the communication handshake is done.


TCP Client requires the following data of the TCP server IP address and Port Number to initiate the connection request. Hence, the client acts as an active device.

TCP Server Configuration

I have opened port 4660 for communication and my Laptop's IP address is 192.168.0.53. With this server-side configuration is finished.

TCP Client Configuration

Make a new DB with the following settings. A DB is a database of Siemens PLC. You can store any sort of data and use it in your program if it is required.

Interface id: Hardware ID is of Siemens PLC Ethernet port can be found in the hardware setting.

ID: Connection ID

Connection Type: 11 = TCP/IP

Active Established = True [As PLC is TCP Client]

Remote Address = IP address on Server in my case laptop's IP address.

Remote Port = Port of Server

I have taken 2 string data types.


Send_Data String is to send the data to Hercules.


Rcv_Data String is to receive the data from Hercules.

Network 1: Start Connection

To initiate the connection TCON Block is used which will establish the connection.


This block does the necessary handshaking with another device, which is required as per transport layer architecture.

Network 2: Send String Data

To send data to the server. TSEND Block is used.


Write values on the DB address “TCP”. SEND_DATA and then Set the value of bit address M2.1 [Send_Data] = True to trigger the message.

Network 3: Receive String Data

To receive data TRCV block is used. Enable bit address M2.2 [Recv_Data].


It will be in listening mode whenever new data arrives it will be displayed on the DB address “TCP”.RCV_DATA.

Advantages

It is an open protocol, unlike profinet which is proprietary.

 



Itapes pour configurer la communication TCP

TCP/IP Communication

It is the most basic layer in TCP communication which works in the backend of any famous communication protocol namely Profinet, Modbus TCP/IP, etc.

Sometimes it is really a headache when different third-party devices need to communicate with each other and they don't support any common protocols between them then this protocol holds to be very helpful.


It can be configured in the following method.

One device acts as a TCP Client and the other device acts as TCP Server.


AT First TCP server opens a single socket port and behaves as a passive device and now this device is ready to share data once the communication handshake is done.


TCP Client requires the following data of the TCP server IP address and Port Number to initiate the connection request. Hence, the client acts as an active device.

TCP Server Configuration

I have opened port 4660 for communication and my Laptop's IP address is 192.168.0.53. With this server-side configuration is finished.

TCP Client Configuration

Make a new DB with the following settings. A DB is a database of Siemens PLC. You can store any sort of data and use it in your program if it is required.

Interface id: Hardware ID is of Siemens PLC Ethernet port can be found in the hardware setting.

ID: Connection ID

Connection Type: 11 = TCP/IP

Active Established = True [As PLC is TCP Client]

Remote Address = IP address on Server in my case laptop's IP address.

Remote Port = Port of Server

I have taken 2 string data types.


Send_Data String is to send the data to Hercules.


Rcv_Data String is to receive the data from Hercules.

Network 1: Start Connection

To initiate the connection TCON Block is used which will establish the connection.


This block does the necessary handshaking with another device, which is required as per transport layer architecture.

Network 2: Send String Data

To send data to the server. TSEND Block is used.


Write values on the DB address “TCP”. SEND_DATA and then Set the value of bit address M2.1 [Send_Data] = True to trigger the message.

Network 3: Receive String Data

To receive data TRCV block is used. Enable bit address M2.2 [Recv_Data].


It will be in listening mode whenever new data arrives it will be displayed on the DB address “TCP”.RCV_DATA.

Advantages

It is an open protocol, unlike profinet which is proprietary.

 

No comments:

Post a Comment

Post Top Ad

Pages