0% found this document useful (0 votes)
528 views19 pages

Dini Argeo CPWEBELT-MODBUS - 01.00 - 10.10 - EN

This document describes the Modbus communication protocol for a weight indicator. It discusses selecting the Modbus serial communication mode in the indicator's setup environment. It also describes the RTU transmission mode, message format, supported Modbus functions, input and output data registers, and error checking. The document provides information for integrating the weight indicator with other devices using the Modbus protocol.

Uploaded by

sava88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
528 views19 pages

Dini Argeo CPWEBELT-MODBUS - 01.00 - 10.10 - EN

This document describes the Modbus communication protocol for a weight indicator. It discusses selecting the Modbus serial communication mode in the indicator's setup environment. It also describes the RTU transmission mode, message format, supported Modbus functions, input and output data registers, and error checking. The document provides information for integrating the weight indicator with other devices using the Modbus protocol.

Uploaded by

sava88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

WEIGHT INDICATOR

MICROCONTROLLER

CPWE-BELT
MODBUS

Communication protocol

CPWE-BELT_01.00_10.10_EN_MODBUS
CPWE-BELT_MODBUS_APPENDIX

INDEX
1. GENERALITIES..................................................................................................................................................................2
2. SYMBOLS...........................................................................................................................................................................2
3. SELECTION OF THE “MODBUS” SERIAL COMMUNICATION MODE............................................................................2
4. RTU (BINARY) MODBUS TRANSMISSION MODE ...........................................................................................................3
5. DESCRIPTION OF THE COMPONENTS AND MESSAGE FORMAT................................................................................3
5.1 FRAME FORMAT IN RTU MODE................................................................................................................................3
5.2 THE DEVICE ADDRESS .............................................................................................................................................4
5.3 THE FUNCTION CODE ...............................................................................................................................................4
5.4 THE DATA ...................................................................................................................................................................4
5.5 THE ERROR CHECK ..................................................................................................................................................4
5.6 EXAMPLE OF THE MESSAGE COMPONENTS IN RTU............................................................................................5
6. MODBUS FUNCTIONS.......................................................................................................................................................6
6.1 LIST OF THE SUPPORTED FUNCTIONS ..................................................................................................................6
6.2 LIST OF THE TRANSMISSION STRINGS ..................................................................................................................6
6.3 FUNCTION 1: READ INPUT REGISTERS (04 Hex)....................................................................................................6
6.4 FUNCTION 2: PRESET SINGLE REGISTER (06 Hex) ...............................................................................................7
6.5 FUNCTION 3: PRESET MULTIPLE REGISTERS (16 Hex).........................................................................................8
7. ERROR CHECK METHODS ...............................................................................................................................................9
7.1 PARITY CHECK...........................................................................................................................................................9
7.2 CRC ALGORITHM: CYCLICAL REDUNDANCY CHECK (RTU MODE)......................................................................9
7.3 A PROCEDURE FOR CREATING THE CRC IS THE FOLLOWING ...........................................................................9
7.4 PLACING OF THE CRC IN THE MESSAGE .............................................................................................................10
7.5 EXAMPLE IN C LANGUAGE IN GENERATING THE CRC .......................................................................................10
8. MODBUS EXCEPTIONS ..................................................................................................................................................11
8.1 LIST OF THE DETECTED EXCEPTIONS .................................................................................................................11
9. INPUT AND OUTPUT DATA AREAS...............................................................................................................................11
9.1 INPUT DATA AREA: INPUT REGISTERS.................................................................................................................11
9.1.1 COMMAND STATUS REGISTER .....................................................................................................................13
9.1.2 BELT STATUS REGISTER ...............................................................................................................................14
9.1.3 INPUT STATUS REGISTER .............................................................................................................................15
9.1.4 OUTPUT STATUS REGISTER..........................................................................................................................15
9.1.5 SETPOINT STATUS REGISTER ......................................................................................................................16
9.2 OUTPUT DATA AREA: HOLDING REGISTERS .......................................................................................................16
9.2.1 COMMAND REGISTER ....................................................................................................................................17

1
CPWE-BELT_MODBUS_APPENDIX

1. GENERALITIES
The Modbus communication protocol defines the structure of the messages and the communication mode between a
“master” device which manages the system and one or more “slave” devices which respond to the interrogations of the
master (master-slave technique).
This protocol defines how the transmitter and receiver are identified, the data switch mode, the communication launch and
interruption modes and the error detection mode.

Only the master can start a transaction (Query) while the other devices (the slaves) respond by supplying the data
requested to the master or carrying out the actions requested in the query. The master can either address single slaves or
transmit a broadcast message to all. The slaves respond with a message (Response) to the queries which are individually
addressed, but do not transmit any answer to the master if there are broadcast messages.
A transaction can therefore have the following structures:
- Single question to a slave / Single answer from the slave
- Single broadcast message to all the slaves / No answer from the slaves

