The attached PICED project and simulation program show how to use logic to control another device via TCP/IP sockets.