Communication protocol MODBUS RTU used in AD4RS, AD4USB and Drak 4

Similar documents
eztcp Technical Document Modbus/TCP of eztcp Caution: Specifications of this document may be changed without prior notice for improvement.

The Answer to the 14 Most Frequently Asked Modbus Questions

Nemo 96HD/HD+ MODBUS

Technical Support Bulletin Nr.18 Modbus Tips

Sample EHG CL and EHG SL10 16-bit Modbus RTU Packet

Modbus and ION Technology

2011, The McGraw-Hill Companies, Inc. Chapter 3

Modbus and ION Technology

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

WIZnet S2E (Serial-to-Ethernet) Device s Configuration Tool Programming Guide

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

The goal is to program the PLC and HMI to count with the following behaviors:

RcWare SoftPLC Modbus server mapping editor User manual

Software User Guide UG-461

IO Expansion Module User & Installation Manual

Lecture N -1- PHYS Microcontrollers

How to use KEPServerEX OPC Server (Kepware) with iologik 4000 (Modbus TCP/IP NA-4010 and Modbus Serial NA-4020/NA-4021)

Process Control and Automation using Modbus Protocol

AKD EtherNet/IP Communication

EtherNet/IP Modbus XPort, NET232, and NET485

MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3 CONTENTS

Brunata Optuna W (171)

Using the AnyBus -X Gateway to Communicate between a DVT camera and a Profibus Master

Single channel data transceiver module WIZ2-434

RS-485 Protocol Manual

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

Modbus Communications for PanelView Terminals

Caml Virtual Machine File & data formats Document version: 1.4

APPENDIX B. Routers route based on the network number. The router that delivers the data packet to the correct destination host uses the host ID.

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

SIMATIC S It s the Interplay that makes the difference. Siemens AG All Rights Reserved.

C-Bus Application Messages & Behaviour Chapter 25 Air Conditioning

But for compatibility reasons the basic structure of the data area or the addressing mechanism of the protocol retained.

USB Card Reader Configuration Utility. User Manual. Draft!

Hagenberg Linz Steyr Wels. API Application Programming Interface

Table 1 below is a complete list of MPTH commands with descriptions. Table 1 : MPTH Commands. Command Name Code Setting Value Description

Softstarters. Type PSTX Fieldbus communication, Built-in Modbus RTU. 1SFC132089M0201 April SFC132089M0201 1

EDI Distributor Control Interface Wiring and Setup Instructions

Data sheet Wireless UART firmware version 4.02

AN1754 APPLICATION NOTE

S4000TH HART. HART Communication Manual

3-Channel 0-20mA analyzer with CAN bus and logic output. A2C-mA-M12-X. General Description. Features. Specifications

Software Manual RS232 Laser Merge Module. Document # SU Rev A

2. Terminal arrangement. Default (PV display) (SV display) Communication protocol selection Selects the Communication protocol. Modbus ASCII mode:

ROC Protocol Specifications Manual

Bluetooth SMART Advertise-Only Beacon Reference Design

Introduction: Implementation of the MVI56-MCM module for modbus communications:

Modbus RTU Communications RX/WX and MRX/MWX

SYMETRIX SOLUTIONS: TECH TIP August 2015

Modbus Protocol. PDF format version of the MODBUS Protocol. The original was found at:

Master-Touch and ValuMass. Modbus Communications. INSTRUCTION MANUAL (Rev. 2.1)

EnerVista TM Viewpoint Monitoring v7.10

HOST Embedded System. SLAVE EasyMDB interface. Reference Manual EasyMDB RS232-TTL. 1 Introduction

DME4 V1.23 ( ) V1.30 ( ) V1.31 ( ) V1.32 ( ) V1.33 ( ) V1.34 ( ) V1.35 ( ) V2.00 ( ) V2.

ABB i-bus EIB Logic Module LM/S 1.1

How to use Citect (SCADA) with iologik 4000 (Modbus TCP/IP NA-4010 and Modbus Serial NA-4020/NA-4021)

Different Ways of Connecting to. 3DLevelScanner II. A.P.M Automation Solutions LTD. Version 3.0

