You are on page 1of 14

Serial protocol for MDW

Service Book

KM002100G

1.

MODBUS PROTOCOL FOR PIOVAN EQUIPMENT (MDW)

1.1.

Electronic interface

The electronic interface installed on the Piovan Micro Processor controller is RS485. The serial communication line can link
up to 31 slaves. The wiring between the serial communication line and the Piovan Micro Processor controller is done
through screw terminals.

1.2.

Network configuration

MOD-BUS protocol is suitable for a 1-master / 255-slave network. The number of possible slaves can be limited by the electronic interface used.
The Piovan Micro Processor controller works as a slave.

1.3.

Transmission format

This protocol uses a binary method, composed as follows:


1 start bit, 8 data bits, 1 parity bit (optional), 1 stop bit.
The communication speed can be selected from among 1200, 2400, 4800, 9600 and 19200 baud.

1.4.

Communication procedure

The communication can be started only from the master unit. The slave unit can transmit only after a query from the master.
The general format of the master / slave transmission is the following:
Range
Slave address

Byte
1

Function code

Data

Error check (crcl6)

The slave recognizes the transmission of a query frame when the time between two characters is greater than 3 T.U.
(T.U. = time unit = necessary time to transmit one character).

1.5.

Function code 1 and 2: reading of "n" bit

These function codes are used by the master unit to request the value of a certain number of bits, that represent the status
of the slave unit.
Range

Byte

Slave address (1-255)

Function code (01-02)

Bit starting address (high byte)

Bit starting address (low byte)

Number of bits (high byte)

Number of bits (low byte)

Error check (crc16)

The slave answers the following:


Range
Slave address (1-255)

Byte
1

Function code (01-02)

Byte count

Data

Error check (crcl6)

1- G

ENGLISH

The "data" field indicates the bit requested: the bit with lower address is the bit 0 of the first byte, the next is the bit 1 and
so on.
The possible bit necessary to complete the last byte must be put at 0.

1.6.

Function code 3 and 4: reading of n word

These function codes are used by the master unit to read a group of words (16 bit) which contains the value of the variable
of the slave unit.
Range
Slave address (1-255)

Byte
1

Function code (03-04)

Word starting address (high byte)

Word starting address (low byte)

Number of word (high byte)

Number of word (low byte)

Error check (crc16)

The slave answers the following:


Range
Slave address (1-255)

Byte
1

Function code (03-04)

Byte count

Data

Error check (crc16)

The "data" field indicates the requested words in the following format: high byte of the first word, low byte of the first word,
high byte of the second word, and so on.
For addresses not implemented, the "data" field will show 8000h.

1.7.

Function code 5: bit writing

By using this command, the master unit can change the status of one bit of the slave unit.
Range

Byte
1

Slave address (1-255)


Function code (05)

Bit address (high byte)

Bit address (low byte)

Data

Error check (crc16)

The slave answers the following:


Range

Byte
1

Slave address (1-255)


Function code (05)

Bit address (high byte)

Bit address (10w byte)

Data

Error check (crci6)

"Data" field

ENGLISH

=0
to reset the bit
= FF00h to set the bit

2- G

1.8.

Function code 6: word writing

By using this command, the master unit can change the status of one word of the slave unit.
Range
Slave address (1-255)

Byte
1

Function code (06)

Word address (high byte)

Word address (low byte)

Data

Error check (crc16)

The slave answers the following:


Range
Slave address (1-255)

Byte
1

Function code (06)

Word address (high byte)

Word address (low byte)

Data

Error check (crc16)

1.9.

Function code 15: writing of "n" bit

By using this command, the master unit can change the status of one or more bits of the slave unit.
Range
Slave address (1-255)

Byte
1

Function code (i5)

Bit starting address (high byte)

Bit starting address (low byte)

Number of bits (high byte)

Number of bits (low byte)

Number of data bytes

Data

Error check (crc16)

The slave answers the following:


Range
Slave address (1-255)

Byte
1

Function code (15)

Bit starting address (high byte)

Bit starting address (low byte)

Number of bits (high byte)

Number of bits (low byte)

Error check (crc16)

3- G

ENGLISH

1.10. Function code 16: writing of n word


