收藏 分享(赏)

ModbusPoll手册.pdf

上传人:精品资料 文档编号:9445747 上传时间:2019-08-08 格式:PDF 页数:39 大小:760.97KB
下载 相关 举报
ModbusPoll手册.pdf_第1页
第1页 / 共39页
ModbusPoll手册.pdf_第2页
第2页 / 共39页
ModbusPoll手册.pdf_第3页
第3页 / 共39页
ModbusPoll手册.pdf_第4页
第4页 / 共39页
ModbusPoll手册.pdf_第5页
第5页 / 共39页
点击查看更多>>
资源描述

1、 Witte Software Modbus Poll User manual Modbus Master Simulator February 2014 Modbus Poll version 6.0 Copyright: Witte Software, 2002 -2014 http:/ http:/ 2 Modbus Poll User manual Table of content 1 Modbus Poll . 5 2 Modbus Poll Features 6 2.1 Connections . 6 2.2 Supported Modbus Functions . 6 2.3 D

2、ata logging . 6 2.4 Display formats 6 2.5 Miscellaneous features 6 3 Overview 7 3.1 Help from anywhere 7 3.2 Alias cells . 7 3.3 Value cells 8 3.4 Change color and font . 8 3.5 Open a new window 9 4 Connection dialog 10 4.1 Connection. 10 4.2 Serial Settings 11 4.3 Mode . 11 4.4 Response timeout 11

3、4.5 Min delay between polls . 11 4.6 Remote Server . 11 4.7 Advanced settings 11 4.7.1 RTS Toggle 11 4.7.2 DSR . 11 4.7.3 CTS . 12 4.7.4 Remove Echo . 12 5 Read/Write definition 13 5.1 Slave ID 13 5.2 Function code 13 5.2.1 Read functions . 13 5.2.2 Write functions 14 5.3 Address 14 5.3.1 Protocol/m

4、essage address 14 5.3.2 Device address . 14 5.3.3 5 digits vs. 6 digits addressing . 14 5.4 Address examples 14 5.4.1 Read Holding Registers 14 5.4.2 Read Discrete Inputs 15 5.5 Scan rate 15 5.6 Read/Write Disabled . 15 5.6.1 Disable on error . 15 5.7 Hide alias columns . 15 5.8 Address in cell 15 5

5、.9 PLC Addresses (Base 1) 16 5.10 Rows 16 6 Display formats 17 6.1 Native Modbus registers . 17 6.2 32 bit long 17 6.3 32 bit floating 17 6.4 64 bit double 17 7 Save/Open Workspace 18 8 Test center . 19 http:/ 3 Modbus Poll User manual 8.1 ASCII Example 19 8.2 TCP/IP Example 19 8.3 Test center strin

6、g file . 19 8.3.1 Content of a string list . 19 8.4 Copy . 19 9 Modbus Data logging . 20 9.1 Text file 20 9.1.1 Log Rate . 20 9.1.2 Delimiters 20 9.1.3 Log if data changed only 20 9.1.4 Log Errors . 20 9.1.5 Log Date . 21 9.1.6 Start Log when ok is pressed . 21 9.1.7 Start Log when *mbp is opened 21

7、 9.1.8 Flush to file immediately . 21 9.1.9 Append 21 9.2 Microsoft Excel 22 9.2.1 Log Rate . 22 9.2.2 Header information . 22 10 Communication traffic . 24 11 OLE/Automation 25 11.1 Excel example 25 11.1.1 Excel 2007 25 11.1.2 Excel 2010 25 11.1.3 Excel sample code 26 11.2 Connection Functions/Prop

8、erties 27 11.2.1 Connection . 27 11.2.2 BaudRate . 27 11.2.3 DataBits 27 11.2.4 Parity 28 11.2.5 StopBits 28 11.2.6 SerialPort . 28 11.2.7 ResponseTimeout 28 11.2.8 ServerPort 28 11.2.9 ConnectTimeout 29 11.2.10 IPVersion 29 11.2.11 OpenConnection 29 11.2.12 CloseConnection 30 11.3 Read Functions 31

9、 11.3.1 ReadCoils . 31 11.3.2 ReadDiscreteInputs . 31 11.3.3 HoldingRegisters 31 11.3.4 InputRegisters 32 11.3.5 ShowWindow . 32 11.3.6 Byte order 32 11.3.7 ReadResult . 33 11.3.8 WriteResult 33 11.4 Automation data properties 34 11.4.1 Coil . 34 11.4.2 Signed Register 34 11.4.3 Unsigned Register 34

