Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Using MODBUS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Using the Modbus Protocol in Metretek Correctors

Technical Documentation
AE5000/6000 Modbus Protocol Driver - Technical Documentation
Revision 1.0

MODBUS PROCESS DESCRIPTION

The Modbus process provides configuration capabilities for the Modbus protocol driver. Modbus driver options
and register assignments are supported through the process.

ITEM DESCRIPTION FOR MODBUS PROCESS

( Section 2 )

Item 1, 02-01 Modbus Address


This parameter configures the Modbus address for which the RTU will communicate with. Valid numbers are 1 to
247.

Item 2, 02-02 Mode: 0=RTU 1=ASCII


The mode parameter configures the Modbus communication mode. A value of 0.0 selects Modbus-RTU and a
value of 1.0 selects Modbus-ASCII.

Item 3, 02-03 Active 0=no, 1= yes


This parameter enables/disables the Modbus communications driver. If disabled (0.0) then the eagle protocol, or
other activated protocols will function. If enabled (1.0) then the Modbus protocol will function. When enabled, the
protocol will be supported over the current communication link (direct, phone, radio, & etc.). The only exception is
when the RS232 alarm pin is grounded. In this case, the RTU will always communicate using the Eagle protocol.

Item 4, 02-04 Communications Port


This parameter allows selection of the serial port to be used by the Modbus driver. This will provide for extra serial
ports to use the protocol. Currently, this parameter is not used.

Item 5, 02-05 Single Int Reg Start


The starting register number for 16 bit integers is specified here. The default value is 3000. This value is normally
used with all systems.

Item 6, 02-06 Single Int Reg End


The ending register number for 16 bit integers is specified here. The default value is 4999. This value is normally
used with all systems.

Item 7, 02-07 Double Int Reg Start


The starting register number for 32 bit integers is specified here. The default value is 5000. This value is normally
used with all systems.

Item 8, 02-08 Double Int Reg End


The ending register number for 32 bit integers is specified here. The default value is 6999. This value is normally
used with all systems.

Item 9, 02-09 Floating Pnt Reg Start


The starting register number for 32 bit IEEE floating point numbers is specified here. The default value is 7000.
This value is normally used with all systems.

Item 10, 02-10 Floating Pnt Reg End


The ending register number for 32 bit IEEE floating point numbers is specified here. The default value is 65535.
This value is normally used with all systems.

Using MODBUS Page : 1


Using the Modbus Protocol in Metretek Correctors
Technical Documentation

Item 11, 02-11 Register/Index Offset


This item is intended to allow adjustments to support different variations of the Modbus protocol. It is currently not
used however.

Items 12 to 16, 02-12 to 02-16 Spare


These are spare items for future use.

( Section 3 )

Item 1, 03-01 Process Status


This item is not used by the Modbus process except in the standard manner to indicate that a process parameter was
edited.

( Section 4 )

Items 1 to 16, 04-01 to 04-16 Register.Config


These items are used in conjunction with the section 5 to specify the Modbus register/ Eagle PP-SS-II conversion
mappings. In section 4, the register number is specified in the integer portion of the value. The Config (fractional
portion) value may have different meanings depending on what type of register is being defined. The following
describes the Config value usage for each register type:

Boolean Register: For a Boolean register (normally address 1001 - 2999) the Config parameter is used to defined
the bit position and logic level for the value located at the PP-SS-II:
Config = .BBL
0 = Modbus function will use same logic as bit. 1 = logic is inverted.
Specifies the bit number. Valid bit numbers are 1 - 16.

The Config parameter is currently unused with other data types.

( Section 5 )

Items 1 to 16, 05-01 to 05-16 PPSSII


These items correspond to the register numbers in section 4 to specify the Modbus register mapping.

( Section 6 )

Items 1 to 16, 06-01 to 06-16 Register.Config


These items are used in conjunction with section 7 to specify the Modbus register mapping. See the Section 4
description for more details.

( Section 7 )

Items 1 to 16, 07-01 to 07-16 PPSSII


These items correspond to the register numbers in section 6 to specify the Modbus register mapping.

( Section 8 )

Items 1 to 16, 08-01 to 08-16 HistProc.Column


These items are specified in conjunction with the values in section 7 and 8 to provide support for history polling
over the Modbus protocol. The HistProc (integer) portion of the value specifies the process number of the history
process to associate with the Modbus Register number. The Column (fractional) portion of the value specifies the
column of the history process to be used.

Using MODBUS Page : 2


Using the Modbus Protocol in Metretek Correctors
Technical Documentation
PPSSII TO MODBUS REGISTER ADDRESS CONVERSION

There are two methods of conversion between the PPSSII and Modbus register addresses. In the first method, a
simple calculation is used to convert between the two address formats:

Modbus Reg = 20000 + [(PP-1)*256 + (SS-1)*16 + (II-1)]

therefore (using integer arithmetic )

PP = ((Modbus Reg - 20000 ) / 256) + 1


SS = ((Modbus Reg - 20000) mod 256) / 16) + 1
II = (((Modbus Reg - 20000) mod 256) mod 16) + 1

In the second method, the process database specifies the register mappings.

MODBUS FUNCTION CODES SUPPORTED

DESCRIPTION FUNICTION NUMBER


Read Boolean 1
Read Numeric Register 3
Set Single Boolean 5
Set Single Numeric 6
Set Multiple Boolean 15
Set Multiple Numeric 16

Enable Modbus
The native protocol of the 5000/6000 series instruments (Hex ASCII), has a
special message (type 34) that is used to temporarily enable the corrector’s
Modbus protocol driver. This message is as follows:

[02h]0000000022000000[03h]0

where all digits are ASCII except the start [02h] and end [03h] frame characters
which are binary.

The message causes the corrector to scan its database looking for a Modbus protocol process. The corrector will
enable the first Modbus process that it locates, and it will then remain in “Modbus” protocol mode until a
programmed interval passes without receiving a valid Modbus message (typically 20 seconds), at which time it will
revert back to it’s native protocol mode of Hex-ASCII.

Using MODBUS Page : 3

You might also like