DATAPROVIDER FOR MODBUS (IP) - MANUAL DATAPROVIDER AND OPC SERVER Basing on modular implementation of the CommServer software technology we offer many dedicated OPC servers (Data Access 2.00, 2.05a, 3.0). Each of OPC servers “powered by CommServer™” is combined of two components: OPC communication engine and dedicated DataProvider.

This communication engine is the same component which is used in CommServer™ software, so the dedicated OPC servers are powered by CommServer. Each of the OPC servers is certified and has “Self-tested for compliance” logo.

OPC SERVER FOR MODBUS (IP) Modbus is a serial communications protocol published by Modicon in 1979 for use with its programmable logic controllers (PLCs). It has become a de facto standard communications protocol in industry, and is now the most commonly available means of connecting industrial electronic devices. OPC Server for Modbus powered by CommServer allows sharing data from any unit meeting Modbus (RTU) specification, especially from PLC devices. The Modbus protocol is available for two kinds of communication media: 

Serial communication (RS232, RS422, RS485)



Ethernet.

OPC server for Modbus IP powered by CommServer is dedicated for Ethernet communication and supports the Modbus TCP via TCP/IP or UDP/IP.

OPC Server for Modbus RS powered by CommServer is available off-the-shelf in two versions: 1.

OPC_MODBUS_IP200 - OPC Server (OPC DA 2.00, 2.05a, 3.0) for Modbus, TCP via TCP/IP, 200 points

(OPC tags). 2.

OPC_MODBUS_IP1K - OPC Server (OPC DA 2.00, 2.05a, 3.0) for Modbus, TCP via TCP/IP, 1000 points

(OPC tags). doc: PR21022101E01-MODBUS_IP_manual/Ver:13

1

If you require more tags please contact us. OPC server for Modbus powered by CommServer is certified and has “Self-tested for compliance” logo. The server allows for communication with any Modbus IP compliant device including but not limited to the following vendors of programmable logic controllers (PLC) and distributed control systems (DCS): 

ABB



Emerson



Saia-Burgess



Allen-Bradley



GE Fanuc



Schneider (Modicon)



Beckhoff



Honeywell



Yokogawa



Control



Koyo



and many others.



DGH



Mitsubishi

TECHNICAL SPECIFICATION To take advantage of using Modbus DataProvider please open Network Configuration software and select DP.MODBUS.IP (CAS.CommSvrPlugin_MODBUS) DataProvider via TCP/IP or UDP/IP as communication layer in the selected protocol dialog property grid.

Communication interface settings Select TCP or UDP as protocol. Socket number settings are ignored and can be set by default as –1 (this setting is valid only for slave sides of the protocol).

Modbus protocol settings CommServer allows us to tune the timeout settings that are used in the Modbus DataProvider. The following settings are available: 

InterframeGap – period of time in milliseconds between consecutive request frames  MaxNumberOfRetries - maximal number of retries getting the response. After this limit has passed the base station finds that communication with the device using current interface coupled with this protocol is broken and it activates the next interface in the pipe if available. The failed interface is marked inactive and will remain in this state until the defined (as “inactive time after failed”) timeout expiration.  ResponseTimeOut - maximal time of waiting for the response from a remote device  Timeout15 - maximal wait time in microseconds for the next character inside Modbus telegram (Modbus specifications defines this time as time of 1.5 character that goes through the communication layer, but due to Windows limitation it is not recommended to set this timeout to less than 11 milliseconds)  Timeout35 - maximal wait time for the next character while waiting for the response frame end (a silent interval separating message frames, e.g. 3.5 character times for Modbus) Note: The default settings are optimal for communication over the serial link; if TCP/UDP transportation it is recommended to tune the settings. It is necessary to set a valid segment address. This address is the address of the PLC that we want to connect to. Below there is an example of connection settings to PLC. In this case TCP is used:

The syntax of the segment address is: server_IP_address:port_to_which_commserver_establish_the_connection doc: PR21022101E01-MODBUS_IP_manual/Ver:13

2

In the figure below there is an example connection to PLC, whose IP address is 192.168.0.8 and communication port is 2101:

Configuration and interpretation of received data Modbus DataProvider reads the data in blocks. Requests are sent to the device (called station in the CommServer configuration) that has an address (according to Modbus protocol) set inside port (interface) definition. The user can freely define a block of data to be read. The block of data is received as an answer from the device. During the configuration of the data block, the following settings must be configured:    