10、 11.4.4 Long . 35 http:/ 4 Modbus Poll User manual 11.4.5 Float . 35 11.4.6 Double . 35 11.5 Automation Write Functions . 36 11.5.1 WriteSingleCoil 36 11.5.2 WriteSingleRegister . 36 11.5.3 WriteMultipleCoils . 36 11.5.4 WriteMultipleRegisters . 37 12 Exception and error messages 38 12.1 Modbus Exce

11、ptions . 38 12.2 Modbus Poll error messages . 39 http:/ 5 Modbus Poll User manual 1 Modbus Poll Modbus Poll is an easy to use Modbus master simulator developed for many purposes. Among others: Designers of Modbus slave devices for quick and easy testing of protocol interface Automation engineers tha

12、t need to test Modbus devices or networks on site Service engineers that want to read out and/or change specific service data from a device Change Modbus registers in a slave device Log data from Modbus devices Troubleshooting and compliance testing http:/ 6 Modbus Poll User manual 2 Modbus Poll Fea

13、tures 2.1 Connections Modbus Poll read/write data from devices using: Modbus RTU or ASCII on RS232 or RS485 networks. (USB/RS232/485 Converter) Modbus TCP/IP Modbus Over TCP/IP. (Modbus RTU/ASCII encapsulated in a TCP packet) Modbus UDP/IP Modbus over UDP/IP. (Modbus RTU/ASCII encapsulated in a UDP

14、packet) 2.2 Supported Modbus Functions 01: Read coils 02: Read discrete inputs 03: Read holding registers 04: Read input registers 05: Write single coil 06: Write single register 15: Write multiple coils 16: Write multiple registers 17: Report slave ID 22: Mask write register 23: Read/Write register

15、s 2.3 Data logging Log data to a text file Log data direct into Excel 2.4 Display formats Each cell can be individual formatted. Signed 16 bit register Unsigned 16 bit register Hex Binary 32 bit long with any word/byte order 32 bit float with any word/byte order 64 bit double float with any word/byt

16、e order 2.5 Miscellaneous features OLE/Automation for interfacing with Excel VB etc. Monitoring of data traffic Print and print preview Font and color selection http:/ 7 Modbus Poll User manual 3 Overview Modbus Poll uses a multiple document interface. That means several windows can be opened. Each

17、one with different data contents from different slave devices at the same time. This picture shows two open windows. One reading 10 Holding registers from address 4000 (44001) and another reading 10 Holding registers from address 2000 (42001). 3.1 Help from anywhere Press F1 and get context sensitiv