2. SYMBOLS
In the manual:

msb= most significant bit

MSB= most significant byte

lsb= least significant bit

LSB= least significant byte

3. SELECTION OF THE “MODBUS” SERIAL COMMUNICATION MODE


To select the Modbus communication protocol mode one should enter in the SET-UP ENVIRONMENT of the instrument:

Input in the Setup environment


Turn on the indicator, press TARE key during the countdown (the display shows the “LANG” menu).
- Select the "Setup" step (using the F6 or F7 key) and press ENTER;
- Select the "Serial" step (using the F6 or F7 key) and press ENTER;
- Select the "Com pc" step (using the F6 or F7 key) and press ENTER;
- Select the “Baud” step (using the F6 or F7 key) and press ENTER; select the desired baud rate and press
ENTER.
- Select the “Parity, Word, Stop B.” steps (using the F6 or F7 key) and press ENTER; select the desired parameter and
press ENTER.
- Select the "Protoc." step (using the F6 or F7 key) and press ENTER; select the "MODBUS" parameter and press
ENTER;
- Select the "Add.485" step (using the F6 or F7 key) and press ENTER; enter the machine code of the scale and
press ENTER;
- Press various times the C key until the display shows the “SAVE?” message.
- Press ENTER to confirm the changes made, and C to exit without saving.

See the instrument’s technical manual for further details.

2
CPWE-BELT_MODBUS_APPENDIX

4. RTU (BINARY) MODBUS TRANSMISSION MODE


Each byte (8 bit) in a message has 2 hexadecimal characters of 4 bits.
The main advantage of this mode, in comparison to the ASCII, is its greater density of characters which allow for the
transmission of higher volume of data equal to the baud rate.

5. DESCRIPTION OF THE COMPONENTS AND MESSAGE FORMAT


In the RTU transmission modes, a Modbus message is put by the transmitting device inside a frame, which has a known
beginning and end point. This allows for the receiving devices to locate the beginning of the message, read the address part
and determine which device it is addressed to (or all the devices, if the message is broadcast) and to know when the
message is complete. In this way the incomplete messages can be detected and consequently indicated as errors.
The format of the messages, for the master as well as the slave, includes:

 The address of the device with which the master has established the transaction (the address 0 corresponds to a
broadcast message transmitted to all the slave devices).
 The function code which defines the requested action.
 The data which must be transmitted.
 The error check made up according to the CRC algorithm.

These fields are described in detail in the following paragraphs. For the Query and Response there is:

Query:
The function code tells the addressed slave device which action must be made. The data bytes contain some additional
information which the slave needs in order to execute the function. The error check field gives the slave a method in order to
confirm the integrity of the message contents.

Response:
 If the slave gives a normal answer:
The function code is the echo of the query function code. The data bytes contain the data retrieved from the slave, like
the registers’ values or the states.
 If a slave locates an error (format, parity, or in the CRC) or it is unable to execute the requested action:
The master message is considered non valid and rejected and consequently the action will not be executed; a Response
in which the function code is changed in order to indicate that is an error response and the data bytes contain a code
which describes the error.

5.1 FRAME FORMAT IN RTU MODE


In the RTU mode the messages start with a silent interval that lasts at least a period equal to 3,5 times the time period of a
character (T1-T2-T3-T4 time interval, see Figure 1). The devices monitor continuously the transmission bus, also during the
silent intervals. When the first field (the address) is received, each device decodes it in order to verify whether the device is
addressed.
For each field the characters which may be transmitted are all the decimal values from 0 to 255.
After the last transmitted character there will be a silent interval equal to at least 3,5 times the time period of a character,
indicating the end of the message; after this a new message can start.
The entire frame must be transmitted as a continuous stream. If there is a silent interval greater than the time period of 1,5
characters before the completion of the frame, the receiving device considers the incomplete message as ended and
assumes that the next byte is the address field of a new message.
In the same way, if a new message starts before a time period equal to 3,5 characters following a previous message, the
receiving device considers it a continuation of the previous message. This causes an error, and consequently the value in
the final field of the CRC will not be valid, due to the combination of the two messages.

3
CPWE-BELT_MODBUS_APPENDIX

A typical message frame is shown in the following figure:

CRC
START ADDRESS FUNCTION DATA CHECK END

T1-T2-T3-T4 8 BITS 8 BITS N * 8 BITS 16 BITS T1-T2-T3-T4


Figure 1

5.2 THE DEVICE ADDRESS