By using this command, the master unit can change the state of one or more words of the slave unit.
Range

Byte
1

Slave address (1-255)


Function code (16)

Word starting address (high byte)

Word starting address (low byte)

Number of words (high byte)

Number of words (low byte)

Number of data bytes

Data

Error check (crc16)

The slave answers the following:


Range

Byte
1

Slave address (1-255)


Function code (16)

Word starting address (high byte)

Word starting address (low byte)

Number of words (high byte)

Number of words (low byte)

Error check (crc16)

NOTES:

"Broadcast" address
When using writing codes 5 and 6, the address 0 of the slave units is allowed. In this case all the slaves
connected accept the command but do not give any answer.
Words format
Every time the information transfer is made by using 2 byte (1 word of 16 bit), the first byte transmitted is
the most significant. For the negative numbers is used the "two complement" format.
Error reply
The slave unit can find out errors in the master query.
If the "error check" is incorrect or the function code is not implemented, the slave does not send any answer to the master.
If other errors are detected on query frame, the slave replies forcing at "1" the bit 7 of the byte "Function
code" and gives an error code.

Error reply
Range

Byte
1

Slave address
Function code (+80h)

Error code

Error check (crc16)

List of error code


Meaning

Error #.

illegal data address

illegal data value

illegal number of data

the bit or word indicated cannot be modified

10

ENGLISH

4- G

Answer time
The slave replies from 2 ms to 700 ms after the end of a query. (That is detected counting the received
bytes).
Decimal digits/ negative numbers
In case of transmission of decimal digits and/or negative numbers, please see example.
Example:
Number to transmit 205.6 -----------> 2056 is transmitted
Number to transmit -12.50 ----------> -1250 is transmitted

WORDS
Address

Description

Type

Digits

M.U.

27

COMMENT OF RECIPE IN PROGRESS

R/W

10

working SET of STATION 2

11

R/W

xx,x

working SET of STATION 3

R/W

xx,x

12

working SET of STATION 4

R/W

xx,x

13

working SET of STATION 5

R/W

xx,x

14

working SET of STATION 6

R/W

xx,x

15

Alarm mode and calculation type of STATION 1

R/W

16

Alarm mode and calculation type of STATION 2

R/W

17

Alarm mode and calculation type of STATION 3

R/W

18

Alarm mode and calculation type of STATION 4

R/W

19

Alarm mode and calculation type of STATION 5

R/W

20

Alarm mode and calculation type of STATION 6

R/W

21

number of process recipe turbo-cycles

R/W

22

rotation time of process recipe mixer

R/W

xxx

23

weight of process batch

R/W

xx.x

kg
hg

24,25

Notes

weight of process mixture

R/W

xxxxx

26

% added to station 2 for slr1

R/W

xx.x

27

% added to station 2 for slr2

R/W

xx.x

28

maximum instantaneous total production

xxxx

29

mdw controls

30

mdw controls

50

mdw state

10

51

1..16 alarms

11

52

17..32 alarms

12

53

33..48 alarms

13

54

state of digital inputs

15

55

state of digital outputs

16

56

kg/h

or alarms

63,64

Weight of material dosed on station 1

xxxxx,x

65,66

Weight of material dosed on station 2

xxxxx,x

67,68

Weight of material dosed on station 3

xxxxx,x

69,70

Weight of material dosed on station 4

xxxxx,x

71,72

Weight of material dosed on station 5

xxxxx,x

73,74

Weight of material dosed on station 6

xxxxx,x

100

remote flag

R/W

5- G

17

ENGLISH

Address

Description

Type

Digits

M.U.

Notes

400,401

station 1 totalizator

xxxxx,xxx

kg

36

402,403

station 2 totalizator

xxxxx,xxx

kg

36

404,405

station 3 totalizator

xxxxx,xxx

kg

36

406,407

station 4 totalizator

xxxxx,xxx

kg

36

408,409

station 5 totalizator

xxxxx,xxx

kg

36

410,411

station 6 totalizator

xxxxx,xxx

kg

36

412,413

balance weight value

xxxxx,x

414

% of material dosed on station 1

xx,x

415

% of material dosed on station 2

xx,x

416

% of material dosed on station 3