Address – the initial address of the block Data Type – the address space in the device to be read (available address spaces are: Coils, Discrete Inputs, Holding Registers, Input Registers, Memory Bank Registers1, 8 bits Holding Registers2) Name – the name of the data block in the CommServer configuration (not used during communication) Tags collection – tags definitions inside the block. Each tag has:  Name – the name of the tag inside the OPC server address space  Access Rights - indicate if this item is read only, write only or read/write. This is NOT related to security but rather to the nature of the underlying hardware  DataTypeConversion - conversion requirements. Data will be available in the required type (if conversion is possible).

Addressing in Modbus: address vs offset (reference) In Modbus protocol, the block address indicates the offset of a particular element within its address space (e.g. holding register, coils, etc.), but this offset may not be equal to physical address of this element in the memory. An example of such situation is a Modicon 984 controller, where:  Register at reference 0 is address 40001 in Modicon 984  Coil at reference 0 is address 00001 in Modicon 984 That’s why sometimes it is necessary to change the address to offset (e.g. subtract 40001 when a Holding Register is concerned) and finally the offset (not address) must be inserted to the CommServer block configuration.

32-bit register and floating point numbers extension The Modbus DataProvider supports also some extension to Modbus protocol, e.g.: 

32-bit Holding Register



Floating point values

In Modbus, a 32-bit register is transmitted as two standard (16-bit) registers. There are two modes of how 32-bit registers are transmitted. In the first mode (usually called Modicon), the first register contains bits 15 - 0 of the 32-bit number, and the second register contains bits 31 - 16 of the 32-bit number. In the second mode (called inverted), the order of those two registers is inverted. The Modbus DataProvider supports both modes and the mode can be selected in DataProvider settings in the RegisterOrderIn32mode property (see figure below). In case of the necessity of using 32-bit Holding Register, a special block data type must be selected: Holding_32bit_Register (see figure below). Note that floating point numbers are available only when 32-bit registers are used. As far as floating point numbers are concerned, the proper floating point format must be selected. This DataProvider supports two modes: Modicon [standard: the first register contains bits 15 - 0 of the 32-bit number (bits 15 - 0 of significant), and the second register contains bits 31 - 16 of the 32-bit number (exponent and bits 23 - 16 of significant)] and IEEE (inverted: IEEE floating point number format is used). The mode can be selected in DataProvider settings in the FloatingPoint

1 2

Control Company extensions Control Company extensions

doc: PR21022101E01-MODBUS_IP_manual/Ver:13

3

property (see figure below). What is more, conversion to System.Single must be set for each item that should be available in OPC as floating point number.

Modbus extensions of Control Co. Ltd. This DataProvider supports some of the extensions used by Control Company. Memory Bank Registers, 8-bit Holding Registers are available as extension. The “Memory Bank Registers” are 16-bit registers that come from one of the memory banks. In this case, the addressing scheme is extended to allow the selection of the memory bank, so the block address has the following syntax (hexadecimal): xxyyyyh, where xx is the bank number and yyyy is the register address. The bank number depends on the memory type and real bank number. The available RAM banks are from 0 to 7 (xx is 00 to 07) and the available registers are 0000h – 3FF7h; the available EEPROM banks are from 0 to 5 (xx is 00 to 05) and the available registers are 0000h – 3FFFh. Due to the fact that CommServer stores any block address as a decimal number it is necessary to convert the address to a decimal representation. An example of block address to access registers from RAM bank number 2 and address 1 is 020001h (hexadecimal), that is 131073 in decimal notation (and this decimal address must be set as a block address). The “8-bit Holding Registers” are 8-bit registers available in the device. They are similar to standard “Holding Registers” but they are only 8 bits long.

doc: PR21022101E01-MODBUS_IP_manual/Ver:13

4

CAS POLAND, 90-441 Łódź, Al. Kościuszki 103/105 tel/fax: +48 (42) 6862547; +48 (42) 6865028

www.cas.eu www.commsvr.com [email protected]

OPC Foundation Self-Tested for Compliance logo is a trademark of the OPC Foundation and may be used only by written permission of the OPC Foundation. Any unauthorized use of the Self-Tested for Compliance logo is prohibited. OPC Foundation Self-Tested for Compliance logo indicates that this product has been tested by the manufacturer to be compliant with the following OPC Specifications: Data Access 2.00 Data Access 2.05a Data Access 3.00 Additional information about compliance testing, logo program and a summary of test results for CommServer 3 can be found at www.opcfoundation.org.

doc: PR21022101E01-MODBUS_IP_manual/Ver:13

5