18、e help on a topic associated with the current selected item. SHIFT + F1 invokes a special “help mode” in which the courser turns into a help courser (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 he

19、lp on a topic that describes the selected item. 3.2 Alias cells Here you can type any text for designation of the value cells. You can also copy/paste text from Excel cells. http:/ 8 Modbus Poll User manual 3.3 Value cells Show the data values of the Modbus registers. If you double click a value cel

20、l 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. The check box “Close dialog on Response ok” is used to automatically close the dialog box when a value i

21、s 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. 3.4 Change color and font Select the cells to be changed and then right click. Then a context menu is shown with 3 options to change colors and

22、 font. http:/ 9 Modbus Poll User manual Colorize for better overview. 3.5 Open a new window To open another window you have 3 options: Press CTRL+N Select new in the file menu Press on the tool bar http:/ 10 Modbus Poll User manual 4 Connection dialog To open the connection dialog you have 2 options

23、: Press F3 Select connect from the connection menu 4.1 Connection There are 5 different connection types: 1. Serial: Modbus over serial line. RS232 or RS485. A USB serial converter can be used. 2. Modbus TCP/IP: Select TCP/IP if you want to communicate with a MODBUS TCP/IP network. In this case, sla

24、ve ID is the same as the Unit ID used in MODBUS TCP/IP. The port number is default 502. If 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. 3. Modbus UDP/IP: Select UDP/IP if you want to communicate with a MODBUS U

25、DP/IP network. This is the same as Modbus TCP/IP but the connection less UDP protocol is used instead. 4. Modbus RTU/ASCII over TCP/IP: This is a RTU or ASCII message send over a TCP/IP network instead of serial lines. 5. Modbus RTU/ASCII over UDP/IP: This is a RTU or ASCII message send over a UDP/I

26、P network instead of serial lines. http:/ 11 Modbus Poll User manual Note: Connection type 3-5 is not standard Modbus as specified by www.modbus.org but they are added for convenience. Depending on your selection some other settings will be grayed. 4.2 Serial Settings Use these parameters to set ser

27、ial port settings. They are only available if connection type is “Serial Port”. 4.3 Mode Use this option to select RTU or ASCII mode. Default RTU. 4.4 Response timeout Response timeout specifies the length of time that Modbus Poll should wait for a response from a slave device before giving up. Defa

28、ult is 1000ms. 4.5 Min delay between polls This setting ensures a minimum delay until next request is transmitted no matter of the scan rate. The resolution of this setting is approximately 15ms. Its possible on some computers to obtain better resolution but not all. Important: If you set this value

29、 lower than 20ms the 3.5 char time gap between response and a new request cant be guaranteed. This is because the Windows scheduler switch tasks every 10 - 20ms. 1. If you Polls 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

30、 gap. 2. In a TCP/IP network less than 20ms is ok. 3. Serial connection to only one slave device less than 20ms is ok. 4.6 Remote Server Remote server settings are only available when use an Ethernet connection. IP Address: Servers IP address. Default is local host 127.0.0.1 Port: Server port number

31、. Default 502 Connect Timeout: Max time to use to establish a connection. Default 1000 4.7 Advanced settings 4.7.1 RTS Toggle RTS 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. You can use th

32、is to switch direction if you have a 232/485 converter without automatic direction switch. Warning: The 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

33、 Windows and Linux. If it is switched off to 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 slaves message is corrupted and

34、the master will not recognize the message. 4.7.2 DSR DSR specify 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. http:/ 12 Modbus Poll User manual 4.7.3 CTS CTS specify whether th

35、e 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. The DTR will be enabled whenever the port is opened and disabled when the port is closed. 4.7.4 Remove Echo If your device or RS232/RS485

36、 converter echoes the chars just sent. http:/ 13 Modbus Poll User manual 5 Read/Write definition Use this command to define the data to be monitored for the active window. To open the Read/Write Definition dialog you have 3 options: Press F8 Select “Read/Write Definition” from the Setup menu Press o

37、n the tool bar 5.1 Slave ID Range 1 to 255. (MODBUS protocol specifications say 247). The value 0 is also accepted to communicate directly to a MODBUS/TCP or MODBUS/UDP device. 5.2 Function code You can select 1 of 8 function codes. 5.2.1 Read functions The data returned by the read functions are di

38、splayed on the grid window. 01: Read coils (0x) 02: Read discrete inputs (1x) 03: Read holding registers (4x) 04: Read input registers (3x) http:/ 14 Modbus Poll User manual 5.2.2 Write functions The write functions write the data displayed on the grid window. 05: Write single coil (Writes to Coil s

39、tatus) 06: Write single register (Writes to Holding registers) 15: Write multiple coils (Writes to Coils) 16: Write multiple registers (Writes to Holding registers) 5.3 Address Addresses in the Modbus protocol are confusing! Some protocol specifications use the protocol/message address and others us

40、e device addressing. 5.3.1 Protocol/message address Some 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. Modbus Poll use protoco

41、l/message address counting from 0 to 65535. 5.3.2 Device address Some 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 an

42、d 4x registers counts from 1. And even more confusing: 4x means function code 03 and 3x means function code 04! 5.3.3 5 digits vs. 6 digits addressing The address format 4x counts from 40001 to 49999. The next address is not 50000. In old days 9999 addresses was enough. There are cases where 9999 is

43、 not enough. Then a zero is added. 40101 become 400101 and so on. This is called 6 digits addressing or extended addressing. This 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. 5.4 Address example

44、s These examples show how to setup Modbus Poll if a specification use device addresses. 5.4.1 Read Holding Registers You 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”. - Slave ID = 2 - Function = ”0

45、3 Read Holding Registers (4x)” - Address = 10 (11 minus 1) - Quantity = 20 - Scan rate = 1000 http:/ 15 Modbus Poll User manual 5.4.2 Read Discrete Inputs You want to read 1000 coils from address 110201 from slave ID 4 every 500ms. From the “1” we know this is function 02 “Read Discrete Inputs” - Sl

46、ave ID = 5 - Function = ”02 Read Discrete Inputs (1x)” - Address = 10200 (10201 - 1) - Quantity = 1000 - Scan rate = 500 5.5 Scan rate The 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

47、 is used and 125 registers are requested the transaction time is roughly 8 + 2 + 250 + 2 = 262ms + the gap (3.5 char time) between the request and the response. In this case setting the scan rate at e.g. 100ms do not make sense as the transaction time is at least 262ms + delay in the slave (gap) + m

48、in time between polls. (Set in the connection dialog). 5.6 Read/Write Disabled The Read/Write Disabled check box 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. If Read/Write is disabled you can make single requests with the Read/Write Once button or press F6. 5.6.1 Disable on error The Disable on error check box is used to disable Read/Write in case of error. 5.7 Hide alias co

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报