Modbus RTU Master Write Map Edit

From Control Solutions IoTServer Documentation
Revision as of 01:53, 20 April 2019 by Markclark (talk | contribs)
Jump to navigation Jump to search

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:

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.


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).


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 Modify RTU Write Map MinQuiet.png


Modify RTU Write Map MaxQuiet.png - Sets the maximum time before writing a value to the slave device.


Conditional controls based on a local value for a write command:

Modify RTU Read Map LocCompReg.png is provided, and its value matches the value entered Modify RTU Read Map LocCompCond.png the write will happen. If not, it is skipped.