As mentioned above, the Modbus transactions always involve the master, which manages the line, and a slave at a time
(except for the broadcast messages). In order to identify the message consignee, the numeric address of the selected slave
device (one byte: eight bits for the RTU) is transmitted as the first field of the frame. Each slave will therefore be assigned a
different address number so that it can be identified. When the slave transmits its answer, its address is entered in the
response’s field address in order that the master knows which slave is responding.

Valid addresses for the slave devices are within a range from 0 to 247, in particular:

0  broadcast address (all the slave devices)


1  minimum possible address for the slave
247  maximum possible address for the slave

5.3 THE FUNCTION CODE


The field of the frame function code of a message contains eight bits (RTU). Valid codes are within the range from 1 to 255
decimals.
When a message is transmitted from a master to a slave device the function code field indicates to the slave what kind of
action should be executed (for example the reading of the Input Registers, etc.).
When a slave responds to the master, it uses the function code field in order to indicate either a normal response (without
errors) or a type of error which has already taken place (called exception responses). For a normal response, the slave
simply echoes the original function code, while for an exception response it gives back a code which is equivalent to the
original function code, but with the most significant bit set at the 1 logic value.
Besides the modification of the function code for an exception response, the slave enters a single code within the data field
of the response message, in order to tell the master which type of error has taken place or the reason for the exception.

5.4 THE DATA


The data field is made by using groups of two hexadecimal digits, in the range from 00 to FF Hex. This can be made by a
RTU character, in accordance with the network’s serial transmission mode.
The field data of the messages transmitted from the master to the slave devices contains additional information which the
slave must use in order to carry out the action defined by the function code.

5.5 THE ERROR CHECK


The contents of the error check field depend on the Modbus transmission mode because there are two distinct error check
methods. In particular:

The communication strings are checked by a CRC (Cyclical Redundancy Check) algorithm, see Section 7 for further
details.

The error check field contains 16 bits (implemented as 2 bytes of 8 bits), which are the result of the calculation of a CRC
algorithm executed on the contents of the message.
This field is the last of the message and the first byte is the one of the low order and is followed by one of the high order,
which is the last one of the frame.

4
CPWE-BELT_MODBUS_APPENDIX

5.6 EXAMPLE OF THE MESSAGE COMPONENTS IN RTU


The following tables show an example of the fields inside a Modbus message, for a Query as well as for a normal Response;
in both cases the fields’ content is shown in hexadecimals and how the message is organized (framed) in RTU mode.

Query: “Read Input Registers” to the 01 Slave Device address, for the reading of the contents of 3 registers starting
from register n°8.

Field Name Example (Hex) RTU: 8-bit field


Heading None
Slave Address 01 0000 0001
Function 04 0000 0100
Start Address (HIGH) 00 0000 0000
Start Address (LOW) 08 0000 1000
Number of Registers (HIGH) 00 0000 0000
Number of Registers (LOW) 03 0000 0011
Error Check CRC (16 bits)
Terminator None
Nr. of total bytes 8

Response:

Field Name Example (Hex) RTU: 8-bit field


Heading None
Slave Address 01 0000 0001
Function 04 0000 0100
Number of bytes 06 0000 0110
Data (HIGH) 02 0000 0010
Data (LOW) 2B 0010 1011
Data (HIGH) 00 0000 0000
Data (LOW) 00 0000 0000
Data (HIGH) 00 0000 0000
Data (LOW) 63 0110 0011
Error Check CRC (16 bits)
Terminator None
Nr. of total bytes 11

In the Response of the Slave there is the Function Echo indicating that it’s a normal type of answer.
The “Number of Bytes” field specifies how many groups of 8-bit data are given back, in other words, the number of bytes of
the “Data” fields is shown for the RTU.
For example the 63 Hex value is transmitted as a 8-bit byte (01100011).

5
CPWE-BELT_MODBUS_APPENDIX

6. MODBUS FUNCTIONS
Each function is exposed in detail in the following pages and is made up of a QUERY (Master request → Instrument) and a
RESPONSE (Instrument response → Master).

NOTE:
Each character is an Hexadecimal type of character (made up of 4 bits).

With 0x or Hex before a number it means that it has to do with a hexadecimal value.

6.1 LIST OF THE SUPPORTED FUNCTIONS


In the following table there are the active Modbus functions for the instrument.

Function Code Description


04 (0x04) READ INPUT REGISTERS
06 (0x06) PRESET SINGLE REGISTER
16 (0x10) PRESET MULTIPLE REGISTERS
Table 1

In the parentheses there are the hexadecimal values.

6.2 LIST OF THE TRANSMISSION STRINGS


