完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>

|
Zero vs. One Based Addressing
If the address numbering convention for the device starts at one as opposed to zero, its value can be specified when defining the device'sparameters. By default, user-entered addresses will have one subtracted when frames are constructed to communicate witha Modbus device. If the device does not follow this convention, uncheck Use zero based addressing in Device Properties. For the appropriate application to obtain information on setting Device Properties, refer to the online help documentation. The default behavior follows the convention of the Modicon PLCs. Zero vs. One Based Bit Addressing within Registers Memory types that allow bits within Words can be referenced as a Boolean. The addressing notation for doing this is . Zero Based Bit Addressing within Registers (Default Setting/Checked) Data Type Bit Range Word Bits 0–15 One Based Bit Addressing within Registers (Unchecked) Data Type Bit Range Word Bits 1–16 Holding Register Bit Mask Writes When writing to a bit location within a holding register, the driver should only modify the bit of interest. Some devices support a special command to manipulate a single bit within a register (Function code hex 0x16 or decimal 22). If the device does not support this feature, the driver will need to perform a Read/Modify/Write operation to ensure that only the single bit is changed. Check this box if the device supports holding register bit access. The default setting is unchecked. When checked, the driver will use function code 0x16, irrespective of the setting for Use Modbus function 06 for single register writes. When unchecked, the driver will use either function code 0x06 or 0x10 depending on the selection for Use Modbus function 06 for single register writes. Note: When Modbus byte order is deselected, the byte order of the masks sent in the command will be Intel byte order. Use Modbus Function 06 or 16 The Modbus driver has the option of using two Modbus protocol functions to write Holding register data to the target device. In most cases, the driver switches between these two functions based on the number of registers being written. When writing a single 16-bit register, the driver will generally use the Modbus function 06. When writing a 32-bit value into two registers, the driver will use Modbus function 16. For the standard Modicon PLC the use of either of these functions is not a problem. There are, however, a large number of third party devices that have implemented the Modbus protocol. Many of these devices support only the use of Modbus function 16 to write to Holding registers regardless of the number of registers to be written. The Use Modbus function 06 selection forces the driver to use only Modbus function 16 if needed. This selection is checked by default, allowing the driver to switch between 06 and 16 as needed. If a device requires all writes to be done using only Modbus function 16, uncheck this selection. Note: For bit within word writes, the Holding Register Bit Mask Writes property takes precedenceover this property Use Modbus Function 06. If Holding Register Bit Mask Writes is selected, then function code 0x16 is used no matter what the selection for this property. If Holding Register Bit Mask Writes is not selected, either function code 0x06 or 0x10 will be used for bit within word writes. Use Modbus Function 05 or 15 The Modbus driver has the option of using two Modbus protocol functions to write output coil data to the target device. Inmost cases, the driver switches between these two functions based on the number of coils being written. When writing a single coil, the driver will use the Modbus function 05. When writing an array of coils, the driver will use Modbus function 15. For the standard Modicon PLC the use of either of these functions is not a problem. There are many third party devices that have implemented the Modbus protocol, however: many of these devices only support the use of Modbus function 15 to write to output coils regardless of the number of coils to be written. The Use Modbus function 05 selection forces the driver to use only Modbus function 15 if needed. This selection is checked by default, allowing the driver to switch between 05 and 15 as needed. If a device requires all writes to be done using only Modbus function 15, uncheck this selection. Mailbox Client Privileges for Mailbox Device Model •Read Only: Client applications can only read from a mailbox memory map. •Memory Map Writes: Client applications can read and write to the mailbox memory map. •Device Writes: Client applications can only write to a device; reads are from the memory map. ----- Data Encoding Group ----- Modbus Byte Order The byte order used by the Ethernet driver can be changed from the default Modbus byte ordering to Intel byte ordering byusing this selection. This selection will be checked by default, which is the normal setting for Modbus compatible devices. If the device uses Intel byte ordering, deselecting this selection will enable the Modbus driver to properly read Intel formatted data. First Word Low in 32-Bit Data Types Two consecutive registers' addresses in a Modbus device are used for 32-bit data types. It can be specified whether the driver shouldassume the first word is the low or the high word of the 32-bit value. The default, first word low, follows the convention of the Modicon Modsoft programming software. First DWord Low in 64-Bit Data Types Four consecutive registers' addresses in a Modbus device are used for 64-bit data types. It can be specified whether the driver should assume the first DWord is the low or the high DWord of the 64-bit value. The default, first DWord low, follows the default convention of 32-bit data types. Use Modicon Bit Ordering When checked, the driver will reverse the bit order on reads and writes to registers to follow the convention of the Modicon Modsoft programming software. For example, a write to address 40001.0/1 will affect bit 15/16 in the device when this option is enabled. This option is disabled (unchecked) by default. Note: For the following example, the 1st through 16th bit signifies either 0-15 bits or 1-16 bits depending on if the driver is set at Zero Based or One Based Bit Addressing within registers. MSB = Most Significant Bit LSB = Least Significant Bit Use Modicon Bit Ordering Checked MSB LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Use Modicon Bit Ordering Unchecked (DefaultSetting) MSB LSB 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Treat Longs as Double Precision Unsigned Decimal When checked, the driver encodes/decodes Long and DWORD data types as values that range from 0 to 99999999. This format specifies that each word represents a value between 0 and 9999. Values read above the specified range are not clamped, but the behavior is undefined. All read values are decoded using the following formula: [Read Value] = HighWord * 10000 + LowWord. Written values greater than 99999999 are clamped to the maximum value. All written values are encoded using the following formula: Raw Data = [Written Value]/10000 + [Written Value] % 10000. Data Encoding Options Details The following summarizes usage of the Data Encoding options. •Use default Modbus byte order option sets the data encoding of each register/16-bit value. •First word low in 32-bit data types option sets the data encoding of each 32-bit value and each double word of a 64-bit value. •First DWord low in 64-bit data types option sets the data encoding of each 64-bit value. Data Types Use Default Modbus Byte Order Applicable First Word Low in 32-Bit Data Types Applicable First DWord Low in 64-Bit Data Types Applicable Word, Short, BCD Yes No No Float, DWord, Long, LBCD Yes Yes No Double Yes Yes Yes If needed, use the following information and the device's documentation to determine the correct settings of the Data Encoding options. The default settings are acceptable for the majority of Modbus devices. Data Encoding Group Option Data Encoding Use default Modbus byte order Checked High Byte (15..8) Low Byte (7..0) Use default Modbus byte order Unchecked Low Byte (7..0) High Byte (15..8) First word low in 32-bit data types Unchecked High Word (31..16) High Word(63..48) of Double Word in 64-bit data types Low Word (15..0) Low Word (47..32) of Double Word in 64-bit data types First word low in 32-bit data types Checked Low Word (15..0) Low Word (47..32) of Double Word in 64-bit data types High Word (31..16) High Word (63..48) of Double Word in 64-bit data types First DWord low in 64-bit data types Unchecked High Double Word (63..32) Low Double Word (31..0) First DWord low in 64-bit data types Checked Low Double Word (31..0) High Double Word (63..32) |
|
|
|
|
|
|
|
54 浏览 0 评论
853 浏览 0 评论
637 浏览 0 评论
【团购】独家全套珍藏!龙哥LabVIEW视觉深度学习实战课(11大系列课程,共5000+分钟)
1874 浏览 0 评论
1431 浏览 1 评论
浏览过的版块 |
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-11 15:56 , Processed in 1.219967 second(s), Total 112, Slave 91 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