Difference between revisions of "Modbus RTU Master Write Map Edit"

From Control Solutions IoTServer Documentation
Jump to navigation Jump to search
 
Line 1: Line 1:
 +
Modbus RTU Master Write Maps are where you configure this device to write to Modbus registers in other Modbus RTU devices, taking data to be written from local data objects. This page is where you enter the various parameters to make that happen.
  
To write Modbus RTU data to a slave device, you need to create a Write map. There is a form that needs to be filled in.  Here is the page for modifying a Write Map.
+
[[File:Modbus RTU write map edit 1.jpg]]
  
 +
'''Map Number''' – Used as a reference in the map list for ordering the maps. Polling is done in round robin fashion in the order of map number.
  
[[File:Modify RTU Write Map.png]]
+
[[File:Modbus write map edit 2.jpg]]
  
 +
'''Source Object''' – Specifies the local object number that contains the data that should be sent by this write map.
  
Here is a description for all of the fields that are on this page:
+
[[File:Modbus write map edit 3.jpg]]
  
[[File:Modify RTU Write LocObj.png]] - Here you select the local object that needs to be written from to the slave device.
+
'''Scale''' – Provides a scale factor if non-zero (has the effect of being 1 if zero). Data to be written is retrieved from the local object and then multiplied by this scale factor before being sent to the remote Modbus device. Applies to numeric values and numeric local objects only.
  
 +
'''Offset''' – Provides an offset to work in conjunction with scale factor. This value is added to the value retrieved from the local object (after being multiplied by scale) before being sent to the remote Modbus device. Applies to numeric values and numeric local objects only.
  
[[File:Modify RTU Read Map ScaleOffset.png]] - Provides a scale factor if non-zero (has the effect of being 1 if zero). Data to be written is retrieved from the local object and then multiplied by this scale factor before being sent to the remote Modbus device. Applies to numeric values and numeric local objects only.  The scale factor if non-zero (has the effect of being 1 if zero). Data to be written is retrieved from the local object and then multiplied by this scale factor before being sent to the remote Modbus device. Applies to numeric values and numeric local objects only.
+
[[File:Modbus write map edit 4.jpg]]
  
 +
'''Mask''' – A bit mask given as a 8-digit hexadecimal value, if non-zero. The mask operation skipped if mask value is zero, or register format is not Int (integer). When the data of interest is a single bit, or bit field less than the full register width, the Mask is used. The process used in a read operation is reversed here. First, the mask is right justified so that the least significant “1” bit is in the least significant data position. That mask is then logically ANDed with the data found in the local object. The result is then left justified back into the position originally indicated by the mask. This value is now ready to be written to the Modbus register, pending any additional operation such as the Fill mask.
  
[[File:Modify RTU Read Map Mask1.png]] - A bit mask given as a 4-digit or 8-digit hexadecimal value, if non-zero (Mask operation skipped if mask value is zero, or register format is not Int). When the data of interest is a single bit, or bit field less than the full register width, the Mask is used. The process used in a read operation is reversed here. First, the mask is right justified so that the least significant “1” bit is in the least significant data position. That mask is then logically ANDed with the data found in the local object. The result is then left justified back into the position originally indicated by the mask. This value is now ready to be written to the Modbus register, pending any additional operation such as the Fill mask.
+
'''Fill''' – An additional bit mask given as a 4-digit or 8-digit hexadecimal value. This mask is logically ORed with the result of the Mask operation before the final result is written to the Modbus register. The Fill mask has the effect of making sure certain bits in the register are always set.  
  
 +
NOTE: The order of operation is as follows, operating on data retrieved from the local object: (1) apply scale if nonzero; (2) apply offset; (3) apply mask if applicable; (4) apply fill if applicable; (5) write to Modbus register.
 +
 +
IMPORTANT: In order for the gateway to accumulate all data for a "packed" register using mask (and optionally fill) into a single write request, it is required that all write maps to the same register be in sequential (contiguous) order. If the write maps are split up such that multiple writes to the same register occur, then the later write will erase the content written by the earlier write.
 +
<hr>
 +
The appearance of the following line will vary depending on your user settings. You have the option of displaying Modbus registers as raw address (0-indexed), register number (1-indexed), or Modicon format (e.g. 40001 style).
 +
 +
The following variations all refer to exactly the same register:
 +
 +
[[File:Modbus write map edit 5a.jpg]]
 +
[[File:Modbus write map edit 5a-addr.jpg]]
 +