In the following paragraphs the functions (shown in Table 8) supported by the instrument are described in detail; for this
purpose one uses the following classification for the message fields:

 Address: 1 byte for the instrument address (slave).


 Function: Code or Number of the function to be executed.
 Number of bytes: represents the number of bytes which make up a datum.
 Error Check (CRC): for the error check, in the RTU and in the ASCII transmission modes it’s always 2 bytes. See
section 7 for further details.

Other fields for the message frames are described in detail in the various single functions.

NOTE: the following registers are defined, on which the functions operate:
- N°16 Input Registers (or “Input Registers”): written by the Instrument → read by the Master
- N°16 Output Registers (or “Holding Registers”): written by the Master → read by the Instrument

The input and output registers are fully described in section 9.

6.3 FUNCTION 1: READ INPUT REGISTERS (04 Hex)


It reads the contents of the slave instrument’s input registers (or “input registers”, which the instrument will write);
the broadcast communication is not supported.

Query:
The Initial Register is specified (1st Register Address) from which the reading starts and the Number of Registers which
must be read (Nr. of Registers). The registers are addressed from 0: in this way the registers from 1 to 16 are addressed as
0 to 15.

6
CPWE-BELT_MODBUS_APPENDIX

Address Function Address 1st Register Nr. of Registers Error


High Low High Low Check
A 04 00 08 00 01 CRC

Response:
The response message is made up of 2 bytes for each read register, with the binary content aligned on the right in each
byte. For each register the first byte contains the most significant bits and the second byte contains the least significant bits.

Address Function Address 1st Register Nr. of Registers Error


High Low High Low Check
A 04 02 00 0A CRC

Example: A = 01;
- in the Query: 1st Register address = 00 08; Number of Registers = 00 01
- in the Response: 1st Register = 00 0A

6.4 FUNCTION 2: PRESET SINGLE REGISTER (06 Hex)


It allows to set a single output register (or “holding register”, which the instrument or slave goes to read) to a
determined value.
The broadcast transmission of this command is allowed and in which one can set the same register in all the
connected slaves.

Query:
One specifies the Register Address which must be set (Register Address) and the relative Value (Register Value). The
registers are addressed starting from 0: in this way the registers from 1 to 16 are addressed as 0 to 15.

Address Function Address 1st Register Nr. of Registers Error


High Low High Low Check
A 06 00 01 00 03 CRC

Response:
It is the echo of the Query.
Address Function Address 1st Register Nr. of Registers Error
High Low High Low Check
A 06 00 01 00 03 CRC

Example: A = 01;
- in the Query: Register Address = 00 01; Register Value = 00 03
- in the Response: Register Address = 00 01; Register Value = 00 03

7
CPWE-BELT_MODBUS_APPENDIX

6.5 FUNCTION 3: PRESET MULTIPLE REGISTERS (16 Hex)


Allows to set various output registers (or “holding register”, which the instrument or slave goes to read) to a
determined value.

Query:
Here is specified the address of the First output Register which must be set (1st Register address), the Number of Registers
to be written (Nr. of Registers) starting from the first, the number of bytes transmitted for the values of the registers (2 bytes
for each register) or Nr. of Bytes and then the values to be assigned to the registers (1st Register value of 2 bytes, 2nd
Register Value, etc.) starting from the first one addressed.

Address Function 1st Register Nr. of Nr. of 1st Register 2nd Register Error Check
Address Registers bytes Value Value
High Low High Low High Low High Low
A 10 00 00 00 02 04 00 00 00 00 CRC

Response:
The response includes the identification of the modified registers (1st Register address and Nr. of Registers).

Address Function Address 1st Register Nr. of Registers Error Check


High Low High Low
A 10 00 00 00 02 CRC

Example: A = 01;
- in the Query: 1st Register Address = 00 00; Nr. of Registers = 00 02; Nr. of bytes = 04;
1st Register Value = 00 00; 2nd Register Value = 00 00;
- in the Response: 1st Register Address = 00 00; Nr. or registers = 00 02;

8
CPWE-BELT_MODBUS_APPENDIX

7. ERROR CHECK METHODS


The Modbus serial communication uses two error check types:

Check on the character or parity (even or uneven), can be applied optionally to each character
Check on the frame (CRC algorithm), applied to the entire message.

Both the check on the character as well as the one on the frame of the message is created in the Master and applied to the
contents of the message before the transmission. The Slave checks each character and the entire frame of the message
during the reception.

7.1 PARITY CHECK


It is possible to configure the parity check in the following way:
n  no parity (none)
E  even parity (Even)
This determines how the parity is set in each character.

7.2 CRC ALGORITHM: CYCLICAL REDUNDANCY CHECK (RTU MODE)


