{"id":10201,"date":"2020-09-03T17:37:33","date_gmt":"2020-09-03T17:37:33","guid":{"rendered":"https:\/\/cyflexdoc.wpengine.com\/?page_id=10201"},"modified":"2025-11-07T12:51:17","modified_gmt":"2025-11-07T17:51:17","slug":"modbus_srvr_tcp","status":"publish","type":"page","link":"https:\/\/cyflex.com\/index.php\/usage-help-manual\/14-i-o-systems\/modbus_srvr_tcp\/","title":{"rendered":"modbus_srvr_tcp"},"content":{"rendered":"<div>\n<h3>Purpose:<\/h3>\n<p>Initialize and run a Modbus TCP server to handle communication with Modbus slave devices, including parsing arguments for device connections and options.<\/p>\n<\/div>\n<h3>Enter:<\/h3>\n<dl>\n<dd>\n<p><strong>modbus_srvr_tcp<\/strong>\u00a0&lt;priority&gt; [interface &#8230;] [de] [aid] [aod] [did] [dod] [dis] [ais] [dos] [noerr]<\/p>\n<\/dd>\n<\/dl>\n<h3>Where:<\/h3>\n<dl>\n<dd>\n<div>\n<table style=\"width: 89.1184%; height: 616px;\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col \/>\n<col \/><\/colgroup>\n<tbody>\n<tr style=\"height: 55px;\">\n<td style=\"width: 9.1954%; height: 55px;\">\n<p>priority<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 55px;\">\n<p>Specify an integer to indicate the priority level of the task.\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 55px;\">\n<td style=\"width: 9.1954%; height: 55px;\">\n<p>interface<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 55px;\">\n<p>Optional. Specify strings in the format IP:port:endian for each device to connect to.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 55px;\">\n<td style=\"width: 9.1954%; height: 55px;\">\n<p>de<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 55px;\">\n<p>Optional. Specify this option to enable general debug output.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 45px;\">\n<td style=\"width: 9.1954%; height: 45px;\">\n<p>aid<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 45px;\">\n<p>Optional. Specify this option to enable Analog Input debug output.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 55px;\">\n<td style=\"width: 9.1954%; height: 55px;\">\n<p>aod<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 55px;\">\n<p>Optional. Specify this option to enable Analog Output debug output.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 55px;\">\n<td style=\"width: 9.1954%; height: 55px;\">\n<p>did<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 55px;\">\n<p>Optional. Specify this option to enable Digital Input debug output.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 55px;\">\n<td style=\"width: 9.1954%; height: 55px;\">\n<p>dod<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 55px;\">\n<p>Optional. Specify this option to enable Digital Output debug output.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 55px;\">\n<td style=\"width: 9.1954%; height: 55px;\">\n<p>dis<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 55px;\">\n<p>Optional. Specify this option to enable single coil and discrete register reads.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 54px;\">\n<td style=\"width: 9.1954%; height: 54px;\">\n<p>ais<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 54px;\">\n<p>Optional. Specify this option to enable single input and holding register reads.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 74px;\">\n<td style=\"width: 9.1954%; height: 74px;\">\n<p>dos<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 74px;\">\n<p>Optional. Specify this option to enable single coil register writes.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 58px;\">\n<td style=\"width: 9.1954%; height: 58px;\">\n<p>noerr<\/p>\n<\/td>\n<td style=\"width: 98.3424%; height: 58px;\">\n<p>Optional. Specify this option to\u00a0prevent certain errors from triggering restarts.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/dd>\n<\/dl>\n<h3>Example:<\/h3>\n<dl>\n<dd>\n<p><strong>modbus_srvr_tcp<\/strong> 24 127.0.0.1:34567:l &amp;<\/p>\n<p>The preceding communicates with a device at IP 127.0.0.1, port 34567, and uses little endian.<\/p>\n<p><strong>modbus_srvr_tcp<\/strong> 24 127.0.0.1:34567:l 10.0.0.1:502:b &amp;<\/p>\n<p>The preceding communicates with 2 interfaces. The first is a device at IP 127.0.0.1, port 34567, and uses little endian. The second interface is a device at IP 10.0.0.1, port 502, and uses big endian.<\/p>\n<\/dd>\n<\/dl>\n<dl>\n<dd>\n<p><strong>modbus_srvr_tcp<\/strong> 24 127.0.0.1:34567:l 10.0.0.1:502:b dis ais &amp;<\/p>\n<p>The preceding communicates with 2 interfaces. The first is a device at IP 127.0.0.1, port 34567, and uses little endian. The second interface is a device at IP 10.0.0.1, port 502, and uses big endian. The task will read all registers one at a time.<\/p>\n<\/dd>\n<\/dl>\n<dl>\n<dd>\n<p><strong>modbus_srvr_tcp<\/strong> 24 127.0.0.1:34567:l 10.0.0.1:502:b dis ais noerr &amp;<\/p>\n<p>The preceding communicates with 2 interfaces. The first is a device at IP 127.0.0.1, port 34567, and uses little endian. The second interface is a device at IP 10.0.0.1, port 502, and uses big endian. The task will read all registers one at a time. This will also not have some errors cause the task to re-connect.\u00a0<\/p>\n<\/dd>\n<\/dl>\n<h3>Notes:<\/h3>\n<dl>\n<dd>\n<p>The &#8216;ais&#8217; and &#8216;dis&#8217; options may slow down the task by reading registers individually instead of in batches.<\/p>\n<\/dd>\n<\/dl>\n<h3>See Also:<\/h3>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/cyflex.com\/index.php\/usage-help-manual\/14-i-o-systems\/gmodbus\/\">gmodbus,<\/a> <a href=\"\/wp-content\/uploads\/GModBus-Device-Driver-Setup.pdf\">GModBus Setup<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Purpose: Initialize and run a Modbus TCP server to handle communication with Modbus slave devices, including parsing arguments for device connections and options. Enter: modbus_srvr_tcp\u00a0&lt;priority&gt; [interface &#8230;] [de] [aid] [aod] [did] [dod] [dis] [ais] [dos] [noerr] Where: priority Specify an integer to indicate the priority level of the task.\u00a0 interface Optional. Specify strings in the [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"parent":1964,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10201","page","type-page","status-publish","hentry"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/10201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/comments?post=10201"}],"version-history":[{"count":0,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/10201\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/1964"}],"wp:attachment":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/media?parent=10201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}