"# Modbus Poll\u82f1\u6587\u7248\u7528\u6237\u624b\u518c\n\n> 2023-10-13 | 2026-06-30\n> https:\/\/www.modbus.cn\/en\/25470.html\n\n**\u8c03\u8bd5\u8f6f\u4ef6\u4e0e\u5de5\u5177\u6559\u7a0b**\n\n---\n\nWitte Software\u00ae&nbsp;[https:\/\/www.modbustools.com](https:\/\/www.modbustools.com\/)\n\n2023-08-01\n\n## 1. Modbus Poll\n\nModbus Poll is an easy to use Modbus master simulator developed for many purposes. Among others:\n\n- Designers of Modbus slave devices for quick and easy testing of protocol interface\n\n- Automation engineers that need to test Modbus devices or networks on site\n\n- Service engineers that want to read out and\/or change specific service data from a device\n\n- Change Modbus registers in a slave device\n\n- Log data from Modbus devices\n\n- Troubleshooting and compliance testing\n\n### 1.1. System requirements for Modbus Poll\n\n**Hardware requirements**\n\nProcessor; 1 GHz or faster recommended\n1 GB RAM\n5 MB of available hard drive space\n1024 x 768 display resolutionOS requirements\n\nAll Windows versions from Windows 7 to Windows 11 are supported.\nModbus Poll version 7 runs on Windows XP.\n\n#### 1.1.1. Silent install\n\nSilent install require no user intervention and have no user interface. The user doesn\u2019t see any dialog and isn\u2019t asked any questions.\nUse the command line \/S switch.\n\n### 1.2. End User License Agreement\n\nYou should carefully read the following terms and conditions before using Modbus Poll. Unless you have a different license agreement signed by Witte Software, your use of this software indicates your acceptance of this license agreement and warranty. If you do not accept these terms you must cease using this software immediately.\n\n**Copyright.**\nModbus Poll (\"The Software\") is copyright 2002-2023 by Witte Software, all rights reserved.\n\n**Evaluation and Registration.**\nThis is not free software. You are hereby licensed to use the Software for evaluation purposes without charge for a period of 30 days.\n\nIf you use the Software after the 30 day evaluation period a registration fee is required.\n\nUnregistered use of the Software after the 30-day evaluation period is in violation of U.S. and international copyright laws.\n\nOne registered copy of the Software may either be used by a single person who uses the software personally on one or more computers, or installed on a single computer used by multiple people, but not both.\n\nFor information on order and pricing, please visit&nbsp;[https:\/\/www.modbustools.com\/order.html](https:\/\/www.modbustools.com\/order.html)\n\nModbus Poll licenses are perpetual. Once you buy a license to a specific major version, and as long as you abide by the license agreement, you can use that version forever with no additional cost.\n\n**Distribution.**\nProvided that you do not include your License Key you are hereby licensed to make copies of the Software; give exact copies of the original to anyone; and distribute the Software in its unmodified form via electronic means. You are specifically prohibited from charging for any such copies.\n\n**LIMITED WARRANTY.**\nTHE SOFTWARE IS PROVIDED AS IS AND WITTE SOFTWARE DISCLAIMS ALL WARRANTIES RELATING TO THIS SOFTWARE, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n\n**LIMITATION ON DAMAGES.**\nNEITHER WITTE SOFTWARE NOR ANYONE INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THIS SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE SUCH SOFTWARE EVEN IF WITTE SOFTWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT SHALL WITTE SOFTWARE\u2019S LIABILITY FOR ANY DAMAGES EXCEED THE PRICE PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE.\n\n## 2. Modbus Poll Features\n\n### 2.1. Connections\n\nModbus Poll read\/write data from devices using:\n\n- Modbus RTU or ASCII on RS232 or RS485 networks. (USB\/RS232\/485 Converter)\n\n- Modbus TCP\/IP\n\n- Modbus Over TCP\/IP. (Modbus RTU\/ASCII encapsulated in a TCP packet)\n\n- Modbus UDP\/IP\n\n- Modbus Over UDP\/IP. (Modbus RTU\/ASCII encapsulated in a UDP packet)\n\n### 2.2. Supported Modbus Functions\n\n- 01 (0x01) Read Coils\n\n- 02 (0x02) Read Discrete Inputs\n\n- 03 (0x03) Read Holding Registers\n\n- 04 (0x04) Read Input Registers\n\n- 05 (0x05) Write Single Coil\n\n- 06 (0x06) Write Single Register\n\n- 08 (0x08) Diagnostics (Serial Line only)\n\n- 11 (0x0B) Get Comm Event Counter (Serial Line only)\n\n- 15 (0x0F) Write Multiple Coils\n\n- 16 (0x10) Write Multiple Registers\n\n- 17 (0x11) Report Server ID (Serial Line only)\n\n- 22 (0x16) Mask Write Register\n\n- 23 (0x17) Read\/Write Multiple Registers\n\n- 43 \/ 14 (0x2B \/ 0x0E) Read Device Identification\n\n### 2.3. Data logging\n\n- Log data to a text file\n\n- Log data direct into Excel\n\n### 2.4. Display formats\n\nEach cell can be individual formatted.\n\n- Signed 16-bit register\n\n- Unsigned 16-bit register\n\n- Hex\n\n- Binary\n\n- 32-bit signed integer with any word\/byte order\n\n- 32-bit unsigned integer with any word\/byte order\n\n- 64-bit signed integer with any word\/byte order\n\n- 64-bit unsigned integer with any word\/byte order\n\n- 32-bit float with any word\/byte order\n\n- 64-bit double float with any word\/byte order\n\n### 2.5. Miscellaneous features\n\n- OLE\/Automation for interfacing with Excel VBA, Python etc.\n\n- Monitoring of data traffic\n\n- Print and print preview\n\n- Font selection\n\n- Conditional colors\n\n- Scaling\n\n- Real time charting\n\n- Save\/Open workspace\n\n- Address Scan\n\n## 3. Overview\n\nModbus Poll uses a multiple document interface. That means several windows can be opened. Each one with different data contents from different slave devices at the same time.\n\n![Modbus Poll Master simulator](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172509438.png)\n\nThis picture shows two open windows. One reading 10 Holding registers from slave id 1 and another reading 10 Holding registers from slave id 2.\n\n### 3.1. Help from anywhere\n\n**Press F1**&nbsp;and get context sensitive help on a topic associated with the current selected item.\n\n**SHIFT + F1**&nbsp;invokes a special \"help mode\" in which the cursor turns into a help cursor (arrow + question mark). The user can then select a visible object in the user interface, such as a menu item, toolbar button, or window. This opens help on a topic that describes the selected item.\n\n### 3.2. Name cells\n\nHere you can type any text for designation of the value cells. You can also copy\/paste text from Excel cells.\n\n### 3.3. Value cells\n\nShow the data values of the Modbus registers. If you double click a value cell a dialog box lets you write a new value to the slave device. Typing a number in a value cell shows the dialog as well. It is possible to select the used Modbus function used to write the value.\n\nThe check box \"Close dialog on Response ok\" is used to automatically close the dialog box when a value is successfully sent. This is convenient when a lot of values are to be changed. In that way it is fast to select a new cell and then type a new value again.\n\n![Write single register](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172511597.png)\n\n### 3.4. Change font\n\nTo change the font you have 2 options\n\n- Select the cells to be changed and then right click.\n\n- Select the cells to be changed and then menu \u2192 display \u2192 font.\n\n![Font selection](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172513828.png)\n\n### 3.5. Conditional colors\n\nConditional colors help you visually show values in specific ranges.3 color options\n\n- Default color: This color is used if none of the conditional colors evaluates to true.\n\n- Rule 1: This color selection is used if the expression evaluates to true. Rule 1 has precedence over rule 2.\n\n- Rule 2: This color selection is used if the expression evaluates to true.\n\n7 Comparison operators\n\n- not used\n\n- equal to\n\n- greater than\n\n- less than\n\n- greater than or equal to\n\n- less than or equal to\n\n- and\n\nThe \"and\" operator cannot be used when the data type is of float or 32 bit long type. The condition value is entered as a hex number if \"and\" is selected. It evaluates to true if any of the bits in both the cell and the condition value is 1.\n\n#### 3.5.1. Color example\n\nGreen color if the cell value is between 398 and 402\n\n![Cell colors](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172515734.png)\n\n### 3.6. Scaling\n\nScaling helps you scale raw values to human readable values. Scaling works only for signed and unsigned 16\/32 bit integers.\n\n![Scaling](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172517981.png)\n\n(X1,Y1) and (X2,Y2)\n\nA line passing through the two points (X1,Y1) and (X2,Y2)\n\nSlope=m=Y2\u2212Y1X2\u2212X1\ufffd\ufffd\ufffd\ufffd\ufffd=\ufffd=\ufffd2-\ufffd1\ufffd2-\ufffd1Line equation\n\nY=m\u22c5(X\u2212X1)+Y1\ufffd=\ufffd\u22c5(\ufffd-\ufffd1)+\ufffd1Precision\n\nNumber of digits after the decimal point.Enable\n\nMust be enabled to scale the value from the Modbus server\/slave. Scaling is automatically disabled if other than a 16\/32 bit integer display format is selected.\n\n### 3.7. Real time charting\n\nThe chart can plot 12 series in real time with up to 100000 points in each series.\n\n### 3.8. Address Scan\n\nScan an address range for a list of all valid addresses in a device.\n\n### 3.9. Open a new window\n\nTo open another window you have 3 options:\n\n- Press CTRL+N\n\n- Select new in the file menu\n\n- Press&nbsp;![New window](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172520248.png)&nbsp;on the toolbar\n\n## 4. Connection dialog\n\nTo open the connection dialog you have 2 options:\n\n- Press F3\n\n- Select connect from the connection menu\n\n![Connection setup](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172524484.png)\n\n### 4.1. Connection\n\nThere are 5 different connection types:\n\n- **Serial:**\nModbus over serial line. RS232 or RS485. A USB serial converter can be used.\n\n- **Modbus TCP\/IP:**\nSelect TCP\/IP if you want to communicate with a MODBUS TCP\/IP network. In this case, slave ID is the same as the Unit ID used in MODBUS TCP\/IP.\nThe port number is default 502.\nIf the connection fails then try if you can ping your device at the command prompt. If the ping command fails then Modbus Poll fails too.\n\n- **Modbus UDP\/IP:**\nSelect UDP\/IP if you want to communicate with a MODBUS UDP\/IP network. This is the same as Modbus TCP\/IP but the connection less UDP protocol is used instead.\n\n- **Modbus RTU\/ASCII over TCP\/IP:**\nThis is a RTU or ASCII message sent over a TCP\/IP network instead of serial lines.\n\n- **Modbus RTU\/ASCII over UDP\/IP:**\nThis is a RTU or ASCII message sent over a UDP\/IP network instead of serial lines.\n\nConnection type 3-5 is not standard Modbus as specified by&nbsp;[www.modbus.org](https:\/\/modbus.org\/)&nbsp;but they are added for convenience.\n\nDepending on your selection some other settings will be grayed.\n\n### 4.2. Serial Settings\n\nUse these parameters to set serial port settings. They are only available if the connection type is \"**Serial Port**\".Mode\n\nUse this option to select&nbsp;**RTU**&nbsp;or&nbsp;**ASCII**&nbsp;mode. Default RTU.Response timeout\n\nSpecifies the length of time that Modbus Poll should wait for a response from a slave device before giving up. Default is 1000ms.Min delay between polls\n\nThis setting ensures a minimum delay until the next request is transmitted no matter the scan rate. The resolution of this setting is approximately 15ms. It\u2019s possible on some computers to obtain better resolution but not all.\n\nIf you set this value lower than 20ms the 3.5 char time gap between response and a new request can\u2019t be guaranteed. This is because the Windows scheduler switches tasks every 10 - 20ms.If you Poll several slaves in a serial RS485 network you should NOT set the value lower than 20ms. This is to ensure the 3.5 char time gap.In a TCP\/IP network less than 20ms is ok.Serial connection to only one slave device less than 20ms is ok.\n\n**User Baud Rate**\n\nSpecify a custom baud rate if none of the default baud rates are useful.\n\n### 4.3. Remote Server\n\nRemote server settings are only available when using an Ethernet connection.IP Address\n\nServers IP address. Default is localhost 127.0.0.1Port\n\nServer port number. Default 502Connect Timeout\n\nMax time to use to establish a connection. Default 1000\n\n### 4.4. Advanced settings\n\nRTS Toggle\n\nRTS Toggle specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low.\nYou can use this to switch direction if you have a 232\/485 converter without an automatic direction switch.\n\nThe use of RTS controlled RS232\/RS485 converters should be avoided if possible. It is difficult to determine the exact time when to switch off the transmitter with non real-time operating systems like Windows and Linux. If it is switched off too early characters might still sit in the FIFO or the transmit register of the UART and these characters will be lost. Hence the slave will not recognize the message. On the other hand if it is switched off too late then the slave\u2019s message is corrupted and the master will not recognize the message.\n\nDSR\n\nDSR specifies whether the DSR (data-set-ready) signal is monitored for output flow control. If this member is TRUE and DSR is turned off, output is suspended until DSR is sent again.CTS\n\nCTS specifies whether the CTS (clear-to-send) signal is monitored for output flow control. If this checkbox is enabled and CTS is turned off, output is suspended until CTS is sent again.DTR\n\nDTR specifies whether the DTR will be enabled or disabled whenever the port is opened.Remove Echo\n\nIf your device or RS232\/RS485 converter echoes the chars just sent.\n\n## 5. Read\/Write definition\n\nUse this command to define the data to be monitored for the active window.\n\nTo open the Read\/Write Definition dialog you have 3 options:\n\n- Press F8\n\n- Select \"Read\/Write Definition\" from the Setup menu\n\n- Press&nbsp;![Definition button](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172526185.png)&nbsp;on the toolbar\n\n![Read\/write definition](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172530193.png)\n\n### 5.1. Slave ID\n\nRange 1 to 255. (MODBUS protocol specifications say 247). The value 0 is also accepted to communicate directly to a MODBUS\/TCP or MODBUS\/UDP&nbsp;device.\n\n### 5.2. Function code\n\nYou can select 1 of 8 function codes.\n\n#### 5.2.1. Read functions\n\nThe data returned by the read functions are displayed on the grid window.\n\n- 01: Read coils (0x)\n\n- 02: Read discrete inputs (1x)\n\n- 03: Read holding registers (4x)\n\n- 04: Read input registers (3x)\n\n#### 5.2.2. Write functions\n\nThe write functions write the data displayed on the grid window.\n\n- 05: Write single coil (Writes to Coil status)\n\n- 06: Write single register (Writes to Holding registers)\n\n- 15: Write multiple coils (Writes to Coils)\n\n- 16: Write multiple registers (Writes to Holding registers)\n\n### 5.3. Address\n\nAddresses in the Modbus protocol are confusing! Some protocol specifications use the protocol\/message address and others use device addressing.\n\n#### 5.3.1. Protocol\/message address\n\nSome protocol specifications use the protocol\/message address counting from 0 to 65535 along with a function code. This is also what the new Modbus specifications use. This is the address inside the message sent on the wire.\n\nModbus Poll use protocol\/message address counting from 0 to 65535.\n\n#### 5.3.2. Device address\n\nSome protocol specifications use device address\/registers. Registers counts from 1. The first digit describes the function to be used. That means the device address 40101 is identified by address 100. The \"4\" means Holding registers and 4x registers counts from 1. And even more confusing: 4x means function code 03 and 3x means function code 04!\n\n#### 5.3.3. 5 digits vs. 6 digits addressing\n\nThe address format 4x counts from 40001 to 49999. The next address is&nbsp;**not**&nbsp;50000. In the old days 9999 addresses was enough. There are cases where 9999 is not enough. Then a zero is added. 40101 becomes 400101 and so on. This is called 6 digits addressing or extended addressing.\n\nThis is not a problem with Modbus Poll. 410001 become 10000. The \"4\" is thrown away and the rest 10001 is decremented by 1 as we count from 0 instead of 1.\n\n#### 5.3.4. Address examples\n\nThese examples show how to set up Modbus Poll if a specification uses device addresses.\n\nRead Holding Registers\n\nYou want to read 20 registers from device address 40011 from slave ID 2 every 1000ms. From the \"4\" we know this is function 03 \"Read Holding Registers\".\n\n- Slave ID = 2\n\n- Function = \"03 Read Holding Registers (4x)\"\n\n- Address = 10 (11 minus 1)\n\n- Quantity = 20\n\n- Scanrate = 1000\n\nRead Discrete Inputs\n\nYou want to read 1000 coils from address 110201 from slave ID 5 every 500ms. From the \"1\" we know this is function 02 \"Read Discrete Inputs\"\n\n- Slave ID = 5\n\n- Function = \"02 Read Discrete Inputs (1x)\"\n\n- Address = 10200 (10201 - 1)\n\n- Quantity = 1000\n\n- Scanrate = 500\n\n### 5.4. Scanrate\n\nThe scan rate can be set from 0 to 3600000ms. Note that setting the scan rate lower than the transaction time does not make sense. If a serial connection at 9600baud is used and 125 registers are requested the transaction time is roughly 8 + 2 + 250 + 2 = 262ms + the gap (&gt;3.5 char time) between the request and the response. In this case setting the scan rate at e.g. 100ms does not make sense as the transaction time is at least 262ms + delay in the slave (gap) + min time between polls. (Set in the connection dialog F3).\n\n### 5.5. Read\/Write Disabled\n\nThe \"Read\/Write Disabled\" checkbox can be used to temporary enable or disable the communication for this window. A text (Disabled) is then shown along with the Tx and Error counters.\n\n![Read\/Write disabled](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172532814.png)\nIf \"Read\/Write\" is disabled you can make single requests with the \"Read\/Write once\" button or press F6.\n\n![Read\/Write once button](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172534270.png)\n\"Read\/Write once\" button\n\n#### 5.5.1. Disable on error\n\nDisable Read\/Write in case of error.\n\n### 5.6. Hide name columns\n\nHide all name columns. This is convenient to make more space if they are not used.\n\n### 5.7. Address in cell\n\nIf enabled, the address is also shown in the value cell like: 2000 = 00000\n\n![Address in cell](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172536100.png)\n\n### 5.8. PLC Addresses (Base 1)\n\nThis option will show the addresses as device addresses.\n\n![PLC address](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172538740.png)\n\n### 5.9. Enron\/Daniel Mode\n\nEnron or Enron\/Daniels Modbus is Standard Modbus with a few \"Vendor Extensions\". The exact impact of these extensions is context dependent, but most common Modbus commands work as expected. There are some custom vendor-defined functions available - but few users expect or use them. The largest impact has to do with how 32-bit data values are read\/written.\n\nEnron-Modbus defines two special 4x holding register ranges:\n\n- 4x5001 to 4x5999 are assumed 32-bit long integers (4-bytes per register).\n\n- 4x7001 to 4x7999 are assumed 32-bit floating points (4-bytes per register).\n\nDealing with 32-bit values in Modbus is NOT unique to Enron-MB. However, Enron-MB takes the debatable step of returning 4-bytes per register instead of the 2-bytes implied by the term \"holding register\" in the Modbus specification. This means a poll of registers 4x5001 and 4x5002 in Enron-Modbus returns 8-bytes or two 32-bit integers, whereas Standard Modbus would only return 4-bytes or one 32-bit integer treated as two 16-bit integers. In addition, polling register 4x5010 in Enron-MB returns the tenth 32-bit long integer, whereas Standard Modbus would consider this 1\/2 of the fifth 32-bit long integer in this range.\n\n### 5.10. Rows\n\nSpecify the number of rows in the grid you prefer.\n\n## 6. Real time Charting\n\nUse this command to plot up to 12 data series in a chart in real time.\nThe real time chart is high speed and capable of drawing a new line as fast as new data is received.\n\nAll chart settings are stored with workspace.&nbsp;[Save\/Open Workspace](https:\/\/www.modbustools.com\/mbpoll-user-manual.html#_saveopen_workspace)\n\nTo open the Real time charting dialog you have 2 options:\n\n- Press Alt + R\n\n- Select \"Real time Charting\" from the Display menu\n\n![Real time charting](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172540450.png)\n\nThe X-Axis displays the number of seconds since the chart was started.\n\nWhen the points reach the end of the chart there are 3 options:\n\n- **Stop at end:**&nbsp;The charting stops.\n\n- **Restart at end:**&nbsp;The charting starts all over again.\n\n- **Continue:**&nbsp;It continues until it reaches the max number of points or stop is pressed.\n\n### 6.1. Settings\n\nBy default all 12 series are linked to the left Y-Axis. Check the \"Right Y-Axis\" check box if you want to link a series to the right Y-Axis.Specify\n\n- Colors\n\n- Right Y-Axis\n\n- Title. If title is empty it is initialized with the name from the reading window\n\n- Offset\n\nShow\n\n- File name\n\n- Address\n\nThe offset is useful to align data points on the same Y-Axis. For example, data points that are either 0 or 1 can be offset so they are not drawn on top of each other.\n\n![Series settings](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172544231.png)\n\n### 6.2. Zoom function\n\nZooming in on the chart can be useful if you want to see more details. The zoom is controlled with the left mouse button. To zoom a specific part of the chart, simply left-click on the chart (this will be the upper-left corner of the zoomed rectangle) and drag to the bottom-right. A rectangle will appear. As soon as you release the mouse button, the axes will automatically adjust themselves to the region you have selected.\n\nIf you left-click on the chart (like for starting a zoom) but if you move to the top-left corner instead, all the modifications done with the zoom and pan features will be canceled (the chart will be in the state it was before the manipulations with the pan and zoom).\n\n### 6.3. Pan function\n\nTo pan the control, right-click somewhere on the control and move the mouse. The point under the mouse will follow the movement of the mouse.\n\n### 6.4. Link data to the chart series\n\nThe chart doesn\u2019t know which data to use unless you link a Modbus data cell to one of the 12 series. To do so select a value cell and from Menu\u2192Display select \"Link to Chart\".\n\n![Link to chart](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172546957.png)\n\n### 6.5. Export series\n\nSave series data to disk or copy to clipboard. Paste the data direct in Excel for further processing.\nThe file is given a .csv extension despite the use of a non-comma field separator.\n\n**Delimiters:**&nbsp;Select the character that separates values in your text file. Use tab delimiter when copy\/paste to Excel.Furthermore some additional information is given.\n\n- Number of points\n\n- Max point value\n\n- Min point value\n\n- Average point value\n\n![save\/copy series](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172548439.png)\n\n## 7. Address Scan\n\nScan an address range for a list of all valid addresses in a device. Addresses are read one by one and the read result is shown in a list.\n\nScanning all 65535 addresses takes some time depending on connection type, server device etc.\n\n### 7.1. Export Address Scan\n\nSave Address Scan data to disk or copy to clipboard. Paste the data direct in Excel for further processing.\nThe file is given a .csv extension despite the use of a non-comma field separator.\n\n**Delimiters:**&nbsp;Select the character that separates values in your text file. Use tab delimiter when copy\/paste to Excel.\n\n## 8. Display formats\n\nMark the cells to be formatted. Select one of the 28 display formats from the display menu.\n\n### 8.1. Native Modbus registers\n\nThe 16-bit Modbus registers can be displayed in 4 different modes.\n\n- Signed\n\n- Unsigned\n\n- Hex\n\n- ASCII - Hex\n\n- Binary\n\n### 8.2. 32-bit signed integer\n\nThis combines 2 16-bit Modbus registers. It can be displayed in 4 different word\/byte orders.\n\n- Signed integer Big-endian\n\n- Signed integer Little-endian\n\n- Signed integer Big-endian byte swap\n\n- Signed integer Little-endian byte swapExampleByte Order:&nbsp;**AB CD (Big-endian)**\nThe decimal number 123456789 or in hexadecimal&nbsp;**07 5B CD 15**\nOrder as they come over the wire in a Modbus message:&nbsp;**07 5B CD 15**\n\n### 8.3. 32-bit unsigned integer\n\nThis combines 2 16-bit Modbus registers. It can be displayed in 4 different word\/byte orders.\n\n- Unsigned integer Big-endian\n\n- Unsigned integer Little-endian\n\n- Unsigned integer Big-endian byte swap\n\n- Unsigned integer Little-endian byte swapExampleByte Order:&nbsp;**AB CD (Big-endian)**\nThe decimal number 123456789 or in hexadecimal&nbsp;**07 5B CD 15**\nOrder as they come over the wire in a Modbus message:&nbsp;**07 5B CD 15**\n\n### 8.4. 64-bit signed integer\n\nThis combines 4 16-bit Modbus registers. It can be displayed in 4 different word\/byte orders.\n\n- Signed integer Big-endian\n\n- Signed integer Little-endian\n\n- Signed integer Big-endian byte swap\n\n- Signed integer Little-endian byte swapExampleByte Order:&nbsp;**AB CD EF GH (Big-endian)**\nThe decimal number -1,234,567,890,123,456,789 or in hexadecimal&nbsp;**EE DD EF 0B 82 16 7E EB**\nOrder as they come over the wire in a Modbus message:&nbsp;**EE DD EF 0B 82 16 7E EB**\n\n### 8.5. 64-bit unsigned integer\n\nThis combines 4 16-bit Modbus registers. It can be displayed in 4 different word\/byte orders.\n\n- Unsigned integer Big-endian\n\n- Unsigned integer Little-endian\n\n- Unsigned integer Big-endian byte swap\n\n- Unsigned integer Little-endian byte swapExampleByte Order:&nbsp;**AB CD EF GH (Big-endian)**\nThe decimal number 1,234,567,890,123,456,789 or in hexadecimal&nbsp;**11 22 10 F4 7D E9 81 15**\nOrder as they come over the wire in a Modbus message:&nbsp;**11 22 10 F4 7D E9 81 15**\n\n### 8.6. 32-bit floating\n\nThis combines 2 16-bit Modbus registers. It can be displayed in 4 different word\/byte orders.\n\n- Float Big-endian\n\n- Float Little-endian\n\n- Float Big-endian byte swap\n\n- Float Little-endian byte swapExampleByte Order:&nbsp;**AB CD (Big-endian)**\nThe floating point number 123456.00 or in hexadecimal&nbsp;**47 F1 20 00**\nOrder as they come over the wire in a Modbus message:&nbsp;**47 F1 20 00**\n\n### 8.7. 64-bit double\n\nThis combines 4 16-bit Modbus registers. It can be displayed in 4 different word\/byte orders.\n\n- Double Big-endian\n\n- Double Little-endian\n\n- Double Big-endian byte swap\n\n- Double Little-endian byte swapExampleByte Order:&nbsp;**AB CD EF GH (Big-endian)**\nThe floating point number 123456789.00 or in hexadecimal&nbsp;**41 9D 6F 34 54 00 00 00**\nOrder as they come over the wire in a Modbus message:&nbsp;**41 9D 6F 34 54 00 00 00**\n\n## 9. Save\/Open Workspace\n\nIf you open many related Modbus windows it is convenient to save a snapshot of the current layout of all open and arranged Modbus Windows in one workspace.\n\nA workspace (*mbw) is a file that contains display information and file names of all open windows. Not the actual contents. To do this, go to File\u2192 Save Workspace.\n\nThe Connection and Chart settings are stored in the Workspace file.\n\nWhen you open a workspace file, Modbus Poll opens all Modbus Windows and displays them in the layout that you saved.\n\n## 10. Export to csv\n\nExport names and values to a Comma, Semicolon or Tab Separated Values File.Select from the file dialog\n\n- Comma Separated Values file (*.csv)\n\"Temperature\",\"19.7\"\n\n- Semicolon Separated Values file (*.csv)\n\"Temperature\";\"19.7\"\n\n- Tab Separated Values file (*.txt)\nTemperature 19.7\n\nDepending on your system, comma or period is used to separate decimals.\n\n## 11. Export to Modbus Slave\n\nExport names, values and formatting to a Modbus Slave file. *.mbs\n\nModbus Slave version 7.4.0 or newer is required to open the file.\n\n## 12. Test center\n\nThe purpose of this test dialog is to help MODBUS slave device developers to test the device with any string of their own composition.\nThe list box displays the transmitted data as well as the received data.\nYou can have several test strings in the pull down list box. When you have entered a string then press the \"Add to List\" button then the string is added to the list.\nThe selected string is sent when the \"Send\" button is pressed.Open list\n\nRest test strings from a file.Save list\n\nStore the test strings to a file.Clear\n\nClear the test list.Add to list\n\nAdd the current test string to the list.Add Check\n\nAdd a CRC or LRC to the end of the input string.\n\nWhen using the test center you may want to disable communication from other windows. Check the \"Read\/Write disable\" check box in \"Read\/Write Definition\" dialog. Setup\u2192Read\/Write Definition.\n\n### 12.1. ASCII Example\n\nString in the combo box:3A 30 31 30 33 30 30 30 30 30 30 30 41\n\nThe transmitted string if LRC is added3A 30 31 30 33 30 30 30 30 30 30 30 41 46 32 0D 0A\n\nA CR LF pair is also added.\n\n### 12.2. TCP\/IP Example\n\nRead 10 holding registers.00 00 00 00 00 06 01 03 00 00 00 0A\n\nThe first 6 bytes are the TCP\/IP header.\n\n### 12.3. Test center string file\n\nWith a text editor such as notepad or similar you can prepare strings to be used in the test.\nThe first line in the file must be the string \"TestCenter\". This is how Modbus Poll knows that the file is the correct format. Press \"Open list\" to open the prepared text file.\n\n#### 12.3.1. Content of a string list\n\nTestCenter 3A 30 31 30 33 30 30 30 30 30 30 30 41 3A 30 32 30 33 30 30 30 30 30 30 30 41 3A 30 33 30 33 30 30 30 30 30 30 30 41\n\n### 12.4. Copy\n\nUse the Copy button to copy selected Tx\/Rx strings to the clipboard.\nThe SHIFT and CTRL keys can be used together with the mouse to select and deselect strings, select groups of strings, and select non-adjacent strings.\n\nLeave this window open while doing other commands.\n\n## 13. Modbus Data logging\n\nYou can log data to either a text file or direct to Microsoft Excel.\n\n### 13.1. Text file\n\nSelect Log from the setup menu or use shortcut keys: Alt+L\n\nEach Modbus Window logs to its individual text file.\n\nWhen you want to stop the data logging then select the logging off command on the setup menu.\n\n![Modbus data log](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172553752.png)\n\n#### 13.1.1. Log Rate\n\nEach read\n\nWrite a logline for all Modbus requests. Log frequency as scan rate.Select\n\nSpecify the log rate in seconds. Independent of scan rate.\n\nIf the scan rate is e.g. 10000ms it makes no sense to set a 1 sec log rate as data is logged only when new data is ready.\n\n#### 13.1.2. Delimiters\n\nAs delimiter you can use one of following options:Fixed width\n\nMeans that the values are organized in columns.Comma\n\nValues separated by a comma.Tab\n\nValues separated by a tab.\n\n#### 13.1.3. Log if data changed only\n\nSpecify that a new log line is written only if any data is changed since last log.\n\n#### 13.1.4. Log Errors\n\nSpecify that errors such a timeout etc. are logged.\n\n#### 13.1.5. Log Date\n\nSpecify that the current date is added to the log time.\n\n#### 13.1.6. Use \"T\" as delimiter\n\nSpecify that the time and date is delimited by the letter \"T\" as specified in ISO 8601.\n\n#### 13.1.7. Log ms\n\nSpecify that milliseconds are added to the log time.\n\n#### 13.1.8. Log address\n\nSpecify that the Modbus Address is added to the log.\n\n#### 13.1.9. Start Log when ok is pressed\n\nSpecify that logging is started when the ok button is pressed. Otherwise the log setup is just stored when *mbp file is saved.\n\n#### 13.1.10. Start Log when *mbp is opened\n\nSpecify that logging is automatically started when a *.mbp file is opened.\n\n#### 13.1.11. Flush to file immediately\n\nThis ensures that log lines are not cashed in the file system but physically written immediately.\n\n#### 13.1.12. Append\n\nSpecify that logs are appended to the selected file. Otherwise a new file is created.\n\n#### 13.1.13. New log file at midnight\n\nClose the current log file and start a new file at midnight. A time stamp is added to your filename.\n\n#### 13.1.14. Header information\n\n**Insert header:**&nbsp;Information is inserted in the top of the log file.\n\n- **Name cells in top row:**&nbsp;Insert names.\n\n- **Poll definition:**&nbsp;Insert ID, Function etc.\n\n- **Name:**&nbsp;Insert a name of your log.\n\n**Example of a text file with fixed width:**22:28:13 &lt;40001&gt; 17395 0 0 0 0 0 0 0 0 22:28:14 &lt;40001&gt; 17396 1 0 0 0 0 0 0 0 22:28:15 &lt;40001&gt; 17394 1 0 0 2 55 0 0 0 22:28:16 &lt;40001&gt; 13350 1 0 0 4 0 0 0 0\n\nYou can import the data in an Excel spreadsheet.\n\n### 13.2. Microsoft Excel\n\nThis feature requires that Microsoft Excel is installed. Excel 2003 log is limited to 65535 logs as this is the max number of rows in an Excel sheet. Excel 2007 or newer is limited to 1,048,576 rows. Each Modbus Window logs to its individual Excel sheet.\n\nSelect Excel Log from the setup menu or use shortcut keys: Alt+X\n\n**Do not touch the Excel sheet while logging as this will interrupt the logging.**\n\n![Modbus Excel logging](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172555306.png)\n\n#### 13.2.1. Log Rate\n\n- **Each read:**&nbsp;Write a logline for all Modbus requests. Log frequency as scan rate.\n\n- **Select:**&nbsp;Specify the log rate in seconds. Log is independent of scan rate.\n**Remark:**&nbsp;If the scan rate is e.g. 10000ms it makes no sense to set a 1 sec log rate as data is logged only when new data is ready.\n\n- **Stop after:**&nbsp;Specify the number of log lines. Note that Excel 2003 is limited to 65,536 rows and Excel 2007 1,048,576 rows.\n\n#### 13.2.2. Header information\n\n**Insert header:**&nbsp;Information is inserted in the top most 3 lines in the Excel sheet.\n\n- **Name cells in top row:**&nbsp;Insert names in row 3.\n\n- **Poll definition:**&nbsp;Insert ID, Function etc. in row 2.\n\n- **Name:**&nbsp;Insert a log name in row 1.\n\n![Modbus Excel logging example](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172558783.png)\n\nExcel log with header information.\n\n## 14. Communication traffic\n\nSelect the menu Display\u2192Communication to show the traffic on the serial line or Ethernet cable. Use the stop button to temporary stop the update for inspection.\n\nUse the copy button to copy the selected line to the clipboard.\n\nThis window shows only data sent and received by Modbus Poll. You can\u2019t use it as a data sniffer.\n\nLeave this window open while doing other commands.\n\n## 15. OLE\/Automation\n\nAutomation (formerly known as OLE Automation) makes it possible for one application to manipulate objects implemented in another application.\n\nAn Automation client is an application that can manipulate exposed objects belonging to another application. This is also called an Automation controller.\n\nAn Automation server is an application that exposes programmable objects to other applications.&nbsp;**Modbus Poll**&nbsp;is an automation server.\n\nThat means you can use any program that supports VBA (Visual Basic for Applications) such as Visual Basic, Excel etc. to interpret and show the modbus data according to your specific requirements.\n\n### 15.1. Excel example\n\nYou should display the Developer tab or run in developer mode when you want to write macros.\n\n#### 15.1.1. Excel 2007\n\n![Excel developer tab](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172600218.png)\n\n- Click the Microsoft office button and then click Excel options.\n\n- Click popular and then select the show Developers tab in the ribbon check box.\nNote the ribbon is part of the Microsoft fluent user interface.\n\n#### 15.1.2. Excel 2010, 2016\n\n- Click on the file tab.\n\n- Click options. Excel Options window will open.\n\n- On the left pane click Customize Ribbon.\n\n- On the right pane, under Main Tabs, check the Developer check box.\n\n- Click OK. The Developer tab should now show in the ribbon (right most tab).\n\n#### 15.1.3. Excel sample code\n\nThis example opens two windows. One reading registers and another reading Coils.\nModbus Poll is hidden but you can show it by uncommenting the \"ShowWindow\" line. This will show one of the windows.\n\nAn example is also included with the Modbus Poll installation.\nStart \u2192 All Programs \u2192 Modbus Poll \u2192 Excel Example\n\nExcel VBA Example\n\n```\nPublic doc1 As Object\nPublic doc2 As Object\nPublic app As Object\nDim res As Integer\nDim n As Integer\n\nPrivate Sub StartModbusPoll_Click()\n   Set app = CreateObject(&quot;Mbpoll.Application&quot;)\n   Set doc1 = CreateObject(&quot;Mbpoll.Document&quot;)\n   Set doc2 = CreateObject(&quot;Mbpoll.Document&quot;)\n' Read 10 Holding Registers every 1000ms\n   res = doc1.ReadHoldingRegisters(1, 0, 10, 1000)\n' Read 10 Coil Status every 1000ms\n   res = doc2.ReadCoils(1, 0, 10, 1000)\n' doc1.ShowWindow()\n   app.Connection = 1 ' Modbus TCP\/IP\n   app.IPAddress = &quot;127.0.0.1&quot; ' local host\n   app.ServerPort = 502\n   app.ConnectTimeout = 1000\n   res = app.OpenConnection()\nEnd Sub\n\nPrivate Sub Read_Click()\n   Cells(5, 7) = doc1.ReadResult() 'Show results for the requests\n   Cells(6, 7) = doc2.ReadResult()\n\n   For n = 0 To 9\n      Cells(5 + n, 2) = doc1.SRegisters(n)\n   Next n\n\n   For n = 0 To 9\n      Cells(18 + n, 2) = doc2.Coils(n)\n   Next n\nEnd Sub\n```\n\n### 15.2. Python example\n\nThis Python example opens a window and set all possible data formats.\n\nPython Example\n\n```\nimport win32com.client as win32\n\nSIGNED = 0\nUNSIGNED = 1\nHEX = 2\nBINARY = 3\nFLOAT_LE_BS = 4\nFLOAT_BE = 5\nDOUBLE_LE_BS = 6\nDOUBLE_BE = 7\nS32_LE_BS = 8\nS32_BE = 9\nFLOAT_LE = 10\nFLOAT_BE_BS = 11\nDOUBLE_LE = 12\nDOUBLE_BE_BS = 13\nS32_LE = 14\nS32_BE_BS = 15\n\nU32_BE = 17\nU32_LE_BS = 18\nU32_BE_BS = 19\nU32_LE = 20\n\nS64_BE = 21\nS64_LE_BS = 22\nS64_BE_BS = 23\nS64_LE = 24\n\nU64_BE = 25\nU64_LE_BS = 26\nU64_BE_BS = 27\nU64_LE = 28\n\n#Endianness\nBE = 0\nLE = 3\nBE_BS = 2\nLE_BS = 1\n\nApp = win32.Dispatch('Mbpoll.Application')\n\nApp.Connection = 1\nApp.IPAddress = &quot;127.0.0.1&quot;\n\nApp.ServerPort = 502\nApp.OpenConnection\n\n#Create a Modbus display window called Win1\nWin1 = win32.Dispatch(&quot;Mbpoll.Document&quot;)\n\n# Read 100 holding registers from slave ID 1, address 0 (40001) every 1000ms\nWin1.ReadHoldingRegisters(1, 0, 100, 1000)\n# Show the Modbus window\nWin1.ShowWindow()\n# Show 20 rows\nWin1.Rows(1)\n\n# Disable refresh for speed\nWin1.EnableRefresh = False\n\n# Set all different formats\n# This sets how the value is displayed\nWin1.SetFormat(0, SIGNED)\nWin1.SetFormat(1, UNSIGNED)\nWin1.SetFormat(2, HEX)\nWin1.SetFormat(3, BINARY)\n\nWin1.SetFormat(4, S32_BE)\nWin1.SetFormat(6, S32_LE)\nWin1.SetFormat(8, S32_BE_BS)\nWin1.SetFormat(10, S32_LE_BS)\n\nWin1.SetFormat(12, U32_BE)\nWin1.SetFormat(14, U32_LE)\nWin1.SetFormat(16, U32_BE_BS)\nWin1.SetFormat(18, U32_LE_BS)\n\nWin1.SetFormat(20, S64_BE)\nWin1.SetFormat(24, S64_LE)\nWin1.SetFormat(28, S64_BE_BS)\nWin1.SetFormat(32, S64_LE_BS)\n\nWin1.SetFormat(40, U64_BE)\nWin1.SetFormat(44, U64_LE)\nWin1.SetFormat(48, U64_BE_BS)\nWin1.SetFormat(52, U64_LE_BS)\n\nWin1.SetFormat(60, FLOAT_BE)\nWin1.SetFormat(62, FLOAT_LE)\nWin1.SetFormat(64, FLOAT_BE_BS)\nWin1.SetFormat(66, FLOAT_LE_BS)\n\nWin1.SetFormat(80, DOUBLE_BE)\nWin1.SetFormat(84, DOUBLE_LE)\nWin1.SetFormat(88, DOUBLE_BE_BS)\nWin1.SetFormat(92, DOUBLE_LE_BS)\n\n# Set all Names to used format\nWin1.SetName(0, &quot;SIGNED&quot;)\nWin1.SetName(1, &quot;UNSIGNED&quot;)\nWin1.SetName(2, &quot;HEX&quot;)\nWin1.SetName(3, &quot;BINARY&quot;)\n\nWin1.SetName(4, &quot;S32_BE&quot;)\nWin1.SetName(6, &quot;S32_LE&quot;)\nWin1.SetName(8, &quot;S32_BE_BS&quot;)\nWin1.SetName(10, &quot;S32_LE_BS&quot;)\n\nWin1.SetName(12, &quot;U32_BE&quot;)\nWin1.SetName(14, &quot;U32_LE&quot;)\nWin1.SetName(16, &quot;U32_BE_BS&quot;)\nWin1.SetName(18, &quot;U32_LE_BS&quot;)\n\nWin1.SetName(20, &quot;S64_BE&quot;)\nWin1.SetName(24, &quot;S64_LE&quot;)\nWin1.SetName(28, &quot;S64_BE_BS&quot;)\nWin1.SetName(32, &quot;S64_LE_BS&quot;)\n\nWin1.SetName(40, &quot;U64_BE&quot;)\nWin1.SetName(44, &quot;U64_LE&quot;)\nWin1.SetName(48, &quot;U64_BE_BS&quot;)\nWin1.SetName(52, &quot;U64_LE_BS&quot;)\n\nWin1.SetName(60, &quot;FLOAT_BE&quot;)\nWin1.SetName(62, &quot;FLOAT_LE&quot;)\nWin1.SetName(64, &quot;FLOAT_BE_BS&quot;)\nWin1.SetName(66, &quot;FLOAT_LE_BS&quot;)\n\nWin1.SetName(80, &quot;DOUBLE_BE&quot;)\nWin1.SetName(84, &quot;DOUBLE_LE&quot;)\nWin1.SetName(88, &quot;DOUBLE_BE_BS&quot;)\nWin1.SetName(92, &quot;DOUBLE_LE_BS&quot;)\n\n# Refresh\nWin1.EnableRefresh = True\n\nWin1.ResizeAllColumns ()\nWin1.ResizeWindow()\n\nresult = Win1.Save(&quot;C:\\Users\\UserName\\Desktop\\testfile.mbp&quot;)\nprint (result)\n\nprint (Win1.GetName(1))\n\n_ = input(&quot;Press ENTER to quit:&quot;)\n```\n\n### 15.3. Connection Functions\/Properties\n\nThe following properties and functions do the same as you setup in the connection dialog (F3).\n\n#### 15.3.1. Connection\n\nConnection selects the desired connection. A serial port or one of the Ethernet connections can be selected.\n\nProperty&nbsp;**Connection**&nbsp;as IntegerValid values\n\n0 = Serial port\n1 = Modbus TCP\/IP\n2 = Modbus UDP\/IP\n3 = Modbus ASCII\/RTU over TCP\/IP\n4 = Modbus ASCII\/RTU over UDP\/IP\n\nExample\n\n```\nConnection = 0\n```\n\n#### 15.3.2. BaudRate\n\nApplicable only for Connection = 0\n\nProperty&nbsp;**BaudRate**&nbsp;as LongValid values\n\n300\n600\n1200\n2400\n4800\n9600 (Default)\n14400\n19200\n38400\n56000\n57600\n115200\n128000\n153600\n230400\n256000\n460800\n921600\n\nExample\n\n```\nBaudRate = 9600\n```\n\n#### 15.3.3. DataBits\n\nApplicable only for Connection = 0\n\nProperty&nbsp;**DataBits**&nbsp;as IntegerValid values\n\n7\n8 (Default)\n\nExample\n\n```\nDataBits = 8\n```\n\n#### 15.3.4. Parity\n\nApplicable only for Connection = 0\n\nProperty&nbsp;**Parity**&nbsp;as IntegerValid values\n\n0 = None\n1 = Odd\n2 = Even (Default)\n\nExample\n\n```\nParity = 2\n```\n\n#### 15.3.5. StopBits\n\nApplicable only for Connection = 0\n\nProperty&nbsp;**StopBits**&nbsp;as IntegerValid values\n\n1 (Default)\n2\n\nExample\n\n```\nStopBits = 1\n```\n\n#### 15.3.6. SerialPort\n\nApplicable only for Connection = 0\n\nProperty&nbsp;**SerialPort**&nbsp;as IntegerValid values\n\n1\u2026255\n\nDefault value = 1\n\nExample\n\n```\nSerialPort = 1\n```\n\n#### 15.3.7. Mode\n\nApplicable only for Connection = 0\n\nProperty&nbsp;**Mode**&nbsp;as IntegerValid values\n\n0 = RTU Mode\n1 = ASCII Mode\n\nExample\n\n```\nMode = 1\n```\n\n#### 15.3.8. RemoveEcho\n\nApplicable only for Connection = 0\nIf your device or RS232\/RS485 converter echoes the chars just sent.\n\nProperty&nbsp;**RemoveEcho**&nbsp;as IntegerValid values\n\n0 (Default)\n1 (Remove echoes)\n\nExample\n\n```\nRemoveEcho = 1\n```\n\n#### 15.3.9. ResponseTimeout\n\nThe ResponseTimeout specifies the length of time in ms that Modbus Poll should wait for a response from a slave device before giving up.\n\nProperty&nbsp;**ResponseTimeout**&nbsp;as IntegerValid values\n\n50\u2026100000\n\nDefault value = 1000\n\nExample\n\n```\nResponseTimeout = 1000\n```\n\n#### 15.3.10. DelayBetweenPolls\n\nProperty&nbsp;**DelayBetweenPolls**&nbsp;as IntegerValid values\n\n0\u20261000\n\nDefault value = 20\n\nExample\n\n```\nDelayBetweenPolls = 20\n```\n\n#### 15.3.11. ServerPort\n\nApplicable only for Connection = 1\u20264\n\nProperty&nbsp;**ServerPort**&nbsp;as LongValid values\n\n0\u202665535\n\nDefault value = 502\n\nExample\n\n```\nServerPort = 502\n```\n\n#### 15.3.12. ConnectTimeout\n\nThe ConnectTimeout specifies the length of time that Modbus Poll should wait for a TCP\/IP connection to succeed.\n\nApplicable only for Connection = 1\u20264\n\nProperty&nbsp;**ConnectTimeout**&nbsp;as IntegerValid values\n\n100\u202630000ms\n\nDefault value = 1000ms\n\nExample\n\n```\nConnectTimeout = 1000\n```\n\n#### 15.3.13. IPVersion\n\nApplicable only for Connection = 1\u20264\n\nProperty&nbsp;**IPVersion**&nbsp;as IntegerValid values\n\n4 = IP Version 4 (Default)\n6 = IP Version 6\n\nExample\n\n```\nIPVersion = 4\n```\n\n#### 15.3.14. OpenConnection\n\nOpens the connection selected with the Connection property.\n\nFunction&nbsp;**OpenConnection**() As IntegerParameters\n\nThis function has no parameters.Return value\n\nFor error 3-5: Please check if you have the latest serial port driver.\n\n**Error****Description**0SUCCESS1Serial Port not available3Serial port. Not possible to get current settings from the port driver.4Serial port. Serial port driver did not accept port settings.5Serial port. Serial port driver did not accept timeout settings.12TCP\/UDP Connection failed. WSA start up13TCP\/UDP Connection failed. Connect error14TCP\/UDP Connection failed. Timeout15TCP\/UDP Connection failed. IOCTL17TCP\/UDP Connection failed. Socket error21TCP\/UDP Connection failed. Address information255Connection already open\n\nExcel example how to open a Modbus TCP\/IP connection\n\n```\nPublic app As Object\nDim res As Integer\n' Create an object to Modbus Poll\nSet app = CreateObject(&quot;Mbpoll.Application&quot;)\napp.Connection = 1 ' Select Modbus TCP\/IP\napp.IPVersion = 4\napp.IPAddress = &quot;192.168.1.27&quot;\napp.ServerPort = 502\napp.ConnectTimeout = 1000\napp.ResponseTimeout = 1000\nres = app.OpenConnection()\n```\n\nPython example how to setup a serial connection\n\n```\nimport win32com.client as win32\n\nApp = win32.Dispatch('Mbpoll.Application')\n\nApp.Connection = 0            # Serial connection\nApp.SerialPort = 3            # Com port 3\nApp.BaudRate = 9600           # 9600 baud\nApp.Parity = 0                # None parity\nApp.Mode = 0                  # RTU mode\nApp.ResponseTimeout = 1000    # Wait 1000ms until give up\nApp.DelayBetweenPolls = 20    # Ensure minimum 20 ms gap until next request\nApp.OpenConnection\n\n#Create a Modbus display window called Win1\nWin1 = win32.Dispatch(&quot;Mbpoll.Document&quot;)\n\n# Read 10 holding registers from slave ID 1, address 0 (40001) every 1000ms\nWin1.ReadHoldingRegisters(1, 0, 10, 1000)\n# Show the Modbus window\nWin1.ShowWindow()\n# Show 10 rows\nWin1.Rows(0)\n\n# Disable refresh for speed\nWin1.EnableRefresh = False\n\n# Set the name of the registers\nWin1.SetName(0, &quot;Register 0&quot;)\n\n# Set the value to write\nWin1.EnableRefresh = True\n\nWin1.ResizeAllColumns ()\nWin1.ResizeWindow()\n\n_ = input(&quot;Press ENTER to quit:&quot;)\n```\n\n#### 15.3.15. CloseConnection\n\nFunction&nbsp;**CloseConnection**() As IntegerParameters\n\nThis function has no parameters.Return value\n\nZero if success. Nonzero value if failed.\n\n#### 15.3.16. ShowCommunicationTraffic\n\nShows the communication traffic window.\n\nFunction&nbsp;**ShowCommunicationTraffic**()Parameters\n\nThis function has no parameters.Return value\n\nNone\n\n#### 15.3.17. CloseCommunicationTraffic\n\nCloses the communication traffic window if shown.\n\nFunction&nbsp;**CloseCommunicationTraffic**()Parameters\n\nThis function has no parameters.Return value\n\nNone\n\n### 15.4. Read Functions\n\nThe following functions do the same as you setup in the read\/write definition dialog (F8). Read functions are associated with a Modbus Poll document. (The window with data)\n\nExample\n\n```\n' First a Modbus Poll document is needed.\nPublic doc As Object\n\nSet doc = CreateObject(&quot;Mbpoll.Document&quot;)\nres = doc.ReadCoils(1, 0, 100, 1000) ' Read 100 coils every 1000ms\n```\n\nYou must create a Read before you can use properties to get data.\n\n#### 15.4.1. ReadCoils\n\nModbus function code 01\n\nFunction&nbsp;**ReadCoils**(SlaveID As Integer, Address As Long, Quantity As Integer, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity:**&nbsp;The number of data. 1 to 2000\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\n#### 15.4.2. ReadDiscreteInputs\n\nModbus function code 02\n\nFunction&nbsp;**ReadDiscreteInputs**(SlaveID As Integer, Address As Long, Quantity As Integer, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity:**&nbsp;The number of data. 1 to 2000\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\n#### 15.4.3. ReadHoldingRegisters\n\nModbus function code 03\n\nFunction&nbsp;**ReadHoldingRegisters**(SlaveID As Integer, Address As Long, Quantity As Integer, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity:**&nbsp;The number of data. 1 to 125\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\n#### 15.4.4. ReadInputRegisters\n\nModbus function code 04\n\nFunction&nbsp;**ReadInputRegisters**(SlaveID As Integer, Address As Long, Quantity As Integer, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity:**&nbsp;The number of data. 1 to 125\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\n### 15.5. Automation Write Functions\n\nThe write functions write the values stored in the array filled by the properties. The below Write function do not create a data window. To create a data window use the Win functions e.g.&nbsp;[WriteMultipleRegistersWin](https:\/\/www.modbustools.com\/mbpoll-user-manual.html#_writemultipleregisterswin).\n\n#### 15.5.1. WriteSingleCoil\n\nModbus function code 05.\nWrites the first coil stored in the write array.\n\nFunction&nbsp;**WriteSingleCoil**(SlaveID As Integer, Address As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 0 to 255\n**Address:**&nbsp;The data address (Base 0)Return value\n\nTrue if the write array is ready and the data is sent. False if the array is empty or error in the parameters.\nThe controlling application is responsible for verifying the write operation by reading back the value written.\n\n#### 15.5.2. WriteSingleRegister\n\nModbus function code 06.\nWrites the first register stored in the write array.\n\nFunction&nbsp;**WriteSingleRegister**&nbsp;(SlaveID As Integer, Address As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 0 to 255\n**Address:**&nbsp;The data address (Base 0)Return value\n\nTrue if the write array is ready and the data is sent. False if the array is empty or error in the parameters.\nThe controlling application is responsible for verifying the write operation by reading back the value written.\n\n#### 15.5.3. WriteMultipleCoils\n\nModbus function code 15.\nWrite the coils stored in the write array.\n\nFunction&nbsp;**WriteMultipleCoils**(SlaveID As Integer, Address As Long, Quantity As Integer) As IntegerReturn value\n\nTrue if the write array is ready and the data is sent. False if the array is empty or error in the parameters.\nThe controlling application is responsible for verifying the write operation by reading back the values written.Parameters\n\n**SlaveID:**&nbsp;The slave address 0 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity**&nbsp;The number of data. 1 to 1968\n\n#### 15.5.4. WriteMultipleRegisters\n\nModbus function code 16.\nWrite the registers stored in the write array.\n\nFunction&nbsp;**WriteMultipleRegisters**(SlaveID As Integer, Address As Long, Quantity As Integer) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 0 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity:**&nbsp;The number of data. 1 to 123Return value\n\nTrue if the write array is ready and the data is sent. False if the array is empty or error in the parameters.\nThe controlling application is responsible for verifying the write operation by reading back the value written.\n\n#### 15.5.5. Python example\n\nPython example how to create a window that read 10 registers from address 0 (40001) and then write 5 registers.\n\nPython example\n\n```\nimport sys\nimport time\nimport win32com.client as win32\n\nApp = win32.Dispatch('Mbpoll.Application')\n\nApp.Connection = 1            # TCP\/IP connection\nApp.IPAddress = &quot;127.0.0.1&quot;\n\nApp.ResponseTimeout = 1000    # Wait 1000ms until give up\nApp.DelayBetweenPolls = 20    # Ensure minimum 20 ms gap until next request\nApp.ConnectTimeout = 500      # Wait 500ms until give up\n\nApp.ServerPort = 502\nresult = App.OpenConnection\n\nif result != 0:\n   print(&quot;Connection failed. Error: &quot;, result)\n   sys.exit()\n\n#Create a Modbus display window called Win1\nWin1 = win32.Dispatch(&quot;Mbpoll.Document&quot;)\n\n# Read 10 holding registers from slave ID 1, address 0 (40001) every 1000ms\nWin1.ReadHoldingRegisters(1, 0, 10, 1000)\n# Show the Modbus window\nWin1.ShowWindow()\n# Show 10 rows\nWin1.Rows(0)\n# Resize the window to fit to the grid\nWin1.ResizeWindow()\n\ntime.sleep(1.0) # Wait until read is done\n\nif Win1.ReadResult == 0:    # Check read result\n   print(&quot;Modbus register 0 (40001) = &quot;, Win1.SRegisters(0))\nelse:\n   print(&quot;Read failed error: = &quot;, Win1.ReadResult)\n\nprint (&quot;Tx count = %d, Rx count = %d&quot; % (Win1.GetTxCount, Win1.GetRxCount))\n\n# Prepare the internal array in Modbus Poll with data to write\nWin1.SRegisters(0, 1)   # Note that parameter 1 is not a\nWin1.SRegisters(1, 10)  # Modbus address but an index to the array\nWin1.SRegisters(2, 100)\nWin1.SRegisters(3, 1000)\nWin1.SRegisters(4, 10000)\n# Write the registers. This function do not create a window in Modbus Poll\n# Use the function &lt;&lt;WriteMultipleRegistersWin&gt;&gt; to create a data window\nWin1.WriteMultipleRegisters (1, 0, 5)\n\n_ = input(&quot;Wait for write Press ENTER:&quot;)\n\nif Win1.WriteResult == 0:    # Check write result\n   print(&quot;Modbus write success&quot;)\nelse:\n   print(&quot;Write failed error: = &quot;, WriteResult)\n\n_ = input(&quot;Press ENTER to quit:&quot;)\n```\n\n### 15.6. Various Functions\n\nVarious functions are associated with a Modbus Poll document. (The window with data)\n\n#### 15.6.1. ShowWindow\n\nAs default Modbus document windows are hidden. The ShowWindow function makes Modbus Poll visible and shows the document with data content.\n\nFunction&nbsp;**ShowWindow**()Parameters\n\nThis function has no parameters.Return value\n\nNone\n\n#### 15.6.2. GetTxCount\n\nGets the number of requests.\n\nFunction&nbsp;**GetTxCount**() As LongParameters\n\nThis function has no parameters.Return value\n\nThe number of requests.\n\n#### 15.6.3. GetRxCount\n\nGets the number of response.\n\nFunction&nbsp;**GetRxCount**() As LongParameters\n\nThis function has no parameters.Return value\n\nThe number of response.\n\n#### 15.6.4. GetName\n\nGets the name of a value.\n\nFunction&nbsp;**GetName**(Index As Integer) As StringParameters\n\n**Index:**&nbsp;Index 0 corresponds to the first Modbus address.Return value\n\nThe name.\n\n#### 15.6.5. SetName\n\nChanges the name of a value. Function&nbsp;**SetName**(Index As Integer, Name As String)Parameters\n\n**Index:**&nbsp;Index 0 corresponds to the first Modbus address.\n**Name:**&nbsp;The name of the value cell.Return value\n\nNone\n\n#### 15.6.6. FormatAll\n\nFormat all value cells with the selected format.\n\nFunction&nbsp;**FormatAll**(Format As Integer)Parameters\n\n**Format:**&nbsp;The format of the value cell.Return value\n\nNone\n\n#### 15.6.7. GetFormat\n\nGets the display format of the Modbus value.\n\nFunction&nbsp;**GetFormat**(Index As Integer) As IntegerParameters\n\n**Index:**&nbsp;Index 0 corresponds to the first Modbus address.\nReturn value\n\n**ID****Format**0Signed1Unsigned2Hex3Binary4Float little-endian byte swap5Float big-endian6Double little-endian byte swap7Double big-endian832-bit Signed little-endian byte swap932-bit Signed big-endian10Float little-endian11Float big-endian byte swap12Double little-endian13Double big-endian byte swap1432-bit Signed little-endian1532-bit Signed big-endian byte swap1732-bit Unsigned big-endian1832-bit Unsigned little-endian byte swap1932-bit Unsigned big-endian byte swap2032-bit Unsigned little-endian2164-bit Signed big-endian2264-bit Signed little-endian byte swap2364-bit Signed big-endian byte swap2464-bit Signed little-endian2564-bit Unsigned big-endian2664-bit Unsigned little-endian byte swap2764-bit Unsigned big-endian byte swap2864-bit Unsigned little-endian\n\nThis setting is only for display. You still need to use byteOrder to get the correct endianness when using Get\/Set value functions.\n\n#### 15.6.8. SetFormat\n\nChange the display format of the Modbus values. See Format values above.\n\nFunction&nbsp;**SetFormat**(Index As Integer, Format As Integer)Parameters\n\n**Index:**&nbsp;Index 0 corresponds to the first Modbus address.\n**Format:**&nbsp;The format of the value cell.Return value\n\nNone\n\n#### 15.6.9. ResizeWindow\n\nResize an opened window to fit the grid.\n\nFunction&nbsp;**ResizeWindow**()Parameters\n\nThis function has no parameters.Return value\n\nNone\n\n#### 15.6.10. ResizeAllColumns\n\nResize all columns to fit the values inside the cells.\n\nFunction&nbsp;**ResizeAllColumns**()Parameters\n\nThis function has no parameters.Return value\n\nNone\n\n#### 15.6.11. Rows\n\nSpecify the number of rows in the grid.\n\nFunction&nbsp;**Rows**(NumberRows)Parameters\n\n**NumberRows:**&nbsp;Number of rows in the grid.\n\n**ID****Description**010 Rows (Default)120 Rows250 Rows3100 Rows4Fit to quantity\n\nReturn value\n\nNone\n\n#### 15.6.12. ReadResult\n\nUse this property to check if communication established with Read is running successful.\n\nProperty&nbsp;**ReadResult**&nbsp;As IntegerParameters\n\nThis function has no parameters.Return value\n\nErrorDescription0SUCCESS1TIMEOUT ERROR2CRC ERROR3RESPONSE ERROR (The response was not the expected slave id, function or address)4WRITE ERROR5READ ERROR6PORT NOT OPEN ERROR10DATA UNINITIALIZED11INSUFFICIENT BYTES RECEIVED16BYTE COUNT ERROR19TRANSACTION ID ERROR81hILLEGAL FUNCTION82hILLEGAL DATA ADDRESS83hILLEGAL DATA VALUE84hSERVER DEVICE FAILURE85hACKNOWLEDGE86hSERVER DEVICE BUSY87hNAK-NEGATIVE ACKNOWLEDGMENT8AhGATEWAY PATH UNAVAILABLE8BhGATEWAY TARGET DEVICE FAILED TO RESPOND\n\n#### 15.6.13. WriteResult\n\nUse this function to check if a write was successful.\nThe value is DATA_UNINITIALIZED until the result from the slave is available. See&nbsp;[ReadResult](https:\/\/www.modbustools.com\/mbpoll-user-manual.html#_readresult)&nbsp;for a list of possible values.\n\nProperty&nbsp;**WriteResult**&nbsp;As IntegerReturn value\n\nReturn a write result as an integer.\n\n#### 15.6.14. Save\n\nSave the current Window. Function&nbsp;**Save**(PathName As String) As BooleanParameters\n\n**PathName:**&nbsp;The fully qualified path to which the file should be saved.Return value\n\nBoolean\n\nExample\n\n```\n' First a Modbus Poll document is needed.\nPublic doc As Object\n\nSet doc = CreateObject(&quot;Mbpoll.Document&quot;)\nres = doc.ReadCoils(1, 0, 100, 1000) ' Read 100 coils every 1000ms\nres = doc.Save(&quot;C:\\Users\\UserName\\Desktop\\testfile.mbp&quot;)\n```\n\n### 15.7. Automation data properties\n\nThe below properties are used to set or get values in the internal write\/read arrays in Modbus Poll. The Index used is not a Modbus Address. The Index always counts from 0 no matter of the address used. The data properties are associated with a Modbus Poll document. (The window with data)\n\n**There are 2 version of each data properties:**\n\n- One with no postfix such as&nbsp;**SRegisters**&nbsp;which is used to set or get a value from the internal write\/read array.\n\n- One with Win as postfix such as&nbsp;**SRegistersWin**&nbsp;which is used to set or get a value direct from the data window. This is used when the data window is used for a Write function e.g.&nbsp;[WriteMultipleRegistersWin](https:\/\/www.modbustools.com\/mbpoll-user-manual.html#_writemultipleregisterswin).\n\n**Example 1:**\n\n```\n' doc is assumed created first. See Excel example.\n' Writes 1 to index 0 in the data array used for the Write function later\ndoc.SRegisters(0) = 1\ndoc.SRegisters(1) = 10\ndoc.SRegisters(2) = 1234\n' Write 3 registers stored in Modbus Poll internal array\n' to Modbus address 100 (40101)\n' A window is not created\nres = doc.WriteMultipleRegisters(1, 100, 3)\n' The above example do not create a data window but just make a single Modbus write.\n```\n\n**Example 2 with floating point values:**\nWrite 3 floating point values.\n\n```\n' doc is assumed created first. See Excel example.\ndoc.Floats(0) = 1.3\ndoc.Floats(2) = 10.5\ndoc.Floats(4) = 1234.12\n' Write the 6 register stored in Modbus Poll\nres = doc. WriteMultipleRegisters(1, 0, 6)\n' 6 Registers are written as a floating point value is 32 bit wide.\n```\n\n**Example 3:**\nCreate a window that writes 3 registers.\n\n```\n' doc is assumed created first. See Excel example.\n' A window is created that writes the content every 1000ms\nres = doc.WriteMultipleRegistersWin(1, 100, 3, 1000)\n' Writes 1 to the first cell in the data window\ndoc.SRegistersWin(0) = 1\ndoc.SRegistersWin(1) = 10\ndoc.SRegistersWin(2) = 1234\n' Now the 3 registers are written to slave id 1 address 100 every 1000ms\n```\n\n#### 15.7.1. Coils, CoilsWin\n\nProperty&nbsp;**Coils**(Index As Integer) As IntegerDescription\n\nSets a coil in the write array structure or return a coil from the read array.Syntax\n\n**Coils**(Index) [=newvalue]\n\n#### 15.7.2. SRegisters, SRegistersWin\n\nProperty&nbsp;**SRegisters**(Index As Integer) As IntegerDescription\n\nSets a register in the write array structure or return a register from the read array.Syntax\n\n**SRegisters**(Index) [=newvalue]\n\n#### 15.7.3. URegisters, URegistersWin\n\nProperty&nbsp;**URegisters**(Index As Integer) As LongDescription\n\nSets a register in the write array structure or return a register from the read array.Syntax\n\n**URegisters**(Index) [=newvalue]\n\n#### 15.7.4. Ints_32, Ints_32Win\n\nProperty&nbsp;**Ints_32**(Index As Integer) As DoubleDescription\n\nSets a 32-bit integer in the write array structure or return an integer from the read array.Syntax\n\n**Ints_32**(Index) [=newvalue]\n\n#### 15.7.5. UInts_32, UInts_32Win\n\nProperty&nbsp;**UInts_32**(Index As Integer) As DoubleDescription\n\nSets a 32-bit unsigned integer in the write array structure or return an unsigned integer from the read array.Syntax\n\n**UInts_32**(Index) [=newvalue]\n\n#### 15.7.6. Ints_64, Ints_64Win\n\nProperty&nbsp;**Ints_64**(Index As Integer) As DoubleDescription\n\nSets a 64-bit integer in the write array structure or return an integer from the read array.Syntax\n\n**Ints_64**(Index) [=newvalue]\n\n#### 15.7.7. UInts_64, UInts_64Win\n\nProperty&nbsp;**UInts_64**(Index As Integer) As DoubleDescription\n\nSets a 64-bit unsigned integer in the write array structure or return an unsigned integer from the read array.Syntax\n\n**UInts_64**(Index) [=newvalue]\n\n#### 15.7.8. Floats, FloatsWin\n\nProperty&nbsp;**Floats**(Index As Integer) As SingleDescription\n\nSets a float in the write array structure or returns a float from the read array.Syntax\n\n**Floats**(Index) [=newvalue]\n\n#### 15.7.9. Doubles, DoublesWin\n\nProperty&nbsp;**Doubles**(Index As Integer) As DoubleDescription\n\nSets a double in the write array structure or return a double from the read array.Syntax\n\n**Doubles**(Index) [=newvalue]\n\n#### 15.7.10. ByteOrder\n\nProperty&nbsp;**ByteOrder**&nbsp;As IntegerDescription\n\nSets the byte order used by Ints_32, UInts_32, Ints_64, UInts_64, Floats and Doubles properties.\nThe Win versions do not use this Property&nbsp;**ByteOrder**.\n\n**ID****Endianness**0Big-endian (Default)1Little-endian byte swap2Big-endian byte swap3Little-endian\n\n**Example for Ints_32:**\nByte Order: Big-endian\nThe decimal number 123456789 or in hexadecimal 07 5B CD 15\nOrder as they come over the wire in a Modbus message: 07 5B CD 15Syntax\n\n**ByteOrder**&nbsp;[=newvalue]\n\n### 15.8. Write Functions (Create a data window)\n\nThe following functions do the same as you set up in the read\/write definition dialog (F8).\nThe functions creates a data window and the data content in the data windows is written according to the scan rate.\n\n#### 15.8.1. WriteSingleCoilWin\n\nModbus function code 05.\n\nFunction&nbsp;**WriteSingleCoilWin**(SlaveID As Integer, Address As Long, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\n#### 15.8.2. WriteSingleRegisterWin\n\nModbus function code 06.\n\nFunction&nbsp;**WriteSingleRegisterWin**(SlaveID As Integer, Address As Long, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\nPython Example how to open a window and write a single register every 1000 ms\n\n```\nimport win32com.client as win32\n\nSIGNED = 0\n\nApp = win32.Dispatch('Mbpoll.Application')\n\nApp.Connection = 1\nApp.IPAddress = &quot;127.0.0.1&quot;\n\nApp.ServerPort = 502\nApp.OpenConnection\n\n#Create a Modbus display window called Win1\nWin1 = win32.Dispatch(&quot;Mbpoll.Document&quot;)\n\n# Write 1 holding registers to slave ID 1, address 0 (40001) every 1000 ms\nWin1.WriteSingleRegisterWin(1, 0, 1000)\n# Show the Modbus window\nWin1.ShowWindow()\n\n# Fit rows to quantity\nWin1.Rows(4)\n\n# Disable refresh for speed\nWin1.EnableRefresh = False\n\n# This sets how the value is displayed\nWin1.SetFormat(0, SIGNED)\n\n# Set the Name of the register\nWin1.SetName(0, &quot;Setting&quot;)\n\n# Set the value to write\nWin1.SRegistersWin(0, 100)\nWin1.EnableRefresh = True\n\nWin1.ResizeAllColumns ()\nWin1.ResizeWindow()\n\n_ = input(&quot;Press ENTER to quit:&quot;)\n```\n\n#### 15.8.3. WriteMultipleCoilsWin\n\nModbus function code 15.\n\nFunction&nbsp;**WriteMultipleCoilsWin**(SlaveID As Integer, Address As Long, Quantity As Integer, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity:**&nbsp;The number of data. 1 to 1968\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\n#### 15.8.4. WriteMultipleRegistersWin\n\nModbus function code 16.\n\nFunction&nbsp;**WriteMultipleRegistersWin**(SlaveID As Integer, Address As Long, Quantity As Integer, ScanRate As Long) As IntegerParameters\n\n**SlaveID:**&nbsp;The slave address 1 to 255\n**Address:**&nbsp;The data address (Base 0)\n**Quantity:**&nbsp;The number of data. 1 to 123\n**ScanRate:**&nbsp;0 to 3600000msReturn value\n\nTrue if success. False if not success\n\n## 16. Exception and error messages\n\nModbus Exceptions and error messages are displayed in red text in the 2nd&nbsp;line in each window.\n\n![Error line](https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/10\/20231013172601478.png)\n\n### 16.1. Modbus Exception Codes\n\nModbus exceptions are errors returned from the slave device.\n\nCodeNameMeaning01Illegal FunctionThe function code received in the query is not an allowable action for the server (or slave). This may be because the function code is only applicable to newer devices, and was not implemented in the unit selected. It could also indicate that the server (or slave) is in the wrong state to process a request of this type, for example because it is not configured and is being asked to return register values.02Illegal Data AddressThe data address received in the query is not an allowable address for the server. More specifically, the combination of reference number and transfer length is invalid. For a controller with 100 registers, the PDU addresses the first register as 0, and the last one as 99. If a request is submitted with a starting register address of 96 and a quantity of registers of 4, then this request will successfully operate (address-wise at least) on registers 96, 97, 98, 99. If a request is submitted with a starting register address of 96 and a quantity of registers of 5, then this request will fail with Exception Code 0x02 \u201cIllegal Data Address\u201d since it attempts to operate on registers 96, 97, 98, 99 and 100, and there is no register with address 100.03Illegal Data ValueA value contained in the query data field is not an allowable value for the server (or slave). This indicates a fault in the structure of the remainder of a complex request, such as that the implied length is incorrect. It specifically does NOT mean that a data item submitted for storage in a register has a value outside the expectation of the application program, since the MODBUS protocol is unaware of the significance of any particular value of any particular register.04Server Device FailureAn unrecoverable error occurred while the server (or slave) was attempting to perform the requested action.05AcknowledgeSpecialized use in conjunction with programming commands.\nThe server (or slave) has accepted the request and is processing it, but a long duration of time will be required to do so. This response is returned to prevent a timeout error from occurring in the client (or master). The client (or master) can next issue a Poll Program Complete message to determine if processing is completed.06Server Device BusySpecialized use in conjunction with programming commands.\nThe server (or slave) is engaged in processing a long\u2013duration program command. The client (or master) should retransmit the message later when the server (or slave) is free.0AGateway Path UnavailableSpecialized use in conjunction with gateways, indicates that the gateway was unable to allocate an internal communication path from the input port to the output port for processing the request. Usually means that the gateway is misconfigured or overloaded.0BGateway Target Device Failed to RespondSpecialized use in conjunction with gateways, indicates that no response was obtained from the target device. Usually means that the device is not present on the network.\n\n### 16.2. Modbus Poll error messages\n\nError messageMeaningTimeout ErrorThe response is not received within the expected time. Check the following:Serial ConnectionSerial settings such as Baud rate, parity, Data bits, Stop bits etc.Modbus mode, RTU or ASCIISlave IDResponse timeoutTCP\/IP ConnectionResponse timeoutCheck that Host and Port are consistent with the slaveResponse ErrorThe response is not the expected one. Different slave ID.CRC ErrorThe CRC value of the received response is not correct.Write ErrorThis is an error reported by the serial driver. This could happen if a USB\/RS232\/485 converter is used and the USB cable is unplugged. There are 4 types:Break conditionI\/O errorSerial connection errorOutput buffer overflowWrite error using TCP\/IP connection is normally caused by lost connection.Read ErrorThis is an error reported by the serial driver. There are 6 types:Framing errorCharacter buffer overrunParity errorInput buffer overflowI\/O errorBreak conditionRead error using TCP\/IP connection is normally caused by lost connection.Insufficient bytes receivedThe response is not the expected length.Byte count errorThe byte count in the response is not correct. Compared to the expected.Transaction ID errorIt is used for transaction pairing, the MODBUS server copies in the response the transaction identifier of the request.\n\n---\n*modbus.cn*\n"