It’s very simple to use the Ethernet to communicate instead of the serial line. The only think is need to do, it’s to change the FName in the Sysfopen function, defining TCPSKT instead of COMx.
After opening the TCP/IP connection it’s necessary to define the socket options by using the SysSktListen FB. For more information please refer to the SlimLine system IEC61131-3 programming Manual, you can download it from the download section at the bottom of the SlimLine CPU web page.
Here you can see the printout and the source code of a new program called EthDIOManage, the only differences between this and the previous is in the Communication ladder program.
How you can see this program accepts a TCP/IP connection on port 1000 (You can change the port on the SysSktListen FB). When inputs change theirs status it is sent over the TCP connection, when a command is received from the TCP connection the outputs are managed according it.
To test the program, it’s necessary simply to open a TCP/IP client connection on port 1000, to do this you can use any Telnet client for example our Toolly utility. Here a screenshot with the program test report using Toolly.