xx,x

417

% of material dosed on station 4

xx,x

418

% of material dosed on station 5

xx,x

419

% of material dosed on station 6

xx,x

456,457

Weight of material to dose on station 1

xxxxx,x

458,459

Weight of material to dose on station 2

xxxxx,x

460,461

Weight of material to dose on station 3

xxxxx,x

462,463

Weight of material to dose on station 4

xxxxx,x

464,465

Weight of material to dose on station 5

xxxxx,x

g
g

466,467

Weight of material to dose on station 6

xxxxx,x

468,469

number of produced batches

xxxxxxxx

NOTES
Note 1

Variable

Description

1.

[ON]

read-only alarm

2.

[ON]+[STOP]

Note 2

Variable

alarm and doser stop

Description

From v 6.06.03: IF THE EXCHANGING FLAG OF STATIONS 2, 3 IS ON (note 30) SEE NOTE 3
1.

[ON][TOT]

2.

[ON]+[STOP]
[TOT]

3.

[ON]+[2->1][TOT]

4.

NOT APPLICABLE

5.

[ON][1]

6.

[ON]+[STOP][1]

7.

[ON]+[2->1][1]

ENGLISH

read-only alarm and percentage referring to batch


alarm and doser stop and percentage referring to batch
alarm, dosage trans. to station 1 and percentage referring to batch

read-only alarm and percentage referring to station 1


alarm and doser stop and percentage referring to station 1
alarm, dosage trans. to station 1 and percentage referring to station 1

6- G

Note 3

Variable

Description

From v 6.06.03: IF THE EXCHANGING FLAG OF STATIONS 2, 3 IS ON (note 30) SEE NOTE 2
1.

[ON][TOT]

read-only alarm and percentage referring to batch

2.

[ON]+[STOP]
[TOT]

3.

[ON]+[3->1][TOT]

4.

[ON]+
[BATCH->1]
[TOT]

5.

[ON][1]

6.

[ON]+[STOP][1]

alarm and doser stop and percentage referring to station 1

[ON]+
[BATCH->1][1]

Up to v 6.06.02: alarm, whole batch trans. to station 1 and percentage referring


to batch 1

[ON]+[3->1][1]

From v 6.06.03 on: alarm, dosage trans. to station 1 and percentage referring to
station 1

[ON]+[3->1][1]

Up to v 6.06.02: alarm, dosage trans. to station 1 and percentage referring to


station 1

[ON]+
[BATCH->1][1]

From v 6.06.03 on: alarm, whole batch trans. to station 1 and percentage referring to station 1

alarm and doser stop and percentage referring to batch


alarm, dosage trans. to station 1 and percentage referring to batch
alarm, whole batch trans. to station 1 and percentage referring to batch
read-only alarm and percentage referring to station 1

7.

8.

Up to v 6.06.00: NOT APPLICABLE


9.
[ON][1+3]

From v 6.06.01 on: read-only alarm and percentage referring to the addition
[1+3]

Up to v 6.06.00: NOT APPLICABLE


10.

[ON]+
[STOP][1+3]

From v 6.06.01 on: alarm and doser stop and percentage referring to the addition [1+3]

Up to v 6.06.00: NOT APPLICABLE


11.
[ON]+[3->1][1+3]

From v 6.06.01 on: alarm, dosage trans. to station 1 and percentage referring to
addition [1+3]

Up to v 6.06.00: NOT APPLICABLE


12.

[ON]+
[BATCH->1][1+3]

From v 6.06.01 on: alarm, trans. of whole batch to station 1 and percentage
referring to addition [1+3]

7- G

ENGLISH

Note 4

Variable

1.

[ON][TOT]

2.

[ON]+[STOP][TOT
]

3.

[ON]+
[BATCH->1]
[TOT]

4.

Description
read-only alarm and percentage referring to batch
alarm and doser stop and percentage referring to batch

alarm, whole batch transfer to station 1 and percentage referring to the batch

NOT APPLICABLE

5.

[ON][1]

6.

[ON]+[STOP][1]

alarm and doser stop and percentage referring to the station 1

7.

[ON]+
[BATCH->1][1]

alarm, whole batch trans. to station 1 and percentage referring to the station 1