[[File:Modbus write map edit 5a-modicon.jpg]]
 +
 +
Click the Check to validate a Modicon number.
 +
<hr>
 +
The options available on this line will vary depending on selections made. The following are a few examples.
 +
 +
[[File:Modbus write map edit 5a.jpg]]
 +
[[File:Modbus write map edit 5b.jpg]]
 +
[[File:Modbus write map edit 5c.jpg]]
 +
[[File:Modbus write map edit 5d.jpg]]
 +
[[File:Modbus write map edit 5e.jpg]]
 +
 +
'''Register Type''' – Modbus register types available are listed in the following table. These labels are illustrated here as recognized in XML or CSV files, but are further annotated on the web page. 
  
[[File:Modify RTU Write Map Fill.png]] – An additional bit mask given as a 4-digit or 8-digit hexadecimal value. This mask is logically ORed with the result of the Mask operation before the final result is written to the Modbus register. The Fill mask has the effect of making sure certain bits in the register are always set.
+
{| class="wikitable"
 +
|-
 +
! Label !! Modbus Register type
 +
|-
 +
| “none” || No register defined
 +
|-
 +
| “Coil” || Coil
 +
|-
 +
| “Disc” || Discrete Input
 +
|-
 +
| “Input” || Input Register
 +
|-
 +
| “Hold” || Holding Register
 +
|}
  
 +
'''Register Number or Address''' – Enter the number (starting at 1) or raw address (starting at 0) as applicable. Do NOT enter 40001 for holding register 1 if you have not selected Modicon as the display format in your User Settings.
  
NOTE: The order of operation is as follows, operating on data retrieved from the local object: (1) apply scale if nonzero; (2) apply offset; (3) apply mask if applicable; (4) apply fill if applicable; (5) write to Modbus register.  
+
'''Modicon Register''' – Enter numbers like 40001 for the first holding register if you have selected Modicon representation in your User Settings.
  
 +
'''Register Format''' – Select the format of the data contained in the Modbus register(s). This is not used by the protocol, but is used by the gateway to interpret what the raw increments of 1 or 16 bits should mean. Select format from the following table.
  
[[File:Modify RTU Write Map Type.png]] - Here you select the register type that needs to be read from the slave device.  The Modbus register types supported are: None, Coil, Discrete Input, Input, and Holding registers.
+
{| class="wikitable"
 +
|-
 +
! Format Label !! Format description
 +
|-
 +
| “None” || No format defined
 +
|-
 +
| “Bit” || Single bit, used ONLY for Register Type Coil or Disc
 +
|-
 +
| “Int” || Integer (size and whether signed are defined by labels below)
 +
|-
 +
| “Real” || Floating point (single or double precision)
 +
|-
 +
| “Char” || Character string with 2 ASCII characters per register
 +
|-
 +
| “Mod10” || Mod10 format, can be 2, 3, or 4-register, specific to Schneider Electric meters
 +
|}
  
 +
'''Register Size''' – Register size refers to the number of consecutive input or holding registers that should be written for a value greater than 16 bits. A 16-bit value would have size of 1, a 32-bit value would have size of 2, and a 64-bit value would have size of 4. Single precision Real (32-bit IEEE 754 floating point) would be size 2, and double precision Real (64-bit IEEE 754 floating point) would be size 4. If format is Mod10, then valid sizes are 2, 3, or 4 – check manufacturer’s documentation if Mod10 is noted. Register “size” for a character string will be character count divided by 2 (plus 1 of string length is an odd number). Register Size is not used for Coil or Disc types.
  
[[File:Modify RTU Read Map SlvAddrs.png]] - This is the register address / number that is supposed to be written to the slave device. Depending on your user settings, you will either enter the Modbus register address (shown here), Modbus number, or use Modicon notation for this field.
+
'''Unsigned''' – Select signed or unsigned. Defaults to signed integer. Has no effect on RegFormat other than Int.  
  
[[File:Modify RTU Read Map Format.png]] - Here you enter the data format and size that should be used for this read.  The valid data types are Signed and Unsigned Integer (int), Floating point IEEE 754 format (Real), Character (Char) and Modd10 (mod10).  Some of these data types can of options associated with them.  Int can be signed or unsigned, and can have a length of 1, 2, or 4 registers long.  Real, can be either 2, or 4 registers long.
+
[[File:Modbus read map edit 3a.jpg]]
  
