Weighing Controller - Vec-P: Modbus Interface Description

You might also like

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

WEIGHING CONTROLLER –

VEC-P

MODBUS INTERFACE DESCRIPTION


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

TABLE OF CONTENTS

1.0 General. ....................................................................................................... 3

2.0 Interface ...................................................................................................... 3


2.1 Transmission Mode .........................................................................................3
2.2 Communication Protocol. ...............................................................................3
2.3 Transmission Rate ................................................................................ 3
2.4 Transmission mode ........................................................................................ 3
2.5 Data Format. ....................................................................................................3
2.6 Error Check. .......................................................................................... 3

3.0 Protocol....................................................................................................... 3
3.1 Message Format..............................................................................................3
3.1.1 Slave Address. ....................................................................................4
3.1.2 Function Code .....................................................................................4
3.1.3 Data .......................................................................................................4
3.1.4 Error Check Code ...................................................................... 4

4.0 Slave unit (VEC-P) Response .................................................................... 4


4.1 Normal Response ................................................................................. 4
4.2 Response to Defective Message ..................................................................5
4.3 No Response ...................................................................................................5

5.0 Message Format (RTU) .............................................................................. 5


5.1 Reading 16 bit value of one or more Registers. .........................................5
5.1.1 Query Message ...................................................................................6
5.1.2 Response Message ............................................................................6
5.2 Loopback Diagnostic Test..............................................................................6
5.2.1 Query Message .......................................................................... 6
5.2.2 Response Message ............................................................................6
5.3 Writing 16 bit value to one or more Registers........................................... 6
5.3.1 Query Message .......................................................................... 7
5.3.2 Response Message ............................................................................7
5.4 Calculating CRC-16 code ...................................................................... 7

6.0 Registers MAP .........................................................................................................7


6.1 Registers (Output)… ...................................................................................7
6.2 Registers (input)… ......................................................................................9

Software_version: B-1.5 -2-


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

1.0 General

The Serial Interface on the Weighing Controller, VEC-P can be used for communication
with a Supervisory Controller. The Supervisory controller can access VEC-P weighing &
configuration data through the serial interface.

2.0 Interface

1.1. Transmission Mode - Half Duplex, Asynchronous, RS-485

1.2. Communication Protocol - Modbus

1.3. Transmission Rate – 9600, 19200, 38400, 57600, 115200 baud

1.4. Transmission mode - RTU mode

1.5. Data Format:


Data - 8 bits
Parity - Even/Odd/None (User selectable)
Stop bits - 1 bit

2.6 Error Check - CRC-16

3.0 Protocol

Communication between the Master Controller and Slave VEC-P unit is controlled by the
Master controller. In all cases, the Master unit initiates data transmission and VEC-P
responds to it. When master unit begins data transmission, it sends a set of data (query
message) to VEC-P unit in a fixed sequence. Upon receiving the query message, the
slave unit decodes it, takes the necessary action and returns a fixed data (response
message) to the Master unit.

3.1 Message Format

The message consists of four parts: slave (VEC-P) address, function code, data and
error check code, which are always transmitted in this sequence.

SLAVE ADDRESS
FUNCTION CODE
DATA

ERROR CHECK

Software_version: B-1.5 -3-


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

3.1.1 Slave address

This is a number in the range 01 to 99, which is preset for each slave unit. The master
unit communicates with only one slave unit at a time. Although all connected slave units
receive the query message sent from the master unit, only the slave unit having the
slave address coinciding with the query message accepts the message.

The Slave address "0" can be used with some function codes so that all slave units
accept the query message regardless of their preset addresses. In this case, no slave
unit returns a response message to the master unit after command execution.

3.1.2 Function code

The master unit specifies function to be executed to a slave unit using function code.
The functions possible with VEC-P unit are as follows,

Function code Function Description


(Decimal)
3 or 4 Read 16 bit value of one or more Register Contents
8 Loop back diagnostic test
16 Write 16 bit value to one or more Register Contents

3.1.3 Data

After setting the function, the master unit sends the data needed to execute the function
to the slave unit. Data depends on the function.

3.1.4 Error Check Code

CRC-16 (Cyclic Redundancy Check) is used for error detection.

4.0 Slave unit (VEC-P) Response

Receiving a query message from the master unit, the slave unit examines it and, when
valid, decodes and executes it. If invalid, the slave unit ignores the message and takes
no action. For all valid messages, the slave unit prepares a response message and
transmits it to the master unit. For defective messages, like reference to illegal Function
codes, the slave unit transmits a message identifying the defect.

4.1 Normal Response

Software_version: B-1.5 -4-


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

Messages from the master with Function codes 8, the slave unit responds with the same
message as the query message.
In the response message of reading out functions, 3 or 4, the slave address and function
code are the same as in the query message and the data read out is appended.

4.2 Response to Defective Message

If the query message is defective (except in the case of transmission error), the slave
unit takes no action and returns the response message as shown below,

SLAVE ADDRESS
1 FUNCTION CODE Function code +80H
ERROR CODE
ERROR CHECK

The master unit can determine if the slave unit has executed the query message, by
examining the function code involved in the response message. If it detects an error, the
error code that follows the function code can be examined to detect the type of error.

ERROR CODE DESCRIPTION


1 Invalid Function code
2 Number out of range
3 Number of elements out of range
17 CRC-16 error

4.3 No Response

In the following cases, the slave unit ignores the query message and does not respond.
- Transmission error in query message
- Slave address in message different from the address assigned
- Time interval between adjacent data in the query message is greater than 1 sec.