8.

read-only alarm and percentage referring to the station 1

NOT APPLICABLE

9.

[ON][1+3]

10.

[ON]+
[STOP][1+3]

read-only alarm and percentage referring to the stations 1+3


alarm and doser stop and percentage referring to the stations 1+3

Up to v 6.06.02: NOT APPLICABLE


11.

12.

[ON]+
[BATCH->1][1+3]

From v 6.06.03 on: alarm, whole batch transfer to station 1 and percentage
referring to stations 1 + 3

[ON]+[BATCH>1]
[1+3]

Up to v 6.06.02: alarm, whole batch transfer to station 1 and percentage referring


to stations 1 + 3

From v 6.06.03 on: NOT APPLICABLE

Note 7

Description

0.

local

1.

remote

Note 8 (bit)

Description

0.

changed material start

1.

alarms acknowledge

2.

totalizators reset

3.

alarms reset

4.

unchanged material start

ENGLISH

8- G

Note 9 (bit)
0.

Note 10 (bit)

Description
stop

Description

0.

stop state

1.

running state

2.

pause state

3.

local check state

4.

calibration state

Note 11 (bit)

Alarm

Description

0.

material minimum level on station 1

1.

material minimum level on station 2

2.

material minimum level on station 3

3.

material minimum level on station 4

4.

material minimum level on station 5

5.

material minimum level on station 6

6.

material flow failure on station 1

7.

material flow failure on station 2

8.

material flow failure on station 3

9.

10

material flow failure on station 4

10.

11

material flow failure on station 5

11.

12

material flow failure on station 6

12.

13

deviation of station 1 dosage

13.

14

deviation of station 2 dosage

14.

15

deviation of station 3 dosage

15.

16

deviation of station 4 dosage

9- G

ENGLISH

Note 12 (bit)

Alarm

Description

0.

17

deviation of station 5 dosage

1.

18

deviation of station 6 dosage

2.

19

weighing system reading error

3.

20

wrong functioning of lower slide gate

4.

21

printer not ready

5.

22

end of production (production preset)

6.

23

volumetric functioning of the doser

7.

24

safety devices intervention

8.

25

too low working set for station 1

9.

26

too low working set for station 2

10.

27

too low working set for station 3

11.

28

too low working set for station 4

12.

29

too low working set for station 5

13.

30

too low working set for station 6

14.

31

component not dosed by station 1

15.

32

component not dosed by station 2

Note 13 (bit)

Alarm

Description

0.

33

component not dosed by station 3

1.

34

component not dosed by station 4

2.

35

component not dosed by station 5

3.

36

component not dosed by station 6

4.

37

wrong functioning of weigh pan

5.

38

dosage without station 2

6.

39

dosage with station 1 only

7.

40

mixer motor breakdown

8.

41

lacking batch (start again)

9.

42

overweight on weighing cell

10.

43

scanty doser steadiness

11.

44

dosage without station 3

12.

45

prealarm for maintenance of station 1

13.

46

prealarm for maintenance of station 2

14.

47

prealarm for maintenance of station 3

15.

48

prealarm for maintenance of station 4

ENGLISH

10 - G

Note 15 (bit)

Description

0.

hopper material level on station 1

1.

hopper material level on station 2

2.

hopper material level on station 3

3.

hopper material level on station 4

4.

hopper material level on station 5

5.

hopper material level on station 6

6.

mixer material level

7.

material level below lower slide gate

8.

safety devices

9.

lower level on regrind accumulation tank

10.

higher level on regrind accumulation tank

11.
12.
13.
14.
15.

Note 16 (bit)

Description

0.

dosage control of station 1

1.

dosage control of station 2

2.

dosage control of station 3

3.

dosage control of station 4

4.

dosage control of station 5

5.

dosage control of station 6

6.

mixer control

7.

weighing slide gate control

8.

lower slide gate control

9.

siren control

10.

alarm exit control

11.
12.
13.
14.
15.

11 - G

ENGLISH

Note 17 (bit)

Description

0.

any alarm

1.

one alarm is present

Note 36 (bit)
-

Description
To zero the totalizators, use the MODBUS 29 address.

ENGLISH

12 - G

You might also like