Notes:
+
'''Endian Selection''' – Used when Register Size is greater than 1 to indicate what order the registers should be interpreted in. Select "low" to indicate that the lowest numbered register contains the least significant portion of data. Select "high" to indicate that the lowest numbered register contains the most significant portion of data. Although Modbus protocol itself is not inherently “Little Endian”, many devices operate that way due to Intel processors being inherently Little Endian. Modbus protocol does not stipulate what the register order should be when multiple registers are treated as a single data entity. Therefore, the user is required to pay attention to this.
- Mod10 has the options of 2, 3, or 4 registers based on the definition of the format, check manufacturer’s documentation if Mod10 is noted. 
+
- Char can be upto 63 registers long.  Register “size” for a character string will be character count divided by 2 (plus 1 of string length is an odd number). RegSize is not used for Coil or Disc types.
+
[[File:Modbus RTU write map edit 6.jpg]]
- When RegSize is greater than 1 to indicate what order the registers should be interpreted in. Enter “Y” to indicate that the lowest numbered register contains the least significant portion of data. Enter “N” or omit to indicate that the lowest numbered register contains the most significant portion of data.
 
  
 +
'''Slave''' – Slave address that should be transmitted in the write request made on an RTU network.
  
[[File:Modify RTU Write Map Slave.png]] – Slave address that should be transmitted to on an RTU network.
+
[[File:Modbus write map edit 7.jpg]]
  
 +
'''Function code 5-6''' – Check this box to force single register writes to use Modbus function 5 to write a single coil, or function 6 to write a single holding register. Function codes will default to “write multiple” function codes 15 and 16 instead of 5 and 6 respectively if this box is not checked. This box only appears when the register count to be written is one. 
  
[[File:Modify RTU Write Map SlaveOrder.png]] = If the register type is greater than 1 you are able to select the order the registers are written.  Although Modbus protocol itself is not inherently “Little Endian”, many devices operate that way due to Intel processors being inherently Little Endian. Modbus protocol does not stipulate what the register order should be when multiple registers are treated as a single data entity. Therefore, the user is required to pay attention to this.
+
[[File:Modbus write map edit 8a.jpg]]
 +
[[File:Modbus write map edit 8b.jpg]]
  
 +
'''Send Periodic''' – Uncheck to disable, check to enable periodic writing of the Modbus register at the poll rate given by Poll Time.
  
<ins>Conditional controls for a write command:</ins>
+
'''Poll Time''' – Poll time in seconds, can be fractional. This poll time is not guaranteed to be met. Polling is done in round-robin fashion. In a very busy system, more than this time may expire before the next poll. If less than this time has expired, then the system will wait this amount of time until polling again. The sets the rate at which the remote Modbus register will bewritten, provided “Send Periodic” has been enabled. This poll time will be disregarded if Send Periodic is not enabled.
  
[[File:Modify RTU Write Map fc5-6.png]] - This will default to using Function Codes 15/16.  If Function Codes 5/6 are required enable this field.
+
[[File:Modbus write map edit 9a.jpg]]
 +
[[File:Modbus write map edit 9b.jpg]]
  
 +
'''Send On Delta''' – Uncheck to disable, or check to enable the “send on delta” feature where Modbus writes are made based on changes in the local object value (see delta below).
  
[[File:Modify RTU Write Map Repeat.png]] - If the data needs to be sent at a defined interval enable this field.  Time is defined in seconds (can be fractional).
+
'''Delta''' – Specifies the margin by which the local object value should change before sending another Modbus write request to the remote Modbus device. Once the changed value has been sent, the new local value is retained for future comparison in determining subsequent additional change. The delta value is disregarded if Send On Delta is not enabled. Note that a delta of zero is treated as a special case: Any update to the local object by any process will result in a new Modbus write request.  
  
 +
'''Min Quiet Time''' – Time in seconds, can be fractional. This specifies the mínimum amount of time that should elapse between sending of write requests for this write map. The minimum quiet time has the effect of throttling network traffic, especially where delta is a small value.
  
[[File:Modify RTU Write Chng By.png]] - If the register value has to change by a fixed amount before the value is written, enable this field.  You will then be asked to enter the minimum amount of time this data is to be valid
+
[[File:Modbus write map edit 10a.jpg]]
[[File:Modify RTU Write Map MinQuiet.png]]
+
[[File:Modbus write map edit 10b.jpg]]
  
 +
'''Send Max Quiet''' – Uncheck to disable or check to enable the Max Quiet Time feature. If disabled, the Max Quiet Time value will be disregarded.
  
