Modbus TCP Client Read Map Edit

From Control Solutions IoTServer Documentation
Jump to navigation Jump to search

Modbus TCP Client Read Maps are where you configure this device to query other Modbus TCP devices for data, and store that data in local data objects. This page is where you enter the various parameters to make that happen.

Modbus TCP read 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.

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 read map edit 2a.jpg Modbus read map edit 2a-addr.jpg Modbus read map edit 2a-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 read map edit 2a.jpg Modbus read map edit 2b.jpg Modbus read map edit 2c.jpg Modbus read map edit 2d.jpg Modbus read map edit 2e.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 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). Register Size is not used for Coil or Disc types.

Unsigned – Select signed or unsigned. Defaults to signed integer. Has no effect on Register Format 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 TCP read map edit 3.jpg

Device – Select a device from the TCP Device list that should be accessed for this read attempt on a TCP network.

Unit – Unit number to be included in the TCP request, will default to 1 if not given or is set to zero. Web page will force it to default to 1, but is optional for CSV or XML import.

Modbus read map edit 4.jpg

Mask – A bit mask given as an 8-digit hexadecimal value, if non-zero. The mask operation is 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. 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.

Modbus read map edit 5.jpg

Scale – Register content is multiplied by this value, if non-zero, before being placed into the local object. Scale is treated mathematically as 1 if omitted (set to zero).

Offset – This value is added to the register content (after being multiplied by scale) before being placed into the local object.

NOTE: The order of operation is as follows: (1) read Modbus register; (2) apply mask if applicable; (3) apply scale if non-zero; (4) apply offset. Result is then placed in local object.

Modbus read map edit 6.jpg

Poll Time – Poll time in seconds (can be fractional). The sets the rate at which the remote Modbus register will be read. 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.

Modbus read map edit 7.jpg

Local Object – Local object number that the result of the Modbus read operation should be placed into.

Modbus read map edit 8.jpg

Default Value – Provides the default value that the local object should be set to in the event the FailCount is exceeded.

Fail Count – Optional, provides a count of read failures, if non-zero, that can occur before the local object will be set to the default value given in this map. If zero, the default value will never be applied. If 1, then the default value will be applied upon the first failure (probably not recommended), and so on. The count is reset by a successful read.

Modbus read map edit 9.jpg

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

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