TCP Socket Communications Sample For CJ1W-ETN21 and Weidmüller serial to Ethernet converter

Modified on Mon, 6 Oct, 2025 at 9:19 AM

Introduction

TCP sockets can be used with the CJ1W-ETN21 unit with all CJ-series CPUs.

This can be extremely useful when interfacing CJ-series PLCs to 3rd-party equipment such as smart-cards readers, RFID controllers and serial-Ethernet converters.

With the CJ1W-ETN21, CJ-series PLCs can be programmed to handle TCP and UDP sockets as either Server or Client.

The sample that follows employs a CJ2-series PLC with a CJ1W-ETN21 acting as a TCP Client communicating with a Weidmuller IE-CS(T)-2TX-xRS232_485 serial-Ethernet converter set as a TCP Server (port 4001), which in turn connects to a CJ1W-SCU21 serial communcations unit behaving as a simple RS-232 device.

 

Details are provided in the the attached Word document and CX-Programmer project.

The "IE-CS-2TX-2RS232_485_3616.txt" file is the setup file exported from the Weidmuller converter used in this example.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article