[[File:Modify RTU Write Map MaxQuiet.png]] - Sets the maximum time before writing a value to the slave device.
+
'''Max Quiet Time''' – “Max Quiet” time in seconds, can be fractional. If the Modbus register has not been written either as a result of poll timing or value changing by delta within this time period, then write request will be made anyway. This specifies the maximum amount of time that should expire without any write to the Modbus register for any reason.
  
 +
[[File:Modbus write map edit 11.jpg]]
  
<ins>Conditional controls based on a local value for a write command:</ins>
+
'''Index Object''' – Optional, allows for selectively enabling this write operation. If an index object (local object number) is given, and its value matches the index value, then this write operation will take place. If an index object is given but the local object’s value does not match the index value, then this write operation will be skipped.
  
[[File:Modify RTU Read Map LocCompReg.png]] is provided, and its value matches the value entered
+
'''Index Value''' – Optional, used in conjunction with Index Object (see note above).
[[File:Modify RTU Read Map LocCompCond.png]] the write will happen.  If not, it is skipped.
 

Latest revision as of 16:14, 2 May 2019

Modbus RTU Master Write Maps are where you configure this device to write to Modbus registers in other Modbus RTU devices, taking data to be written from local data objects. This page is where you enter the various parameters to make that happen.

Modbus RTU write map edit 1.jpg

Map Number – Used as a reference in the map list for ordering the maps. Polling is done in round robin fashion in the order of map number.

Modbus write map edit 2.jpg

Source Object – Specifies the local object number that contains the data that should be sent by this write map.

Modbus write map edit 3.jpg

Scale – Provides a scale factor if non-zero (has the effect of being 1 if zero). Data to be written is retrieved from the local object and then multiplied by this scale factor before being sent to the remote Modbus device. Applies to numeric values and numeric local objects only.

Offset – Provides an offset to work in conjunction with scale factor. This value is added to the value retrieved from the local object (after being multiplied by scale) before being sent to the remote Modbus device. Applies to numeric values and numeric local objects only.

Modbus write map edit 4.jpg

Mask – A bit mask given as a 8-digit hexadecimal value, if non-zero. The mask operation skipped if mask value is zero, or register format is not Int (integer). When the data of interest is a single bit, or bit field less than the full register width, the Mask is used. The process used in a read operation is reversed here. First, the mask is right justified so that the least significant “1” bit is in the least significant data position. That mask is then logically ANDed with the data found in the local object. The result is then left justified back into the position originally indicated by the mask. This value is now ready to be written to the Modbus register, pending any additional operation such as the Fill mask.

Fill – An additional bit mask given as a 4-digit or 8-digit hexadecimal value. This mask is logically ORed with the result of the Mask operation before the final result is written to the Modbus register. The Fill mask has the effect of making sure certain bits in the register are always set.

NOTE: The order of operation is as follows, operating on data retrieved from the local object: (1) apply scale if nonzero; (2) apply offset; (3) apply mask if applicable; (4) apply fill if applicable; (5) write to Modbus register.

IMPORTANT: In order for the gateway to accumulate all data for a "packed" register using mask (and optionally fill) into a single write request, it is required that all write maps to the same register be in sequential (contiguous) order. If the write maps are split up such that multiple writes to the same register occur, then the later write will erase the content written by the earlier write.


The appearance of the following line will vary depending on your user settings. You have the option of displaying Modbus registers as raw address (0-indexed), register number (1-indexed), or Modicon format (e.g. 40001 style).

The following variations all refer to exactly the same register:

Modbus write map edit 5a.jpg Modbus write map edit 5a-addr.jpg Modbus write map edit 5a-modicon.jpg

Click the Check to validate a Modicon number.


The options available on this line will vary depending on selections made. The following are a few examples.

Modbus write map edit 5a.jpg Modbus write map edit 5b.jpg Modbus write map edit 5c.jpg Modbus write map edit 5d.jpg Modbus write map edit 5e.jpg

Register Type – Modbus register types available are listed in the following table. These labels are illustrated here as recognized in XML or CSV files, but are further annotated on the web page.

Label Modbus Register type
“none” No register defined
“Coil” Coil
“Disc” Discrete Input
“Input” Input Register
“Hold” Holding Register

Register Number or Address – Enter the number (starting at 1) or raw address (starting at 0) as applicable. Do NOT enter 40001 for holding register 1 if you have not selected Modicon as the display format in your User Settings.