When the slave address is "0" with a writing function, all slave units execute the query
message but do not respond.

5.0 Message Format

5.1 Reading 16 bit value of one or more Registers

The numbers of registers whose numbers are continuous are read out when the number
of bytes and their starting numbers are designated.

Software_version: B-1.5 -5-


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

The contents of holding registers are entered in the response message as Data, divided
into two parts: the high order eight bits and the low order 8 bits, arranged in the order of
the register numbers.

5.1.1 Query Message

SLAVE ADDRESS 01-99


FUNCTION CODE 3 or 4
STARTING NUMBER (HIGH BYTE) First Register Number
STARTING NUMBER (LOW BYTE)
NUMBER OF REGISTER (HIGH BYTE)
NUMBER OF REGISTER (LOW BYTE)
CRC-16 (HIGH BYTE)
CRC-16 (LOW BYTE)

5.1.2 Response Message

SLAVE ADDRESS 01-99


FUNCTION CODE 3 or 4
NUMBER OF BYTES No. of Registers * 2
DATA-1st REGISTER (HIGH BYTE)
DATA-1st REGISTER (LOW BYTE)
==
CRC-16 (HIGH BYTE)
CRC-16 (LOW BYTE)

5.2 Loopback Diagnostic Test

This function permits checking communication between master and the slave unit.

5.2.1 Query Message

SLAVE ADDRESS 01-99


FUNCTION CODE 8
TEST CODE (HIGH BYTE) Must be "0"
TEST CODE (LOW BYTE) Must be "0"
DATA (HIGH BYTE) Any data
DATA (LOW BYTE) Any data
CRC-16 (HIGH BYTE)
CRC-16 (LOW BYTE)

5.2.2 Response Message

Software_version: B-1.5 -6-


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

This is same as the query message.

5.3 Writing 16 bit values to one or more registers

The numbers of registers whose numbers are continuous are written to by stating the
starting address, number of bytes and data to be written to address location .
The response shall return the starting address byte, number of registers and byte count.

5.3.1 Query Message

SLAVE ADDRESS 01-99


FUNCTION CODE 16
STARTING NUMBER (HIGH BYTE) First Register Number
STARTING NUMBER (LOW BYTE)
NUMBER OF REGISTER (HIGH BYTE)
NUMBER OF REGISTER (LOW BYTE)
BYTE COUNT
DATA 1 MSB
DATA 1 LSB


DATA n MSB
DATA n LSB
CRC-16 (HIGH BYTE)
CRC-16 (LOW BYTE)

5.3.2 Response Message

SLAVE ADDRESS 01-99


FUNCTION CODE 16
STARTING NUMBER (HIGH BYTE)
STARTING NUMBER (LOW BYTE)
NUMBER OF REGISTER (HIGH BYTE)
NUMBER OF REGISTER (LOW BYTE)
BYTE COUNT
CRC-16 (HIGH BYTE)
CRC-16 (LOW BYTE)

6.0 Register map for input and Output Data on MODBUS

6.1 Registers (Inputs)

Software_version: B-1.5 -7-


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

Address Description Range

000 Recipe Selection Unsigned Int-16


Decimal point & units as
per VEC-P configuration

001 No of Batches Unsigned Int-16.


Decimal point & units as
per VEC-P configuration

002 Target Unsigned Int-16.


Decimal point & units as
per VEC-P configuration

003 Fast Feed Unsigned Int-16.


Decimal point & units as
per VEC-P configuration

004 Middle Feed Unsigned Int-16.


Decimal point & units as
per VEC-P configuration

005 Inflight Unsigned Int-16.


Decimal point & units as
per VEC-P configuration

006 +ve Totalizer Unsigned Int-16.


Decimal point & units as
per VEC-P configuration

007 -ve Totalizer Unsigned Int-16.


Decimal point & units as
per VEC-P configuration

008 Capacity Read Only.


Unsigned Int-16

008 Decimal Point Read Only.


Unsigned Int-16

Software_version: B-1.5 -8-


MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

009 Apply Bit Unsigned Int-16

Note: After changes done on from Address 000-008, the values will be Saved in Memory
after Apply Bit is made ‘1’.

6.2 Registers (Outputs)

Address Description Range

100-101 Gross Weight Unsigned Int-32


Decimal point & units
asper VEC-P
configuration
102-103 Net Weight Unsigned Int-32.

104-105 Batch Result Unsigned Int-32

106 Input 0 0 – INPUT0 OFF


1 – INPUT0 ON

107 Input 1 0 – INPUT1 OFF


1 – INPUT1 ON

108 Input 2 0 – INPUT2 OFF


1 – INPUT2 ON

109 Input 3 0 – INPUT3 OFF


1 – INPUT3 ON

110 Output 0 0 – OUTPUT0 OFF


1 – OUTPUT0 ON

111 Output 1 0 – OUTPUT1 OFF


1 – OUTPUT1 ON

112 Output 2 0 – OUTPUT2 OFF


1 – OUTPUT2 ON

113 Output 3 0 – OUTPUT3 OFF


1 – OUTPUT3 ON

114 Output 4 0 – OUTPUT4 OFF


1- OUTPUT4 ON
Software_version: B-1.5 -9-
MODBUS INTERFACE DESCRIPTION
Weighing Controller
VEC-P: B-1.5

115 Output 5 0 – OUTPUT5 OFF


1 – OUTPUT5 ON

116-117 Totalizer Count Unsigned Int-32

118-119 Totalizer Net Value Unsigned Int-32

Software_version: B-1.5 - 10 -

You might also like