7EN02-0290-11

Modbus Export Module

The Modbus Export module writes data to any device that supports the Modicon Modbus communications protocol.

Module icon

Overview

This feature gives you greater flexibility and control over existing devices on your network. For example, you can configure this module to control a relay on a remote power meter.

You can configure a Modbus Export module with up to 64 inputs per module using Virtual Processor. Some meters have Modbus master capability that you configure using Designer. There are 16 Source inputs on the meter. There are some registers that are only available on the meter or in the Virtual Processor; these registers are specified in brackets throughout the text.

NOTE: When configured, the Modbus Export module behaves in a similar fashion to a Modbus controller. However, each module can write data to only one Modbus slave device, over a specified range of its address registers.

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

Source 1... Source N

These inputs hold the values that are written to the appropriate Modbus registers, as configured in the module’s setup registers. You must link at least one of these inputs.

Enable

This input is used to switch the Modbus Export module on or off. When off is selected the module does not function.

NOTE: Even if the Enable input is not connected, the module is enabled, by default.

WriteNow

When connected to a trigger source, the module writes data when it detects a pulse at this input. If left unconnected, the module does not write. If the module is pulsed while it is 'pending,' the input data that is current at the time of the most recent pulse is written to the Modbus slave.

Setup registers

Connection (or COMM Port on some meters)

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

Device Name (only on Virtual Processor)

This register contains the address name indicating the Modbus device the module writes to. This name must be defined in the Virtual Processor setup and belong to a Modbus site.

Slave Addr (slave address) (only on the meter)

The module writes to the Modbus device using a numeric address specified in this register. The valid address range is 0-247. A zero (0) value is a broadcast write.

Reg Addr (register address)

The module writes to the Modbus register map using a starting address specified in this register.

Request Type

This specifies if the write request is sent to a single register or multiple.

Format

This register defines what format of data the module follows when writing to the Modbus registers. Refer to your device documentation for setup register choices and bounds. 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

Unsigned 32B Little Endian

Integer

0 to 4 294 967 295

2

Signed 32B

Integer

-2 147 483 648 to 2 147 483 647

2

Signed 32B Little Endian

Integer

-2 147 483 648 to 2 147 483 647

2

Unsigned 32 B M10k

Integer

0 to 65 535 999 

2

Unsigned 32 B M10k Little Endian

Integer

0 to 65 535 999 

2

Signed 32 B M10k

Integer

-32 767 999 to 32 767 999 

2

Signed 32 B M10k Little Endian

Integer

-32 767 999 to 32 767 999

2

Packed Boolean

Integer

0 to FFFF (Boolean inputs)

1

IEEE Float

Floating Point

- 3.402823466x1038 to 3.402823466x1038

2

IEEE Float Little Endian

Floating Point

- 3.402823466x1038 to 3.402823466x1038

2

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

Hence the 32-bit value can be retrieved by the following calculation:

  • value = register_high x 10 000 + register_low

Scaling

yes indicates that scaling is to be applied to data before writing to the Modbus registers; no indicates data is written without scaling. No scaling is allowed for IEEE Float, IEEE Float Little Endian or Packed Boolean formats. For more information on scaling, see the Common Modbus Registers protocol document.

IONInMinScale (ION input minimum scale)

If scaling is applicable, this register specifies the lower limit of the ION register value.

IONInMaxScale (ION input maximum scale)

If scaling is applicable, this register specifies the upper limit of the ION register value.

ModbusOutMinScale (Modbus output minimum scale)

If scaling is applicable, this register specifies the scaled lower limit of the Modbus value.

ModbusOutMaxScale (Modbus output maximum scale)

If scaling is applicable, this register specifies the scaled upper limit of the Modbus value.

Output registers

Busy (only on the meter)

Busy output is on when the module is transmitting a write request. WriteNow pulses are ignored until Busy is off.

Pending (only on the meter)

Pending output is on when a write operation is in progress. Another write request is not issued until Pending is off.

Status

This register indicates the status of communication between ION and Modbus protocols. A value of one (ON) indicates that the last communications attempt succeeded; OFF indicates it did not.

Successful Write

This output generates a pulse whenever the module successfully writes data.

Unsuccessful Write