Modicon Register – Enter numbers like 40001 for the first holding register if you have selected Modicon representation in your User Settings.

Register Format – Select the format of the data contained in the Modbus register(s). This is not used by the protocol, but is used by the gateway to interpret what the raw increments of 1 or 16 bits should mean. Select format from the following table.

Format Label Format description
“None” No format defined
“Bit” Single bit, used ONLY for Register Type Coil or Disc
“Int” Integer (size and whether signed are defined by labels below)
“Real” Floating point (single or double precision)
“Char” Character string with 2 ASCII characters per register
“Mod10” Mod10 format, can be 2, 3, or 4-register, specific to Schneider Electric meters

Register Size – Register size refers to the number of consecutive input or holding registers that should be written for a value greater than 16 bits. A 16-bit value would have size of 1, a 32-bit value would have size of 2, and a 64-bit value would have size of 4. Single precision Real (32-bit IEEE 754 floating point) would be size 2, and double precision Real (64-bit IEEE 754 floating point) would be size 4. If format is Mod10, then valid sizes are 2, 3, or 4 – check manufacturer’s documentation if Mod10 is noted. Register “size” for a character string will be character count divided by 2 (plus 1 of string length is an odd number). Register Size is not used for Coil or Disc types.

Unsigned – Select signed or unsigned. Defaults to signed integer. Has no effect on RegFormat other than Int.

Modbus read map edit 3a.jpg

Endian Selection – Used when Register Size is greater than 1 to indicate what order the registers should be interpreted in. Select "low" to indicate that the lowest numbered register contains the least significant portion of data. Select "high" to indicate that the lowest numbered register contains the most significant portion of data. Although Modbus protocol itself is not inherently “Little Endian”, many devices operate that way due to Intel processors being inherently Little Endian. Modbus protocol does not stipulate what the register order should be when multiple registers are treated as a single data entity. Therefore, the user is required to pay attention to this.

Modbus RTU write map edit 6.jpg

Slave – Slave address that should be transmitted in the write request made on an RTU network.

Modbus write map edit 7.jpg

Function code 5-6 – Check this box to force single register writes to use Modbus function 5 to write a single coil, or function 6 to write a single holding register. Function codes will default to “write multiple” function codes 15 and 16 instead of 5 and 6 respectively if this box is not checked. This box only appears when the register count to be written is one.

Modbus write map edit 8a.jpg Modbus write map edit 8b.jpg

Send Periodic – Uncheck to disable, check to enable periodic writing of the Modbus register at the poll rate given by Poll Time.

Poll Time – Poll time in seconds, can be fractional. This poll time is not guaranteed to be met. Polling is done in round-robin fashion. In a very busy system, more than this time may expire before the next poll. If less than this time has expired, then the system will wait this amount of time until polling again. The sets the rate at which the remote Modbus register will bewritten, provided “Send Periodic” has been enabled. This poll time will be disregarded if Send Periodic is not enabled.

Modbus write map edit 9a.jpg Modbus write map edit 9b.jpg

Send On Delta – Uncheck to disable, or check to enable the “send on delta” feature where Modbus writes are made based on changes in the local object value (see delta below).

Delta – Specifies the margin by which the local object value should change before sending another Modbus write request to the remote Modbus device. Once the changed value has been sent, the new local value is retained for future comparison in determining subsequent additional change. The delta value is disregarded if Send On Delta is not enabled. Note that a delta of zero is treated as a special case: Any update to the local object by any process will result in a new Modbus write request.

Min Quiet Time – Time in seconds, can be fractional. This specifies the mínimum amount of time that should elapse between sending of write requests for this write map. The minimum quiet time has the effect of throttling network traffic, especially where delta is a small value.

Modbus write map edit 10a.jpg Modbus write map edit 10b.jpg

Send Max Quiet – Uncheck to disable or check to enable the Max Quiet Time feature. If disabled, the Max Quiet Time value will be disregarded.

Max Quiet Time – “Max Quiet” time in seconds, can be fractional. If the Modbus register has not been written either as a result of poll timing or value changing by delta within this time period, then write request will be made anyway. This specifies the maximum amount of time that should expire without any write to the Modbus register for any reason.

Modbus write map edit 11.jpg

Index Object – Optional, allows for selectively enabling this write operation. If an index object (local object number) is given, and its value matches the index value, then this write operation will take place. If an index object is given but the local object’s value does not match the index value, then this write operation will be skipped.

Index Value – Optional, used in conjunction with Index Object (see note above).