Modbus Slave Module
The Modbus Slave Module makes the values in ION registers available to a Modbus master device.
Module icon
Overview
Each module can be set to map up to 16 values to a specified Base Address in the Modbus holding register address range. The module is also able to present the data in numerous formats, such as 16-bit integer, 32-bit integer and Packed Boolean).
NOTE: The registers and settings available in this module depend on the device or node you are configuring, as well as its firmware and template versions. Not all registers or settings are available on all devices or the Virtual Processor, and labels may vary.
The Modbus standard describes a popular communications methodology that allows devices made by different manufacturers to communicate with each other. The Modbus Slave module allows an ION device to be integrated into a Modbus network. Data measured or calculated by ION devices can be made available to other devices on the Modbus network and further manipulated or analyzed.
Some ION devices have their default Modbus data mapped to Modbus using Modbus Slave modules, while other devices use Data Mapping modules. If your device uses Data Mapping modules for its default Modbus data, Modbus Slave Modules can be used to map additional Modbus data.
NOTE: With the Virtual Processor and advanced meters, you can create Modbus Master functionality. Refer to the Modbus Master Device, Modbus Master Map, and Modbus Master Options modules.
You can see your device’s default Modbus information in your device’s user documentation or Modbus register map, available from www.se.com.
Inputs
Source 1 to Source 16
The Modbus Slave Module takes the numeric or Boolean value on each input and makes it available to READ requests from the Modbus master. You may link any or all Source inputs to the output registers of other ION modules. You must have at least one Source input linked for the Modbus Slave Module to go online.
Setup registers
Format
This register defines what format of data the module follows when writing to the Modbus registers.
The choices include:
Format |
Type |
Range |
# of Modbus registers used |
---|---|---|---|
Unsigned 16B |
Integer |
0 to 65,535 |
1 |
Signed 16B |
Integer |
-32,768 to 32,767 |
1 |
Unsigned 32B |
Integer |
0 to 4,294,967,295 |
2 |
Signed 32B |
Integer |
-2,147,483,648 to 2,147,483,647 |
2 |
Unsigned 32B-M10k |
Integer |
0 to 655,359,999 |
2 |
Signed 32B-M10k |
Integer |
-327,689,999 to 327,679,999 |
2 |
Packed Boolean |
Integer |
0 to FFFF (Boolean inputs) |
1 |
Packed Boolean For Coils |
Integer |
0 to FFFF (Boolean inputs) | 1 |
Packed Boolean For Inputs |
Integer |
0 to FFFF (Boolean inputs) | 1 |
IEEE Float | Floating point | - 3.402823466x1038 to 3.402823466x1038 | 2 |
Signed 64B |
Integer |
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | 4 |
Unsigned 16B Input Mode* |
Integer |
0 to 65,535* |
2 |
* For meters, Unsigned 16B Input Mode allows data to be written to the Modbus Slave module. When Unsigned 16B Input Mode is selected for the Format register, the Modbus Slave module supports 32 16-bit unsigned registers; however, scaling is not supported (i.e. scaling does not affect the output values). See the “Importing with Modbus Slave Modules” section below. |
For any 32-bit format, the 32-bit equivalent to the module's input uses two consecutive output registers (low address register contains high-order word).
Both Unsigned and Signed 32B-M10k refer to the Modulo10000 formats. This format breaks a 32-bit value into two 16-bit registers, according to the following relationship:
- register_high (higher-order register) = value/10,000
- register_low (lower-order register) = value modulus 10,000
For positive values, the modulo result range is 0 to 9,999. For negative values, the modulo result range is -9,999 to 0.
Hence the 32-bit value can be retrieved by the following calculation:
- value = register_high x 10,000 + register_low
For any 64-bit format, the 64-bit equivalent to the module’s input uses four consecutive output registers (low address register contains highest-order word).
The Packed Boolean formats behave as follows:
- Packed Boolean: responds to read holding register function codes. Each input register (to the module) corresponds to one bit in the single output register of the module.
- Packed Boolean for Coils: same as Packed Boolean except that the inputs are additionally mapped as coils in response to the Read Coil Status function code.
- Packed Boolean for Inputs: same as Packed Boolean except that the inputs are additionally mapped as inputs in response to the Read Input Status function code.
The Bit address for the input or coil is derived from the Word address where:
Bit address = (Word address * 16 + Bit rank (0 to 15))
BaseAddr (base address)
This register specifies the lowest address that the Modbus master can use to READ the data stored in the ModVal 1 output register. Each subsequent output register is addressable by the appropriate offset from this base address.
Scaling
This register specifies whether or not the output values are scaled. If Scaling is set to yes, then the values in the InZero, OutZero, InFull and OutFull registers are used to scale the output values; if it is set to no, no scaling is performed, and the values in the InZero, OutZero, InFull and OutFull registers are ignored.
InZero, InFull
These registers specify the input range for all values to which the module is linked. Any value less than the InZero setting is treated as an InZero value, and any values exceeding the InFull value is treated as an InFull value.
OutZero, OutFull
These registers specify the output range for all values available from this module. The output values are linearly interpolated from the input range.
Output registers
ModVal 1…32 (Modbus value)
There are 32 ModVal output registers, each of which contains one 16-bit integer value. These registers can be used to confirm the data in the Modbus register map (the data being presented to the Modbus network by the module). The validity of data in these registers depends on the state of the corresponding input and the current values of the setup registers. The ModVal values can be signed or unsigned values, and may need to be interpreted in pairs to obtain 32-bit values.
NOTE: The value of a signed 16-bit Modbus register will be correct when read as a 16-bit hexadecimal number. However, if the value is displayed in decimal it may be shown as an unassigned decimal integer, which will appear incorrect.
ModBase (Modbus base)
This register indicates the address of the first value available to the Modbus master, which is stored in the ModVal 1 output register.
ModLink (Modbus link)
This register contains the next available Modbus holding register address, i.e. the first address following the last valid output register of this module. Refer to this register if you want to create a contiguous address range; enter the value in this register in the BaseAddr setup register of another Modbus Slave module.
Event
All events are recorded in the Event register.
Possible events and their associated priority numbers are:
Event priority group | Priority | Description |
---|---|---|
Setup Change | 10 | Input links, setup registers or labels have changed. |
The Event output register stores the following information for each ION event: time stamp, priority, cause, effect, and any values or conditions associated with the cause and effect.
Responses to special conditions
The following table summarizes how the module behaves under different conditions.
Condition | Response of output registers |
---|---|
If the Source input is not available | The ModVal registers are set to N/A (NOT AVAILABLE). |
After the module is re-linked or its setup registers are changed |
The ModVal registers are not available. The ModBase register is equal to the BaseAddr setup register value. The ModLink register equals ModBase plus N. |
When the device is powered up after a shutdown (either the first time, or after a shut-down) |
The ModVal registers are not available. The ModBase register is equal to the BaseAddr setup register value. The ModLink register equals ModBase plus N. |
Detailed module operation
Boolean Inputs & Packed Boolean Format
If the Format setup register is set to packed boolean and the Source inputs are connected to Boolean inputs, the ModVal 1 register contains a 16-bit map for the Boolean inputs. The most significant bit (MSB) corresponds to the value linked to the Source 1 input, and the least significant bit corresponds to the value linked to the Source 16 input. All other output registers are not available. The scaling registers have no effect if Packed Boolean format is selected.
If the Format setup register is set to packed boolean and some of the Source inputs are connected to numeric inputs, each non-zero numeric value is treated as a Boolean “1” and a zero numeric value is treated as a Boolean “0”.
If the Format setup register is set to anything other than packed boolean and some of the Source inputs are connected to Boolean inputs, each Boolean “1” is placed in the corresponding output register as a numeric “1” and each Boolean “0” as a numeric “0” (each output uses 16 or 32 bits, depending on the Format setup register). The scaling registers have no effect on Source inputs linked to Boolean values.
Scaling
Four setup registers (InZero, OutZero, InFull and OutFull ) may be used to scale a range of numeric input values to a specified output range.
The following diagram shows how the scaling operation works. For example, suppose the Modbus Master needs 10-bit data for all inputs, and the kW reading is required. The Modbus Slave Module Format register is set to use unsigned 16-bit; the input range is specified as 5000kW to 20000 kW, and the output range is set from 0 to 1023 to give maximum resolution over this range.
Any values for the kW register below 5000kW will be exported to the Modbus Master as a value of 0; any reading in excess of 20,000kW will be exported as a reading of 1023. The Modbus Master typically can apply the appropriate scaling and offset values necessary to interpret these values.
Note that if the Modbus Master reads data from any register that does not contain valid data (i.e. if any of the module inputs are not available), the data will be indicated by the hexadecimal value 0xFFFF; this should not be mistaken for a valid reading. Ensure that the Modbus Master can recognize this invalid response. In the case of Packed Boolean format, each unconnected or unavailable input is represented by a “0” in the output register.
Modbus Address Ranges
Many operating parameters of ION devices can be configured via Modbus WRITE commands. Setup registers are mapped to a fixed address range. You cannot use addresses in this range for access to Modbus Slave module output registers.
Valid address ranges for the setup registers you are configuring are available in the documentation or the default Modbus Map for your device, available from www.se.com. If you use Designer to configure the setup registers, the valid address ranges are displayed when you modify them.
Importing with Modbus Slave Modules
The Modbus Slave Module can be used for importing Modbus data into some meters or the Virtual Processor. When no inputs are linked to the Modbus Slave Module, the output registers show the contents of the fixed Modbus address map as defined by the setup registers of the Modbus Slave Module. The values at the map address are copied to the output registers, starting at the address specified in the BaseAddr setup register, until each output register is filled.
Use the Modbus Slave Module to bring Modbus data into your power monitoring system as follows:
- Create a Modbus Slave Module in the Virtual Processor or on a meter by dragging a module from the toolbox in Designer.
- Leave the inputs of the Modbus Slave Module unlinked. The Modbus Slave Module will not read the Modbus register map if any of its inputs are linked (the module will provide the linked data to the Modbus register map).
- Configure the Modbus Slave Module’s setup registers.
For the Virtual Processor, if the Format setup register is:
- 16 bit format, 16 bit data is put into each of the ModVal outputs.
- 32 bit format, two pieces of 16 bit data are combined into one 32 bit ModVal output register.
- Packed Boolean, the data is put into the ModVal 1 output register in Packed Boolean form.
For meters, the Format setup register can only be set to 16 bit unsigned format.
- Enter the base Modbus address into the BaseAddr setup register.
There is no scaling applied to any of the Modbus register map values so ignore the Scaling, InZero, OutZero, InFull and OutFull setup registers.
NOTE: When using a meter's Modbus Slave Module to show the Modbus map, you must change the Format setup register to unsigned 16b input mode. This is not necessary when using a Modbus Slave Module in the Virtual Processor.
You can now link the outputs of the Modbus Slave Module to the inputs of other ION modules. Three such examples are:
- Data Recorder modules for data logging
- Setpoint and Relative Setpoint modules for alarming
- Distributed Numeric module for redistribution to ION meters (for automated plant-wide demand or power factor control)
For more information on using the Modbus Slave Module see the Modbus and ION Technology technical note or your device’s user documentation, available from www.se.com.