Modbus Master Device Module
The Modbus Master Device Module reads data from an external Modicon Modbus RTU slave device.
Module icon
Overview
Up to 32 values can be imported, scaled, and labeled for use by other ION modules. A map, defined by an associated Modbus Master Map Module, determines what data is read from the slave device and how that data is formatted.
NOTE: Before working with the Modbus Master Device module, see the Modbus Modbus Master Map Module description.
The Modbus Master Device Module operates in two different modes:
- In Polling mode (Read Now input not connected) it places a Modbus request in the queue every second if it is not waiting on a previous response.
- In Read Now mode, upon a Read Now pulse, it places a Modbus request in the queue if it is not waiting on a previous response.
The Modbus Master Device Module works in tandem with the Modbus Master Map module. See the “Detailed Operation” section for more information.
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.
Inputs
Enable
This input switches the module ON and OFF. When set to off, the outputs are set to 'N/A’. The default setting is on. This input is not required.
Read Now
When pulsed, this register places a Modbus request in the queue if it is not waiting on a previous response. If left unconnected, the module polls the Modbus devices continuously. This input is not required.
Setup registers
Connection
This register maps the connection to a setup register on the Modbus Master Options Module. Choose Serial Connection 1-4 or TCP Connection 1-10 (if available).
Slave Addr (slave address)
This register contains the numeric address of the Modbus slave device from which the module reads data. The valid slave address range is 1–247; default is 1.
Device Type
This string register defines the slave device type. The string can have a maximum of 20 alphanumeric characters; dot and dash allowed.
NOTE: The Device Type setup register entry must match exactly the Device Type setup register entry of a Modbus Master Map module in order to operate. Both of these Device Type registers are case sensitive.
Slave Name
This string register contains the Modbus slave device sub-name. This is for uniquely identifying Modbus Master Device module output registers with common 'Device Types'. This string can have a maximum of eight alphanumeric characters; dot and dash allowed.
Comms Error Count
This register defines the number of consecutive unsuccessful reads required before a communications error is sent. The valid range is 1-255; default is 1.
Comms Error Output Value
This register defines how stale data is overwritten in the event of a communications error. The default setting is old value.
Output registers
Outputs 1-32
These registers contain the imported Modbus data for other ION modules to use. The output labels are derived from other registers as shown below:
<label><bit number>@<slave name>[value]
The label is acquired from the Modbus Master Map module’s Device Map register. The bit number applies to Packed Boolean formats only. The slave name is set in the Slave Name setup register.
NOTE: The Modbus Master Map module maps Modbus registers to the Modbus Master Device output registers in ascending order. If you add or delete entries in an existing Device Map string, the Modbus Master Device output registers dynamically update to reflect the changes made to the Modbus Master Map Device Map.
For example:
- In the Modbus Master Map module, Amps A is mapped to Modbus Master Device module Value1, Watts 3-Ph total is mapped to Modbus Master Device module Value2.
- If you change the mapping to add Volts A-N, the Modbus Master Map module will require you to change the Modbus map register string so the Modbus registers are listed in order, i.e. Volts A-N first, then Amps A, then Watts 3-Ph total.
Before the change:
- Modbus Master Device module Value1 = Amps A
- Modbus Master Device module Value2 = Watts 3-Ph total
After the change:
- Modbus Master Device module Value1 = Volts A-N
- Modbus Master Device module Value2 = Amps A
- Modbus Master Device module Value3 = Watts 3-Ph total
Pending
An on state indicates the module is waiting for a response from the slave device.
Status
This Boolean register indicates the status of communication between the Modbus master (the ION device using this module) and the associated Modbus slave. A value of on indicates that a recent communications attempt succeeded; off indicates consecutive communications errors have occurred as specified in the Comms Error Count setup register.
Successful Read
This output generates a pulse whenever the module successfully reads data.
Unsuccessful Read
This output generates a pulse whenever the module fails to read data (because of either a communications error or a Modbus exception).
Exception Code
This register contains the Modbus exception code returned by the slave device when invalid requests are made. This value is reset once a valid request is received.
Update Period
This register contains data indicating the following:
- Polling mode: When the module is polling the Modbus devices, this register specifies the time between updates.
- Read Now mode: When the module receives a ReadNow request, this register specifies how much time elapsed between receiving the ReadNow request and updating the value outputs.
Event
All events are recorded in the Event register.
Possible events and their associated priority numbers are:
Event priority group | Priority | Description |
---|---|---|
Reset | 5 | A module reset has occurred. |
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 registers |
---|---|
The Enable input is N/A |
The Value 1...N registers are N/A The Status register is set to N/A The Pending register is set to N/A |
After the module is re-linked or its setup registers are changed |
The Value 1...N, Status, Exception Code and Update Period registers are N/A The Pending register is set to no |
When the device is started or powered-up (either the first time, or after a shutdown) |
The Value 1...N, Status, Exception Code and Update Period registers are N/A The Pending register is set to no |
When there are Comms Error Count consecutive receive time-outs or Modbus exceptions (i.e. Modbus Master Device module sends a request but does not receive a reply or receives a Modbus exception) | Output registers are set to the Comms Error Output value until a successful read occurs |
Detailed module operation
The Modbus Master Device Module works in tandem with the Modbus Master Map Module; it will not function without it.
In order for the Modbus Master Device Module to function properly, the meter’s Protocol setup register in the Communications module must be set to modbus master. This defines the serial port used to access the Modbus slave devices. See the Modbus and ION Technology technical note for more information.
In the example below, two ION6200 meters (Submeter1 and Submeter2) act as Modbus Slave devices and provide Modbus values to an ION7550 meter (acting as the Modbus Master device). Submeter1 is linked to Modbus Master Device module 1 (the meter’s Unit ID of 101 is entered in the Modbus Master Device module’s Slave Addr register) while Submeter2 is linked to Modbus Master Device module 2.
Modbus Master Device Module 1 collects Modbus data (Vln a) from Submeter1, while Modbus Master Device module 2 collects Modbus data (Vln a) from Submeter2. These two Device modules then use the decoding information available from the Modbus Master Map module 1 to translate the Modbus information into values other ION modules can use. Notice the Device Type register of all three modules is set to 6200. This “links” the Modbus Master Map module to the two Modbus Master Device modules.