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

From Control Solutions IoTServer Documentation
Jump to navigation Jump to search
Line 42: Line 42:
  
  
Conditional controls for a write command:
+
<ins>Conditional controls for a write command:</ins>
  
 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Revision as of 01:32, 20 April 2019

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.


Modify RTU Write Map.png


Here is a description for all of the fields that are on this page:

Modify RTU Write LocObj.png - Here you select the local object that needs to be written from to the slave device.


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.


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.


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.


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.


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.


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.

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.

Notes: - 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. - 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.


Modify RTU Write Map Slave.png – Slave address that should be transmitted to on an RTU network.


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.


Conditional controls for a write command:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ RegFormat – Format of the data contained in the Modbus register(s), not used by the protocol, but 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 RegType 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

RegSize – Register size refers to the number of consecutive input or holding registers should be read 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). RegSize is not used for Coil or Disc types.

UseFC56 – Enter “Y” 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 “N” is entered or this column is omitted.

Unsigned – Indicate “Y” if unsigned, or “N” if signed. Defaults to signed integer. Has no effect on RegFormat other than Int.

LittleEnd – Used 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. 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.

SendPeriodic – Set to “N” to disable, or “Y” to enable periodic writing of the Modbus register at the poll rate given by PollTime.

PollTime – 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 “SendPeriodic” has been enabled. This poll time will be disregarded if SendPeriodic is not enabled.

SendMaxQuiet – Set to “N” to disable or “Y” to enable the MaxQuietTime feature. If disabled, the MaxQuietTime will be disregarded.

MaxQuietTime – “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.

SendOnDelta – Set to “N” to disable, or “Y” 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 SendOnDelta 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.

MinQuietTime – 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.

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

IndexVal – Optional, used in conjunction with IndexObj (see note above).