In the RTU transmission mode, the messages include an error check field based on a CRC method, which checks the
contents of the entire message and is applied without any regard to any parity method used for the single characters. The
CRC field is made up of 2 bytes (containing a binary value of 16 bits) and is calculated from the transmitting device, which
puts the CRC at the end of the message. The receiving device calculates again the CRC during the reception of the
message, and compares the calculated value with the actual value received in the CRC field. If the two values are not the
same an error has taken place.

7.3 A PROCEDURE FOR CREATING THE CRC IS THE FOLLOWING


1. Loading a 16-bit register with FFFF Hex (all 1). This register is called Register CRC

2. OR-exclusive with the first byte of the message and the least significant byte of the CRC Register at 16 bit.
The result is inserted in the CRC register.

3. The CRC Register is shifted of 1 bit to the right (towards the LSB), a 0 is inserted in the place of the MSB. The LSB is
extracted and examined.

4. If LSB = 0 → Step 3 is to be repeated. (another shift)


If LSB =1 → The OR-ex is made between the CRC Register and the A001 Hex (1010 0000 0000 0001) polynomial
value.

5. Steps 3. and 4. are repeated until 8 shifts have been made; after this a byte of 8 bits have been completely processed.

6. Steps 2 to 5 are repeated for the next byte of 8 bits of the message.
One continues until all the bytes are processed.

7. The final contents of the CRC Register are the CRC Value.

8. When the CRC is inserted within the message, its bytes (high and low) must be exchanged as described below.

9
CPWE-BELT_MODBUS_APPENDIX

7.4 PLACING OF THE CRC IN THE MESSAGE


When the 16 bits of the CRC (2 bytes) are transmitted in the message, the least significant byte must be transmitted first,
followed by the most significant byte.

For example, if the CRC value is 1241 Hex (0001 0010 0100 0001):

Data CRC CRC


Addr Func Data Data Data Data
Count LOW HIGH

41 12
Fig. 5: Sequence of the CRC bytes.

7.5 EXAMPLE IN C LANGUAGE IN GENERATING THE CRC


A functioning example for the creation of the CRC in the C language is shown below.

NOTE: The function creates internally the swapping of the high and low bytes of the CRC. The bytes are already exchanged
in the CRC value which is given back by the function, which can then be placed directly in the message for the transmission.

The function uses two arguments:

unsigned char *puchMsg; → A pointer to the message buffer which contains the binary data to be used for
creating the CRC
→ The quantity of bytes in the message buffer
unsigned short usDataLen;→

The function gives back the CRC value as an unsigned short.

10
CPWE-BELT_MODBUS_APPENDIX

8. MODBUS EXCEPTIONS
In a normal response (Normal Response) the Slave device echoes the Function Code of the Query, putting it in the
Response Function field. All the function codes have their own most significant bit (MSB) set at 0 (values less than 80 Hex).
In an exception response (Exception Response) the slave sets the MSB of the Function Code at 1 (equivalent to summing
the value 80 Hex to the normal response code) in order to signal that an anomaly has taken place, and the Exception Code
is given back in the Data Field, in order to indicate the type of exception.

8.1 LIST OF THE DETECTED EXCEPTIONS


Active Modbus exceptions

Code Exception Description


The Function Code received by the Query is not supported or not
01 illegal Function
valid
The Data Address received in the Query is not an address
02 Illegal Data Address
supported by the Slave Device or is not valid
A Value in the Data field of the Query is not a value acceptable by
03 Illegal data Value
the Slave device or is not valid
The Slave is busy in processing a command which requires a lot
06 Slave Device Busy of time. The Master can transmit again the message later, when the
Slave is free
Table 2

9. INPUT AND OUTPUT DATA AREAS


There are two data areas, an input one and an output one, defined this way due to the master’s point of view: while the input
area is read by this device, the output one is written.
Both the areas are organized in registers (an input and output one) on which the Modbus protocol functions interact.
All the numeric values for the Data Input Area and the Data Output Area, have the Big Endian format (the 1st byte is the
most significant one).

9.1 INPUT DATA AREA: INPUT REGISTERS


The input data area is read by the master (is therefore written by the instrument) and is made up of 16 registers (input
registers), each of 2 bytes (32 bytes overall).
The input data area is divided in two pages:

Page 0

Reg. nr. Byte nr. Input Registers


Command Status Register: Number of Processed Commands (4 bit) nibble low
Byte 0
0 Command Status Register: Result of last command (4 bit) nibble high
Byte 1 Command Status Register: Displayed page
Belt Status Register: Functioning mode (4 bit) nibble low
Byte 2
1 Belt Status Register: Belt status (4 bit) nibble high
Byte 3 Belt Status Register: Error code
- Format of the Command Status Register value
See 9.1.1 section
- Format of the Belt Status Register value
See 9.1.2 section
11
CPWE-BELT_MODBUS_APPENDIX