This output generates a pulse whenever the module does not write a request because of either a communications error or a Modbus exception.

Exception Code

This register contains the Modbus exception code returned by the slave when invalid requests are made.

Update Period

This register indicates the delay from the time the module receives a WriteNow request to when it updates its outputs with the results of the write operation.

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

Request to write

255

Overwrite previous request

Communications lost

*

Displays what caused communications loss

Resuming communications

*

Indicates when communications link is re-established

WriteNow pulsed while busy (on meter only)

30

A pulse arrives at the WriteNow input while the module is in the process of transmitting a previous request. The new request is ignored.

* The priority of this event depends on how you configure the EvPriority setup register.

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.

Modicon Modbus

Two classes of Modbus data, namely Coil and Holding Register, are supported by the Modbus Export module. Coils are single-bit registers used to indicate ON (1) or OFF (0) conditions. Holding Registers are 16-bit registers used to store and retrieve data.

NOTE: For further details, refer to your Modicon Modbus Communications Protocol document, or visit their website at www.modicon.com

If you specify the Reg Addr to begin with a zero (0), data is exported in a coil register format. If you specify the Reg Addr to begin with four (4), data is exported as one of the holding register formats described below.

The following outlines the function codes that the Modbus Export module uses to support the classes of Modbus data:

Function Name

Function Code

Register Address

FORCE_SINGLE_COIL

05

0XXXX(X)

PRESET_SINGLE_REGISTER

06

4XXXX(X)

FORCE_MULTIPLE_COILS

15

0XXXX(X)

PRESET_MULTIPLE REGISTERS

16

4XXXX(X)

NOTE: The module automatically chooses the Function Code based on the Reg Addr setup register value, and based on the Request Type for 4xxxx class requests.

The following outlines the different Modbus formats supported by the Modbus Export module, as well as the maximum number of Modbus registers the Modbus Export module is able to write to per request:

Modbus Format

Single Register

Multiple Registers

Virtual Processor

Meter

Virtual Processor

Meter

Signed 16B

1

1

64 registers/ 64 values

16 registers/ 16 values

Unsigned 16B

Signed 32B

N/A

N/A

122 registers/61 values

16 registers/ 8 values

Signed 32B Little Endian

Unsigned 32B

Unsigned 32B Little Endian

Signed 32B-M10k

Signed 32B-M10k Little Endian

Unsigned 32B-M10k

Unsigned 32B-M10k Little Endian

IEEE Float

IEEE Float Little Endian

Packed Boolean

1 register/ 16 values

1 register/ 16 values

4 registers/ 64 values

1 register/ 16 values

Coil Register Format

NOTE: You can configure the Modbus Import and Export modules using Designer. The ION meter Modbus Master limitations are described throughout this text.

For each write request, function code 05 (Force_Single_Coil) allows the module to write to only one coil register (Modbus starting address). For function code 15 (Force_Multiple_Coil), the module writes data to multiple Modbus addresses, up to a maximum of 64 (16 on the meter). For function code 15, the Modbus Export module writes data to the Modbus register in a similar fashion to the 16 bit signed (unscaled) or 16 bit unsigned (unscaled) format.

The module writes the following data to the Modbus Coil register:

  • One (1) for any numeric non-zero or Boolean true value appearing at the module’s input.

  • Zero (0) for numeric zero or Boolean false value appearing at the module’s input.

Holding Register Formats

Little Endian

For all 32-bit formats (IEEE Float and Signed, Unsigned 32-bit and M10k), Little Endian reverses the two registers (not the bits within the registers) where the data is written. For example, data from Source 1 (as described above), places the contents of the 16 least significant bits into the specified starting address of the Modbus register map, and places the contents of the 16 most significant bits into the adjacent higher address of the Modbus register map.

Signed 16B or Unsigned 16B

UNSCALED

The module takes data from Source 1 and writes it into the specified starting address of the Modbus register map.

SCALED

The module takes data from Source 1 and applies scaling specified in the module’s setup registers. It then writes the result into the specified starting address of the Modbus register map.

The 16-bit Modbus Register Map illustrates how the module maps its Source inputs to the Modbus register map.

IEEE Float

