{"id":3578,"date":"2026-11-19T13:46:18","date_gmt":"2026-11-19T05:46:18","guid":{"rendered":"https:\/\/resource.fatek.com\/index.php\/2026\/11\/19\/socket-function-quick-start\/"},"modified":"2026-11-24T11:03:39","modified_gmt":"2026-11-24T03:03:39","slug":"socket-function-quick-start","status":"publish","type":"post","link":"https:\/\/resource.fatek.com\/index.php\/2026\/11\/19\/socket-function-quick-start\/","title":{"rendered":"[MPLC] Socket Function Quick Start"},"content":{"rendered":"<h2 class=\"wp-block-heading\">Summary<\/h2>\n<p class=\"wp-block-paragraph\">This document explains how to set up TCP\/UDP Socket<br \/>communication on an MPLC through the Ethernet port,<br \/>with command examples.<\/p>\n<p class=\"wp-block-paragraph\">The example uses two MPLCs (one Client and one Server)<br \/>to build two-way Socket communication. After start-up,<br \/>the Client sends data first. Each side waits 2 seconds<br \/>after receiving, then sends the data back (a \u201chandshake<br \/>reply\u201d). They keep exchanging the internal real-time clock<br \/>values (minutes and seconds). After 10 transfers, the<br \/>Socket connection closes automatically.<\/p>\n<h3 class=\"wp-block-heading\">Version<\/h3>\n<p class=\"wp-block-paragraph\">PLC\ufe30v1.0.58<br \/>UperLogic\ufe30v1.0.17<\/p>\n<h3 class=\"wp-block-heading\">Sample Project<\/h3>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/file.fatek.com\/M_PLC\/Project\/Socket-Project.zip\">https:\/\/file.fatek.com\/M_PLC\/Project\/Socket-Project.zip<\/a><\/p>\n<h2 class=\"wp-block-heading\">How to Run the Example<\/h2>\n<ol class=\"wp-block-list\">\n<li>Before testing, download the \u201cSocket-Server\u201d and \u201cSocket-Client\u201d<br \/>projects to the two MPLCs.<\/li>\n<li>On both MPLCs, set register D200 to the decimal value 3.<\/li>\n<\/ol>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"388\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/image-64.png\" alt=\"\" class=\"wp-image-912\"><\/figure>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"388\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/image-66.png\" alt=\"\" class=\"wp-image-914\"><\/figure>\n<p class=\"wp-block-paragraph\">\n<p class=\"wp-block-paragraph\">First trigger M0 in the \u201cSocket-Server\u201d project, then trigger M0 in the \u201cSocket-Client\u201d project.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"918\" height=\"424\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/image-69.png\" alt=\"\" class=\"wp-image-917\"><\/figure>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"916\" height=\"424\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/image-71.png\" alt=\"\" class=\"wp-image-919\"><\/figure>\n<p class=\"wp-block-paragraph\">\n<p class=\"wp-block-paragraph\">After you trigger M0 on both MPLCs, the Client sends data first. Each side waits 2 seconds after receiving, then sends the data back (a \u201chandshake reply\u201d). They keep exchanging the internal RTC values (minutes and seconds). After 10 transfers, the Socket connection closes automatically.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"667\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-145853.png\" alt=\"\" class=\"wp-image-928\"><\/figure>\n<p class=\"wp-block-paragraph\">Set the Socket settings in the communication settings of both projects.<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"625\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-19-142946.png\" alt=\"\" class=\"wp-image-1044\"><\/figure>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"558\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-150518.png\" alt=\"\" class=\"wp-image-1045\"><\/figure>\n<h2 class=\"wp-block-heading\">Program Execution Flowchart<\/h2>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"641\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-150610.png\" alt=\"\" class=\"wp-image-929\"><\/figure>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"647\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-150621.png\" alt=\"\" class=\"wp-image-930\"><\/figure>\n<p class=\"wp-block-paragraph\">\n<h2 class=\"wp-block-heading\">Socket Function<\/h2>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-150400.png\" alt=\"\" class=\"wp-image-931\"><\/figure>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"592\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-153037.png\" alt=\"\" class=\"wp-image-941\"><\/figure>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"593\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-153045.png\" alt=\"\" class=\"wp-image-942\"><\/figure>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"590\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-153052.png\" alt=\"\" class=\"wp-image-943\"><\/figure>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"591\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/2026\/11\/E89EA2E5B995E693B7E58F96E795ABE99DA2-2026-11-17-153104.png\" alt=\"\" class=\"wp-image-945\"><\/figure>\n<p class=\"wp-block-paragraph\">\n","protected":false},"excerpt":{"rendered":"<p>Summary This document explains how to set up TCP\/UDP So [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[78,77,79],"class_list":["post-3578","post","type-post","status-publish","format-standard","hentry","category-kb-m-plc","tag-communication","tag-mplc","tag-quick-start"],"_links":{"self":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts\/3578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/comments?post=3578"}],"version-history":[{"count":1,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts\/3578\/revisions"}],"predecessor-version":[{"id":3744,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts\/3578\/revisions\/3744"}],"wp:attachment":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/media?parent=3578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/categories?post=3578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/tags?post=3578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}