Byte 4 Net Weight Value (MSB)


2
Byte 5 Net Weight Value
Byte 6 Net Weight Value
3
Byte 7 Net Weight Value (LSB)
Byte 8 Instantaneous flow (MSB)
4
Byte 9 Instantaneous flow (LSB)
Byte 10 Instantaneous PID value (MSB)
5
Byte 11 Instantaneous PID value (LSB)
Byte 12 Instantaneous DAC value of the analogue output (MSB)
6
Byte 13 Instantaneous DAC value of the analogue output (LSB)
Byte 14 Partial Total (MSB)
7
Byte 15 Partial Total
Byte 16 Partial Total
8
Byte 17 Partial Total
Byte 18 Partial Total
9
Byte 19 Partial Total (LSB)
Byte 20 General Total (MSB)
10
Byte 21 General Total
Byte 22 General Total
11
Byte 23 General Total
Byte 24 General Total
12
Byte 25 General Total (LSB)
Byte 26 Input Status Register (MSB)
13
Byte 27 Input Status Register (LSB)
Byte 28 Output Status Register (MSB)
14
Byte 29 Output Status Register (LSB)
- Format of the Input Status Register value
See 9.1.3 section
- Format of the Output Status Register value
See 9.1.4 section
Byte 30 General total of executed dosages
15 Number of scale decimals (4 bit) nibble low
Byte 31
Number of scale decimals (2 bit) nibble high
Table 3

Page 1

Reg. nr. Byte nr. Input Registers


Command Status Register: Number of Processed commands (4 bit) low nibble
Byte 0
0 Command Status Register: Result of last command (4 bit) high nibble
Byte 1 Command Status Register: Displayed page
- Format of the Command Status Register value
See 9.1.1 section

Byte 2 Flow target (for the REGULATOR mode) (MSB)


1
Byte 3 Flow target (for the REGULATOR mode) (LSB)
Byte 4 Scale capacity (MSB)
2
Byte 5 Scale capacity
Byte 6 Scale capacity
3
Byte 7 Scale capacity (LSB)
12
CPWE-BELT_MODBUS_APPENDIX

Byte 8 Maximum flow (MSB)


4
Byte 9 Maximum flow (LSB)
Byte 10 Minimum flow (MSB)
5
Byte 11 Minimum flow (LSB)
Byte 12 Dosage time (in hundredths of a second) (MSB)
6
Byte 13 Dosage time (in hundredths of a second)
Byte 14 Dosage time (in hundredths of a second)
7
Byte 15 Dosage time (in hundredths of a second) (LSB)
Byte 16 Target weight to be dosed (MSB)
8
Byte 17 Target weight to be dosed
Byte 18 Target weight to be dosed
9
Byte 19 Target weight to be dosed
Byte 20 Target weight to be dosed
10
Byte 21 Target weight to be dosed (LSB)
Byte 22 Setpoint Status Register: Active Set point number (MSB)
11
Byte 23 Setpoint Status Register: Active Set point function (LSB)
- Format of the Setpoint Status Register value
See 9.1.5 section

Byte 24 Set point enabling value (MSB)


12
Byte 25 Set point enabling value
Byte 26 Set point enabling value
13
Byte 27 Set point enabling value (LSB)
Byte 28 Set point disabling value (MSB)
14
Byte 29 Set point disabling value
Byte 30 Set point disabling value
15
Byte 31 Set point disabling value (LSB)
Table 4

NOTE: Format of the weight values


Whole in absolute value (without decimals)
Example: if 3 decimals are set, in order to enter the value 3,000 → one should write 3000
If 2 decimals are set, in order to enter the value 3,00 → one should write 300

9.1.1 COMMAND STATUS REGISTER


It is Input Register number 0; two bytes defined in the following way:

Byte 0: nibble low → Number of Processed commands


nibble high → Result of last command
Byte 1: Viewed page

In which the Result of the last received command can assume the following values:
 OK = 0 Corrected and executed command
 ExceptionCommandWrong = 1 Incorrect command
 ExceptionCommandData = 2 Data in the incorrect command
 ExceptionCommandNotAllowed = 3 Command not allowed
 ExceptionNoCommand = 4 Inexistent command

13
CPWE-BELT_MODBUS_APPENDIX

9.1.2 BELT STATUS REGISTER


It is Input Register number 1 of page 0; two bytes defined in the following way:

Byte 0: nibble low → Functioning mode


nibble high → Belt status
Byte 1: Error code

In which

Functioning mode can assume the following values:


- READER = 0 Flow reader with set point on the weight
- REGULATOR = 1 Flow regulator

Belt status can assume the following values:


- STATE_ERROR = 0 Error (alarm)
- STATE_MANUAL = 1 Manual functioning (input 2 open)
- STATE_WAIT = 2 Wait start from remote control
- STATE_PAUSE = 3 Dosage pause
- STATE_DOSAGE = 5 Dosage
- STATE_START = 6 Belt in start
- STATE_ENDDOS = 7 Dosage end
- STATE_LOCK = 8 Indicator locked
- STATE_ZEROBELT = 9 Zero flow execution

Error code can assume the following values:


00 No error
01 Alarm due to side-slipping
02 Alarm due to underflow
03 Alarm due to overflow
04 Flow error equal to zero, does not allow the start of the dosage
05 Off weight alarm, if less than minimum weight (F.Mode >> BELT >> MIN.WEI) or greater than
maximum weight (F.Mode >> BELT >> MAX.WEI)
06 Block due to belt side-slipping
07 Block due to underflow
08 Block due to overflow
09 Block due to error on total dosed weight
10 Indicator block due to hardware dosage disabling (input 2 opening)
11 Off weight block, if less than minimum weight (F.Mode >> BELT >> MIN.WEI) or greater than
maximum weight (F.Mode >> BELT >> MAX.WEI)

14
CPWE-BELT_MODBUS_APPENDIX

9.1.3 INPUT STATUS REGISTER


It is Input Register number 13 of page 0; two bytes defined in the following way:

Bit meaning
Bit Description
0 1
(LSB)
0 Net Weight Polarity + --
1 Net Weight stability Unstable weight Stable weight
2 Underload Condition NO YES
3 Overload Condition NO YES
6 Gross ZERO zone Out of Zone 0 In Zone 0
5 Unit of measure (lsb) g kg
6 Unit of measure (msb)
7 Hourly Flow Polarity + --
(MSB)
8 Capacity/flow unit of measure (lsb) kg/h t/h
9 Capacity/flow unit of measure (msb)
10 Status of input IN1 disabled enabled
11 Status of input IN2 Belt speed = 0 Belt speed > 0
12 Status of input IN3 disabled enabled
13 Status of input IN4 disabled enabled
14 Status of input IN5 disabled enabled
15 Status of input IN6 disabled enabled
16 Status of input IN7 disabled enabled
17 Status of input IN8 disabled enabled
Table 5

9.1.4 OUTPUT STATUS REGISTER


It is Input Register number 14 of page 0; two bytes defined in the following way:

Bit Description Bit meaning


0
1
(LSB)
0 Relay R1 disabled enabled
1 Relay R2 disabled enabled
2 Relay R3 disabled enabled
3 Relay R4 disabled enabled
4 Relay R5 disabled enabled
5 Relay R6 disabled enabled
6 Relay R7 disabled enabled
7 Relay R8 disabled enabled
(MSB)
8 Relay R9 disabled enabled
9 Relay R10 disabled enabled
10 Relay R11 disabled enabled
11 Relay R12 disabled enabled
12 Relay R13 disabled enabled
13 Relay R14 disabled enabled
14 Relay R15 disabled enabled
15 Relay R16 disabled enabled
Table 6
15
CPWE-BELT_MODBUS_APPENDIX

9.1.5 SETPOINT STATUS REGISTER


It is Input Register number 11 of page 1; two bytes defined in the following way:

Byte 0: Active Set point number


Byte 1: Active Set point function

In which Active Set point number can assume the following values:
00 NO FUNCTIONING (relay disabled).
01 GROSS SET POINT (enabling of the relay on the gross weight).
04 0 GROSS (activation of the relay on the gross weight at 0).
06 INSTABILITY (enabling of the relay upon weight instability)
22 BELT ENABLING (enabling the relay upon the dosage enabling).
23 CYCLE END
24 BELT PAUSE (enabling the relay on the dosage in pause).
25 SIDE-SLIPPING (enabling the relay on the belt side-slipping error)
26 > OVER FLOW (enabling the relay on the flow greater than the TARGET + <<F.R.ERR.>>)
27 < UNDER FLOW (enabling the relay on the flow less than the TARGET - <<F.R.ERR.>>)
28 ALARM (enabling the relay in the error condition)
29 BLOCK (enabling the relay upon the blocked dosage)
30 IMPULSE WEIGHT (enabling the relay, for non programmable 0.1 sec, when the increase of the weight total
reaches the value set in the F.Mode >> BELT >> PULSE.W step)
32 MATERIAL ENABLING (enabling the relay upon the dosage enabling only when the material dosage is
allowed, for example out of the zero flow execution)
33 SLOW FLOW WEIGHT (enabling the relay on the dosed weight greater than the TARGET - <<L.F.R.WEI>>)
34 BELT SPEED (enabling the relay when the speed is higher than 0)