IEEE Float is a floating point format. It does not support scaling. The module takes data from Source 1, places the contents of the 16 most significant bits into the specified starting address of the Modbus register map, and places the contents of the 16 least significant bits into the adjacent higher address of the Modbus register map. See the 32-bit Modbus Register Map for details.

Signed 32B or Unsigned 32B

UNSCALED

The module takes data from Source 1, places the contents of the 16 most significant bits into the specified starting address of the Modbus register map, and places the contents of the 16 least significant bits into the adjacent higher address of the Modbus register map.

SCALED

The module takes data from Source 1 and applies the scaling you specified in the module’s setup registers. It then places the contents of the 16 most significant bits into the specified starting address of the Modbus register map, and places the contents of the 16 least significant bits into the adjacent higher address of the Modbus register map.

The 32-bit Modbus Register Map illustrates how the module maps its Source inputs to the Modbus register map.

32-bit Modbus Register Map

Signed 32B-M10k or Unsigned 32B-M10k

The module maps data in a similar fashion as the 32 bit signed or 32 bit unsigned format (see 32-bit Modbus Register Map above).

UNSCALED

The module takes data from Source 1 and divides the value by 10000. It then takes the quotient and places it into the specified starting address of the Modbus register map, and places the remainder into the adjacent higher address of the Modbus register map.

SCALED

The module takes data from Source 1, applies scaling specified in the module’s setup registers, then divides this value by 10000. It then takes the quotient and places it into the specified starting address of the Modbus register map, and takes the remainder and places it into the adjacent higher address of the Modbus register map.

Packed Boolean

The module writes to the appropriate bit position in the Modbus register map as follows:

  • One (1) for any numeric non-zero or Boolean true value.

  • Zero (0) for numeric zero or Boolean false value.

The module takes data from Source 1, translates and places the appropriate data into the most significant bit position of the specified starting address of the Modbus register map.

Next, it takes data from Source 2, translates and places the appropriate value into the second most significant bit of the same Modbus register. It continues this pattern until the contents of Source 16 is translated and placed into the least significant bit of that Modbus register.

For a module on the Virtual Processor, the appropriate value is taken from Source 17, translated and placed into the most significant bit position of the adjacent higher address of the Modbus register map, etc., until all your specified Source inputs have been written, as illustrated below:

Packed Boolean Modbus Register Map

Responses to special conditions

The following table summarizes how the module behaves under different conditions.

Condition Response of output registers
After the module is re-linked or its setup registers are changed The Status, Exception Code and Update period registers are not available. Busy = NO Pending = NO
When the device is started or powered-up (either the first time, or after a shut-down) The Status, Exception Code and Update period registers are not available. Busy = NO Pending = NO

Detailed module operation

  1. To set up communications between the Virtual Processor and Modbus slave, you must first enter the Modbus device information in the Virtual Processor Setup utility. Select a unique name for the Modbus device and map this string variable to the Modbus device address. You use this name later on when setting up the module Device Name setup parameter.

    NOTE: When a Modbus Export module broadcasts, it sends messages to all devices on all sites connected to the Virtual Processor or meter. However, slave devices do not respond to broadcast messages, therefore the Virtual Processor or meter does not receive acknowledgement of a successful send. After a broadcast, Status goes on, while, Update Period and Exception Code output registers are not available.

    To set up communications between the ION meter (as a Modbus master) and Modbus slave, use Designer to configure the communications port (COM port and baud rate) on the Modbus Master capable meter. Ensure the Modbus Master protocol is active on the communications channel that connects the Modbus master capable meter to a slave device on the Modbus network.

  2. After you add and set up a Modbus Export module to your framework, switch on the Enable input (if this input is linked) to initiate communication with the Modbus device.

    The Source 1 through Source N inputs contain the data to be placed into the specified Modbus device’s registers.

  3. Connect the WriteNow input to a trigger source. Triggering the WriteNow input instructs the module to immediately send a write request to the Modbus Slave device.

    The data appearing at the module’s Source inputs are copied to the appropriate Modbus registers, according to how the Modbus Export module’s setup registers are configured. The Status output register indicates if the ION to Modbus communications line is active, and the Successful Write output register generates a pulse, indicating a successful transfer of information from ION to Modbus.

QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?