Modbus RTU Master Read Map Edit

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

To read Modbus RTU data from a slave device, you need to create a Read map. There is a form that needs to be filled in. Here is the page for modifying a Read Map.


Modify RTU Read Map.png


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

Modify RTU Read 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. Note: Selecting "None" effectively turns off this read rule, but does not delete it.


Modify RTU Read Map SlvAddrs.png - This is the register address / number that is supposed to be read from 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. 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.


Modify RTU Read Map Slave.png - This is the slave / unit number of the device you want to retrieve the data from.

When you select a size grater than 1, another drop box will show up and the choices are high and low - Modify RTU Read Map RegOrder.png - This determines the order of how the data should be read.


Once a register has been read, additional items, can be performed on the value read. This can be to: extract out a bit, or portion of the data, apply a scale factor, or apply an offset value to the value read, if needed.


Modify RTU Read Map Mask1.png - Is used to extract our data from the register. When the Modbus register is read, its data is bit-wise ANDed with the Mask, then right justified so that the least significant mask bit becomes the least significant data bit. The result is then placed in the local data object selected by the read map. This can be a single bit, all the way up to the entire register. The data entered here needs to be entered in Hexadecimal format. Often Modbus may have each bit in an Unsigned Integer value represent a single status bit. This allows one register to contain sixteen individual values. Another usage of this would be if the 16-bit register actually contained two 8-bit values. One in the lower half of the register, the other in the upper half of the register. See appendix ???? for additional information on bit mask and extracting portions of a register. Note: Mask operation skipped if mask value is zero, or register format is not Int


Modify RTU Read Map ScaleOffset.png - From that point you can perform scaling and apply an offset to the result if necessary. Scaling applies the formula y=mx+b. When reading from the slave, the raw data is multiplied by the scale factor, then the offset is added to produce the resulting present value. When writing to the slave, the offset is first subtracted from the present value, and that result is divided by the scale factor to produce the raw data actually written to the slave device. NOTE: If a scale factor is not given (zero is entered), no scaling will be performed, as if slope=1 and intercept=0.


Modify RTU Poll Period.png - This sets the rate the point is to be polled from the slave device. Polltime is defined in seconds (can be fractional). 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.


Modify RTU SaveLocal.png location in this gateway where this data is to be saved (Local Object).


Value updated can be conditionally controlled by another local register.

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