9.2 OUTPUT DATA AREA: HOLDING REGISTERS


The output data area is written by the master (is therefore read by the instrument) and is made up of 16 registers (holding
registers), each of 2 bytes (32 overall bytes).

N° Reg. N° Byte Input Registers


Byte 0 Command Register: Command to be processed (MSB)
0
Byte 1 Command Register: Command to be processed (LSB)
- Format of the Command Status Register value
See 9.2.1 section
Byte 2 Parameter (MSB)
1
Byte 3 Parameter
Byte 4 Parameter
2
Byte 5 Parameter
Byte 6 Parameter
3
Byte 7 Parameter (LSB)
Byte 8 -----------------------------------
4
Byte 9 -----------------------------------
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Byte 30 -----------------------------------
15
Byte 31 -----------------------------------
Table 7

16
CPWE-BELT_MODBUS_APPENDIX

9.2.1 COMMAND REGISTER


It is the Output Register number 0. It is made up of two bytes and can take on the following values, which correspond to
implemented commands described in table 8.

NOTE: the byte with the largest index is the LSB, while the one with the lowest index is the MSB.
Value of the Bytes of the Holding Register used
Implemented command
Command Register by the command (see table 7)
NO COMMAND 0 (0000 Hex) None
------------------------------- 1 (0001 Hex) -----------------------------
START DOSAGE
(only for REGULATOR mode,
TECH.MAN.REF.)
This command, in the flow reader mode, 2 (0002 Hex) None
offers the possibility to clear the dosed
partial total, with instrument in "INACTIVE"
status
PAUSE DOSAGE
(only for REGULATOR mode, 3 (0003 Hex) None
TECH.MAN.REF.)
RESET DOSAGE
(only for REGULATOR mode, 4 (0004 Hex) None
TECH.MAN.REF.)
SET TARGET FLOW
Bytes 2 and 3 must contain the flow
(only for REGULATOR mode, 5 (0005 Hex)
target.
TECH.MAN.REF.)
SET THE TARGET WEIGHT TO BE
DOSED. Byte 2 … 7 must contain the target
6 (0006 Hex)
(only for REGULATOR mode, weight to be dosed
TECH.MAN.REF.)
SET DOSAGE TIME
Byte 2 … 5 must contain the dosage
(only for REGULATOR mode, 7 (0007 Hex)
time.
TECH.MAN.REF.)
Bytes 2 and 3 must contain the number
PRINT FORMAT 8 (0008 Hex)
of format to be dosed
RESET GENERAL TOTAL 9 (0009 Hex) None
Bytes 2 and 3 must contain the relay
SET RELAY OUTPUTS 10 (000A Hex)
status of the instrument
PERMANENT SAVING OF CONFIGURED
11 (000B Hex) None
DATA
SELECTION OF SET POINT Byte 2 and Byte 3 must contain the
(The selected set point is visible in 12 (000CHex) number of set point to be selected
registers 11,12, 13, 14, 15; see table 4) (valid values: from 1 to 11)
Bytes 2 and 3 must contain the number
of set point to be modified
CONFIGURATION OF SET POINT
13 (000D Hex) Byte 4…7 must contain the ON value
of the set point
Byte 8…11 OFF value of the set point
Bytes 2 and 3 must contain the number
PAGE CHANGE COMMAND 14 (000E Hex)
of page to be read (0 or 1)
ZERO FLOW CALIBRATION (see section
8, USER.MAN.REF.). 15 (000F Hex) None

Table 8

17
CPWE-BELT_MODBUS_APPENDIX

Format of the Parameter value:


Whole in absolute value (without decimals)

Example: If 3 decimals have been set, to enter the value 3,000 → one should write 3000
If 2 decimals have been set, to enter the value 3,00 → one should write 300

RELAY setting
The status of the relays is settable through Parameter 1:

Parameter 1:
bit 0 → RELAY 1 in which bit 0 = 1 → RELAY 1 CLOSED; bit 0 = 0 → RELAY 1 OPEN
bit 1 → RELAY 2 in which bit 1 = 1 → RELAY 2 CLOSED ; bit 1 = 0 → RELAY 2 OPEN
bit 2 → RELAY 3
bit 3 → RELAY 4
bit 4 → RELAY 5
bit 5 → RELAY 6
bit 6 → RELAY 7
bit 7 → RELAY 8
bit 8 → RELAY 9
bit 9 → RELAY 10
bit 10 → RELAY 11
bit 11 → RELAY 12
bit 12 → RELAY 13
bit 13 → RELAY 14
bit 14 → RELAY 15
bit 15 → RELAY 16

NOTE: the relay configuration function works only with the relays which do not have assigned functions (therefore
programmed as "None", TECH.MAN.REF.)

18

You might also like