Configurator Software Manual

For support on the Beijer HMI please contact:

Kurz MODBUS Client User s Guide

How To Set Up A Modbus Cda On A Pc Or Maca (Powerline) With A Powerline (Powergen) And A Powergen (Powerbee) (Powernet) (Operating System) (Control Microsci

Binary Representation

Cover sheet. Reading out the topology data of a PROFINET IO system SFB52 "RDREC" FAQ September Service & Support. Answers for industry.

Interface Protocol v1.2

Bluetooth HID Profile

MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b CONTENTS

Using Xbee in Serial Communication

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

1 Application Description Objective Goals... 3

USB - FPGA MODULE (PRELIMINARY)

RN-XV-RD2 Evaluation Board

Lecture 15. IP address space managed by Internet Assigned Numbers Authority (IANA)

Digital and Analog I/O

Fingerprint Based Biometric Attendance System

Consult protocol, Nissan Technical egroup, Issue 6

Modbus TCP / DALI converter

POS Integration. Prepared by: Binh Nguyen

Weightindicator Fieldbus interface description

Lecture 11: Number Systems

XC series BD board for special functions. Operate Manual

Configuring Allen-Brandly ControlLogix PLC with Moxa MGate 5105-MB-EIP. 1 Application Description Objective Goals...

Instructions. ECL Comfort 210 / 310, communication description. Table of Contents

Application Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification

Soft-Starter SSW-06 V1.6X

TCP/IP MODULE CA-ETHR-A INSTALLATION MANUAL

HP03 BAROMETER MODULE Version: 1.1

3. Convert a number from one number system to another

Application/Connection Examples

UniPi technical documentation REV 1.1

User Manual. AS-Interface Programmer

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

NVT (Network Virtual Terminal) description

Embedded Systems Design Course Applying the mbed microcontroller

DS1621 Digital Thermometer and Thermostat

SuperGuard VT-05 Vehicle Tracking Device

Kurz Instruments Inc. Document AV Document Title: MFTB Event Code Definitions. MFT B-Series Event Codes

DS Wire Digital Thermometer and Thermostat

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Application Unit, MDRC AB/S 1.1, GH Q R0111

RPDO 1 TPDO 1 TPDO 5 TPDO 6 TPDO 7 TPDO 8

Transcription:

Communication protocol MODBUS RTU used in AD4RS, AD4USB and Drak 4 Comprehensive protocol description 7. February 2011 w w w. p a p o u c h. c o m

MODBUS RTU M O DBUS RTU Datasheet Created: 7.9.2007 Last update: 7.2 2011 12:45 Pages: 16 2011 Address: Strašnická 3164/1a 102 00 Praha 10 Czech Republic Telephone: +420 267 314 267-8 +420 602 379 954 Fax: +420 267 314 269 Internet: E-mail: info@papouch.com Strana 2

MODBUS RTU CONTENT DESCRIPTION... 4 Basic communication parameters... 4 List of Changes... 5 AD4RS and AD4USB... 5 Drak 4... 5 MEMORY organization... 6 Holding Register... 6 Input Register... 6 Detailed information on instructions... 7 Communication parameters... 7 Configuration permission... 7 Address of the device... 7 Serial line communication speed... 8 Packet end distinction... 8 Communication protocol... 9 Channels... 10 Values and current states of individual channels 10 Individual values... 11 States of channels... 11 Measured value as an integer... 11 Measured value as a decimal number... 12 Measured value RAW value from ADC... 12 Inputs and outputs... 13 Reading the states of inputs... 13 Reading the states of outputs... 14 Output setup... 15 Strana 3

MODBUS RTU DESCRIPTION This document describes MODBUS RTU communication protocol used in measuring converters AD4RS and AD4USB and in the table measuring device Drak 4. The documentation of the hardware of the converters and the description of their functionality are available on the web site http:/// (detailed documentation also downloadable in the PDF format). B a s i c c o m m u n i c a t i o n p a r a m e t e r s AD4RS Communication line... RS232 and RS485 Communication speed... ranging from 1.2 kbd to 115.2 kbd (default: 9,6 kbd) Number of data bits... 8 Parity... no parity Number of stop-bits... 1 Starting address... 0x31 AD4USB Communication line... USB version 1.1 (USB 2.0 and 3.0 compatible) Communication speed... 115 200 Bd (fixed) Number of data bits... 8 Parity... no parity Number of stop-bits... 1 Starting address... 0x31 AD4ETH It is not possible to switch AD4ETH to MODBUS RTU. In the family of MODBUS protocols, AD4ETH is able to use MODBUS TCP. Drak 4 Communication line... USB version 1.1 (USB 2.0 and 3.0 compatible) Communication speed... ranging from 1.2 kbd to 115.2 kbd (default: 9.6 kbd) Number of data bits... 8 Parity... no parity Number of stop-bits... 1 Starting address... 0x31 Strana 4

MODBUS RTU LIST OF CHANGES A D 4 R S a n d A D 4 U S B version 05 Protocol MODBUS RTU added. It is only possible to switch AD4RS or AD4USB to MODBUS RTU protocol using a special instruction described below. version 04 Changes only in the Spinel protocol. version 03 Drak3 protocol added. Switching between the protocols is described in a separate document downloadable from the web page of AD4 modules. D r a k 4 version 01 First version. Strana 5

MODBUS RTU MEMORY ORGANIZATION H o l d i n g R e g i s t e r Address Access Function Name Page Communication parameters 0x0000 read, write 0x03, 0x10 Permission for configuration 7 0x0001 read, write 0x03, 0x10 Address (ID) 7 0x0002 read, write 0x03, 0x10 Communication speed 8 0x0004 read, write 0x03, 0x10 Packet end distinction 8 0x0005 read, write 0x03, 0x10 Communication protocol 9 I n p u t R e g i s t e r Address Access Function Name Page Values and states of individual channels 0x0000 read 0x03 Channel 1 10 0x0004 read 0x03 Channel 2 10 0x0008 read 0x03 Channel 3 10 0x000C read 0x03 Channel 4 10 Values from channels sorted by the significance 0x001E read 0x03 Channels states 11 0x0022 read 0x03 Values as integers 11 0x0026 read 0x03 Values as float value 12 0x002E read 0x03 Net values from the internal converter 12 Inputs and outputs 1 0x0000 read 0x02 Input states reading 13 0x0000 read 0x01 Output states reading 14 0x0000 read 0x05, 0x0F Output setup 15 1 Registers from this part are only available in the Drak 4 measuring device. Strana 6

MODBUS RTU DETAILED INFORMATION ON INSTRUCTIONS C o m m u n i c a t i o n p a r a m e t e r s C o n f i g u r a t i o n p e r m i s s i o n This instruction has to precede any configuration instruction. It is not allowed to write the Configuration permission for together with other parameters using Multiply write. 0x03 Read Holding register 0x10 Write Multiple registers Starting address 2 Bytes 0x0000 Register count 2 Bytes 1 Number of bytes 1 Byte 2 Result 2 Bytes 0x00FF = configuration permission accepted A d d r e s s o f t h e d e v i c e Address (ID) of the device. Devices connected to one communication interface must hold unique addresses. The address unambiguously identifies the device within the network. The default address is 0x31. 0x03 Read Holding register 0x10 Write Multiple registers Starting address 2 Bytes 0x0001 Register count 2 Bytes 1 Number of bytes 1 Byte 2 Address 2 Bytes Device address within the range 1 to 247 Strana 7

MODBUS RTU S e r i a l l i n e c o m m u n i c a t i o n s p e e d To configure the speed of the communication line. 0x03 Read Holding register 0x10 Write Multiple registers Starting address 2 Bytes 0x0002 Register count 2 Bytes 1 Number of bytes 1 Byte 2 Speed code 2 Bytes Speed code: 1200-0003H 2400-0004H 4800-0005H 9600-0006H (default setting) 19200-0007H 38400-0008H 57600-0009H 115200-000AH P a c k e t e n d d i s t i n c t i o n To configure the delay between the bytes that will be understood as the end of the packet. The delay is entered as a number of bytes. It is possible to enter a value ranging from 4 to 100. The default value is 10. 0x03 Read Holding register 0x10 Write Multiple registers Starting address 2 Bytes 0x0004 Register count 2 Bytes 1 Number of bytes 1 Byte 2 Delay 2 Bytes The delay as a number of bytes. It is possible to enter a value ranging from 4 to 100. Strana 8

MODBUS RTU C o m m u n i c a t i o n p r o t o c o l This function enables the device to be switched to a different protocol. There is a choice of several protocols depending on the device type. After sending the response, the device switches to the selected protocol and communicates through it from this point on. (Every protocol contains an instruction for switching between protocols.) 0x03 Read Holding register 0x10 Write Multiple registers Starting address 2 Bytes 0x0005 Register count 2 Bytes 1 Number of bytes 1 Byte 2 Protocol code 2 Bytes Protocol code: Spinel - 0001H MODBUS RTU - 0002H Drak3-0003H (AD4RS and AD4USB only) Drak4-0004H (Drak 4 only) Strana 9

MODBUS RTU C h a n n e l s V a l u e s a n d c u r r e n t s t a t e s o f i n d i v i d u a l c h a n n e l s This defines how to read the last measured value from all or from some of the converter's channels. It returns values as integers and also converted to decimal numbers (32 bit float according to IEEE 754). The values are sent in two formats simultaneously. The first one is the 16bit value within the range from 0 to 10 000 (integer in the sequence of MSB:LSB). The second one is a value converted for the current range according to the current setup 2 as a decimal number in the 32 bit float format according to IEEE 754 3. 0x04 Read Input register Starting address 2 Bytes Register count 2 Bytes 4 Number of bytes State 1 Byte 8 2 Bytes Channel 1: 0x0000 Channel 2: 0x0004 Channel 3: 0x0008 Channel 4: 0x000C 0x0000 value is valid and within the range 0x0001 value is not available yet 0x0002 upper limit exceeded 0x0003 lower limit exceeded (only for the current range of 4 to 20 ma) other values other error INT value 2 Bytes Measured value. Integer within the interval 0 to 10 000 Float value 4 Bytes Measured value. 32 bit float according to IEEE 754 2 3 Setup of conversions is only possible with the Spinel protocol. Description of the IEEE 754 standard is available for example on: http://en.wikipedia.org/wiki/ieee_754 Strana 10

MODBUS RTU I n d i v i d u a l v a l u e s S t a t e s o f c h a n n e l s This is the way to read the states of all the channels at once. 0x04 Read Input register Starting address 2 Bytes Channel 1: 0x001E Channel 2: 0x001F Channel 3: 0x0020 Channel 4: 0x0021 Register count 2 Bytes 4 Number of bytes 1 Byte 2 State 2 Bytes M e a s u r e d v a l u e a s a n i n t e g e r 0x0000 value is valid and within the range 0x0001 value is not available yet 0x0002 upper limit exceeded 0x0003 lower limit exceeded (only for the current range of 4 to 20 ma) other values other error This is the way to read the states of all the channels at once. They are available here as signed integers, i.e. the measured value multiplied by ten (e.g. the value 25.6 is sent as 256). 0x04 Read Input register Starting address 2 Bytes Channel 1: 0x0022 Channel 2: 0x0023 Channel 3: 0x0024 Channel 4: 0x0025 Register count 2 Bytes 4 Number of bytes 1 Byte 2 Value INT 2 Byte Measured value as a signed integer. Strana 11

MODBUS RTU M e a s u r e d v a l u e a s a d e c i m a l n u m b e r This is the way to read the states of all the channels at once. They are available here as 32 bit float numbers according to IEEE 754. 0x04 Read Input register Starting address 2 Bytes Channel 1: 0x0026 Channel 2: 0x0028 Channel 3: 0x002A Channel 4: 0x002C Register count 2 Bytes 8 Number of bytes 1 Byte 4 Value float 4 Bytes Measured value. 32 bit float according to IEEE 754. M e a s u r e d v a l u e R A W v a l u e f r o m A D C This is the way to get values directly from the internal A/D converter without any conversion. Values are 16 bit numbers directly from the converter. 0x04 Read Input register Starting address 2 Bytes Channel 1: 0x002E Channel 2: 0x002F Channel 3: 0x0030 Channel 4: 0x0031 Register count 2 Bytes 2 Number of bytes 1 Byte 2 Value float 2 Bytes Measured 16 bit value from the converter. Strana 12

MODBUS RTU I n p u t s a n d o u t p u t s R e a d i n g t h e s t a t e s o f i n p u t s (This functionality is available only in the Drak 4 meter.) This function code is dedicated for reading digital inputs for contact. It reads one or both inputs. The number of the first read input and the number of inputs to be read are specified here. The input addresses start from zero. The addresses of inputs 1 and 2 are 0 and 1. In the response, inputs states are represented by individual bits. Value 1 means an active input (voltage is connected or contact is on), value 0 stands means an inactive input. The lowest bit in the first byte of the response represents the state of the first input that was addressed in the request. 0x02 Read Discrete Starting address 2 Bytes 0x0000 to 0xFFFF Number of inputs 2 Bytes 1 or 2 Number of values 1 Byte 1 State 1 Byte State of inputs Example: Example of the input reading. Request: Response: Function code 0x02 Function code 0x02 MSB address 0x00 Number of bytes 0x01 LSB address 0x00 State of inputs 0x01 Number of MSB inputs Number of LSB inputs 0x00 0x02 The result of the request is the byte 0x01, which is 0000 0001 in the binary code. Individual bits correspond to the states of the inputs. The lowest bit represents the input number 1. Strana 13

MODBUS RTU R e a d i n g t h e s t a t e s o f o u t p u t s (This functionality is only available in the Drak 4 meter.) This function code is dedicated for reading output states. The address of the output is 0. In the response, output states are represented by individual bits. The value 1 means a connected output, the value 0 stands for a disconnected output. Output states are represented by the lowest bit in the first byte of the response. 0x01 Read Coils Starting address 2 Bytes 0x0000 to 0xFFFF Number of outputs 2 Bytes 1 Response: Number of values 1 Byte 1 State 1 Byte Input state Example: Example of reading outputs 1 and 2. Request: Response: Function code 0x01 Function code 0x01 MSB address 0x00 Number of bytes 0x01 LSB address 0x00 State of outputs 0x01 Number of MSB outputs Number of LSB outputs 0x00 0x01 The result of the request is the byte 0x01, which is 0000 0001 in the binary code. The second lowest bit is set. The output 1 is on. (The remaining bits are filled with zeros.) Strana 14

MODBUS RTU O u t p u t s e t u p (This functionality is only available in the Drak 4 meter.) This function code controls the output. The address of the output is 0. The requested output states are specified in the variable State of outputs. The logical value 1 means the output is connected, the logical 0 means the output is disconnected. 0x05 Write Single Coils 0x0F Write Multiple Coils Starting address 2 Bytes 0x0000 to 0xFFFF Number of outputs 2 Bytes 1 Number of bytes 1 Byte 1 Values 1 Byte State of the output Example: Example of output state writing: Request: Response: Function code 0x0F Function code 0x0F MSB address 0x00 MSB address 0x00 LSB address 0x00 LSB address 0x00 Number of MSB outputs 0x00 Number of MSB outputs 0x00 Number of LSB outputs 0x01 Number of LSB outputs 0x01 Number of bytes MSB values LSB values 0x01 0x00 0x01 The result of the request is the byte 0x01, which is 0000 0001 in the binary code. The output is connected. (The remaining bits are filled with zeros.) Strana 15

MODBUS RTU Data transmission in industry, line and protocol conversions, RS232/485/422/USB/Ethernet/GPRS/ WiFi, measurement modules, intelligent temperature sensors, I/O modules, and custommade electronic applications. Address: Strašnická 3164/1a 102 00 Praha 10 Czech Republic Telephone: +420 267 314 267-8 +420 602 379 954 Fax: +420 267 314 269 Internet: E-mail: info@papouch.com w w w. p a p o u c h. c o m