Documente Academic
Documente Profesional
Documente Cultură
I M P I A N T I
VEGA II
ELECTRONIC COUNTER
Type of protocol: HANDSHAKING (for each query from PC MASTER a reply is sent by VEGAII slave).
Electrical connection:
? RS 232
? RS 485
? RS 422
For electrical connection schemes refer to “INSTALLATION MANUAL”.
Communication characteristics:
VEGAII can communicate from 1200 to 19200 baud.
ModBusTM protocol implemented is RTU type where each character is so defined:
BODY OF
START ADDRESS FUNCTION CODE CRC-16 END
MESSAGE
T1-T2-T3-T4 1 BYTE 1 BYTE N BYTES 2 BYTES T1-T2-T3-T4
? Device Address
Serial address of VEGAII can be setted from 01 to 99 decimal (0x01 to 0x63 hexadecimal) and is used by Master to communicate with an electronic counter
SLAVE. Address 00 is reserved.
? Function Code
Function Code specifies which command SLAVE device has to do. In VEGAII are implemented these ModBus function:
? Body of message
Length of this part of message and meaning of its bytes can vary apiece of “Function” that is used.
Start
CRC16 = 0xFFFF
N°SHIFT = 0
YES
Carry == 1?
N°SHIFT = N°SHIFT + 1
NO
N°SHIFT == 8?
NO
Last character of
message ?
YES
Stop
If value of a bit is 1 relative output is ON otherwise is OFF. In the example analyzing message sent by VEGAII value of outputs from 1 to 8 in hexadecimal is 0xAA
and in binary is 10101010, value of outputs from 9 to 16 in hexadecimal is 0x55 and in binary is 01010101; that means that outputs 2, 4, 6, 8, 9, 11, 13, 15 are
ON and others are OFF.
If value of a bit is 1 relative input is CLOSED otherwise is OPENED. In the example analyzing message sent by VEGAII value of inputs from 11 to 18 in
hexadecimal is 0xAA and in binary is 10101010, value of inputs from 19 to 20 in hexadecimal is 0x02 and in binary is 00000010; that means that inputs 12, 14, 16,
18, 20 are CLOSED and others are OPENED.
Value of register required is 0x0000 that means that automation command sent by sub-function has been accepted (se “SUB-FUNCTION ANSWER CODE TABLE”).
If something of received message is wrong VEGAII send a message with specified type of error.
In the next example PC MASTER requires status of 16 outputs starting from output 0x32 (50) that doesn’t exist (VEGAII manages only 32 outputs).
When there is an error on message received VEGAII answers adding 0x80 at the value of field “function code” and then put in the field “Exception code” why
message is not valid. Here you can find exception code:
When you send command of automation by function 16 (WRITE MULTIPLE REGISTER) if message is right but is not compatible with status of VEGAII, electronic
counter answers as message is valid but inserts in the register 40065 (Result of sub-function) why command is not accepted. (see “SUB-FUNCTION REPLY CODE
TABLE”).
START
1 4
2
5
3
FUNCTION 16 FUNCTION 16
FUNCTION 01 FUNCTION 04
SUB-FUNCTION 02 PRESET SUB-FUNCTION 07 "TRANSACTION CLOSING"
"READ COILS STATUS" "READ INPUT REGISTER" 30203
TO UPGRADE SYNOPTIC "STATUS OF BATCH"
FUNCTION 03
FUNCTION 03
"READ HOLDING REGISTERS" 40065
"READ HOLDING REGISTERS" 40065
"RESULT OF SUB-FUNCTION"
FUNCTION 02 "RESULT OF SUB-FUNCTION"
"READ INPUTS STATUS" NO STATUS OF BATCH =3?
TO UPGRADE SYNOPTIC (DATA AVAILABLE TO BE
STORED)
NO REGISTER NO
REGISTER
40065=0? 40065=0?
YES
FUNCTION 04
"READ INPUT REGISTERS" YES
YES
TO UPGRADE SYNOPTIC FUNCTION 04
"READ INPUT REGISTERS" FROM 30750
"DATA OF LAST BATCH" FUNCTION 04
FUNCTION 04 READ INPUT REGISTER 30189
"READ INPUT REGISTER" 30201 "STATUS OF TRANSACTION"
"REQUEST OF START"
NO DO YOU W ANT FUNCTION 16
START A NEW SUB-FUNCTION 11
TRANSACTION? "BATCH DATA STORED"
NO
REQUEST OF NO STATUS OF
START=1?
TRANSACTION=3?
YES FUNCTION 03 (DATA AVAILABLE TO
"READ HOLDING REGISTERS" 40065 BE STORED)
FUNCTION 16 YES "RESULT OF SUB-FUNCTION"
SUB-FUNCTION 01 "START TRANSACTION"
FUNCTION 16 YES
SUB-FUNCTION 04 "START DELIVERY"
NO
FUNCTION 03
"READ HOLDING REGISTERS" 40065 FUNCTION 04
REGISTER "READ INPUT REGISTERS" FROM 31151
"RESULT OF SUB-FUNCTION" FUNCTION 03 40065=0? "DATA OF LAST TRANSACTION"
"READ HOLDING REGISTERS" 40065
"RESULT OF SUB-FUNCTION"
YES
FUNCTION 16
NO YES SUB-FUNCTION 12
REGISTER
1 "TRANSACTION DATA STORED"
40065=0?
NO YES YES NO
REGISTER NEW
2 3 4
40065=0? PRESET?
FUNCTION 03
"READ HOLDING REGISTERS" 40065
"RESULT OF SUB-FUNCTION"
NO YES
REGISTER
40065=0? 5
? Type of register
In the following table are shown type of data used in the registers tables.
ADDRESS REGISTER
(HEX) (DECIMAL)
DATA FORMAT DESCRIPTION VALUES
0 = OFF
0000 00001 BIT Status of output 1
1 = ON
0 = OFF
0001 00002 BIT Status of output 2
1 = ON
0 = OFF
0002 00003 BIT Status of output 3
1 = ON
0 = OFF
0003 00004 BIT Status of output 4
1 = ON
0 = OFF
0004 00005 BIT Status of output 5
1 = ON
0 = OFF
0005 00006 BIT Status of output 6
1 = ON
0 = OFF
0006 00007 BIT Status of output 7
1 = ON
0 = OFF
0007 00008 BIT Status of output 8
1 = ON
0 = OFF
0008 00009 BIT Status of output 9
1 = ON
0 = OFF
0009 00010 BIT Status of output 10
1 = ON
0 = OFF
000A 00011 BIT Status of output 11
1 = ON
0 = OFF
000B 00012 BIT Status of output 12
1 = ON
0 = OFF
000C 00013 BIT Status of output 13
1 = ON
0 = OFF
000D 00014 BIT Status of output 14
1 = ON
0 = OFF
000E 00015 BIT Status of output 15
1 = ON
0 = OFF
000F 00016 BIT Status of output 16
1 = ON
ADDRESS REGISTER
(HEX) (DECIMAL)
DATA FORMAT DESCRIPTION VALUES
0 = OPENED
0000 10001 BIT Status of input 1
1 = CLOSED
0 = OPENED
0001 10002 BIT Status of input 2
1 = CLOSED
0 = OPENED
0002 10003 BIT Status of input 3
1 = CLOSED
0 = OPENED
0003 10004 BIT Status of input 4
1 = CLOSED
0 = OPENED
0004 10005 BIT Status of input 5
1 = CLOSED
0 = OPENED
0005 10006 BIT Status of input 6
1 = CLOSED
0 = OPENED
0006 10007 BIT Status of input 7
1 = CLOSED
0 = OPENED
0007 10008 BIT Status of input 8
1 = CLOSED
0 = OPENED
0008 10009 BIT Status of input 9
1 = CLOSED
0 = OPENED
0009 10010 BIT Status of input 10
1 = CLOSED
0 = OPENED
000A 10011 BIT Status of input 11
1 = CLOSED
0 = OPENED
000B 10012 BIT Status of input 12
1 = CLOSED
0 = OPENED
000C 10013 BIT Status of input 13
1 = CLOSED
0 = OPENED
000D 10014 BIT Status of input 14
1 = CLOSED
0 = OPENED
000E 10015 BIT Status of input 15
1 = CLOSED
0 = OPENED
000F 10016 BIT Status of input 16
1 = CLOSED
ADDRESS REGISTER
(HEX) (DECIMAL)
DATA FORMAT DESCRIPTION VALUES
STRING
0000 30001 Firmware version. Alphanumerical code.
(6 Registers)
STRING
0006 30007 ModBus protocol version. Alphanumerical code.
(4 Registers)
CHAR 0 = Weight and Measure switch not present
000A 30011 Status of Weight and Measure switch.
(1 Register) 1 = Weight and Measure switch present
CHAR 0 = Power supply not present
000B 30012 Status of power supply
(1 Register) 1 = Power supply present
0 = Not present
CHAR 1 = On charge
000C 30013 Status of battery
(1 Register) 2 = Present
3 = Not charge
CHAR 0 = Local
000D 30014 Local / Remote mode.
(1 Register) 1 = Remote
0= Working mode
CHAR
000E 30015 Operative mode 1= Request programming entry
(1 Register)
2= Programming mode
CHAR 0 = No new parameter’s log.
000F 30016 Status of Logs parameters.
(1 Register) 1 = New parameter’s log.
INT
0010 30017 Total transactions of system. 0 ÷ 999999
(2 Registers)
INT
0012 30019 Total batches of system. 0 ÷ 9999999
(2 Registers)
0 = Printer ON LINE
1 = No paper
CHAR
0014 30021 Status of local printing. 2 = Printer OFF LINE
(1 Register)
3 = Printer BUSY
4 = Printing in progress
ADDRESS REGISTER
(HEX) (DECIMAL)
DATA FORMAT DESCRIPTION VALUES
0000 40001 (64 registers) Register reserved for sub-function. Values are different for each sub-function.
Result of an execution of a sub-function. Values are written in “SUB-FUNCTION REPLY CODE
CHAR
0040 40065 Value of this register normally is 0xFF. It changes when a sub-function is executed. Code of result TABLE”.
(1 register)
will be present until first reading of register. ************* READ ONLY ************
Used for : enabling a meter for a new transaction specifying characteristics loading.
Reset displayed quantities.
Used for : confirm that data of last batch are stored by PC MASTER.
Reset register 30203 “Status of batch”.
Used for : confirm that data of last transaction are stored by PC MASTER.
Reset register 30189 “Status of transaction”.
Used for : confirm that data of last leak are stored by PC MASTER.
Reset register 30342 “Request to store data of a leak”.