KG000401G Tp-Tw-To Serial Protocol
KG000401G Tp-Tw-To Serial Protocol
KG000401G Tp-Tw-To Serial Protocol
With the exception of information required by law, the general information (or
diagrams) featured in this document may depict models and/or versions different
to the one you have purchased.
This will in no way alter the validity or applicability of the information provided.
1. HARDWARE
The transmission is made in RS-485 or 20mA Passive current loop (2 wires connection).
In the case of current loop transmission, the Host has to be active in TX loop and RX loop, while the Device is passive in
both.
The hardware of the Host has to satisfy the following requirements:
- source of current: 17 V / 20 mA (+/- 10%);
- maximum voltage drop: < 2 V.
The serial line could be connected directly to one of the connectors located in the front of the machine.
The connector is a 9 pin male SUB-D: this is the pin assignment:
RS-485
A / A’ 1 1
B / B’ 2 2
C / C’ (shield) 3 3
TX / RX + 9 8
TX / RX - 8 9
1- G ENGLISH
2. SERIAL INTERFACE CIRCUIT BOARD
1. Press button 10, in normal viewing mode with 5 indicator light on, until it
goes out or starts blinking. The machine stops automatically.
2. Turn the main circuit breaker on the thermoregulator to 0 (0FF) and discon-
nect power.
3. Open the front panel on the machine.
4. Unscrew the screws on the side panels and remove them.
5 10
5. Unscrew the screws on the cover located on the rear panel and slide it to-
ward the back of the machine far enough to release it from its fastening.
6. Unscrew the screws on the back of the front panel and remove it.
7. Position the dip-switch microswitches of the Fig. 1 on serial interface circuit board A3, as indicated in the table below,
depending on the transmission speed of the serial line.
1 2 3 4 5 6
19200 bps OFF OFF OFF OFF ON ON
9600 bps OFF OFF ON OFF ON ON
4800 bps OFF ON OFF OFF ON ON
2400 bps OFF ON ON OFF ON ON
1200 bps ON OFF OFF OFF ON ON
600 bps ON OFF ON OFF ON ON
300 bps ON ON OFF OFF ON ON
150 bps ON ON ON OFF ON ON
Fig. 1
8. Unplug the connectors indicated in Fig. 2 in order to house serial interface circuit board A3.
Fig. 2
ENGLISH 2- G
9. Insert serial interface circuit board AS in the front panel on the machine as shown in Fig. 3 and fasten it in place with its
screws.
Fig. 3
10. Plug the connector on serial interface circuit board A3 into the microprocessor circuit board as shown in Fig. 4.
11. Plug the connectors indicated in Fig. 2 back in the same position.
Fig. 4
3- G ENGLISH
3. THE ARBENG PIOVAN PROTOCOL
3.1. Introduction
Data transmission between Master and Slave is basically ordered by the control system of the I.M.M. or the Computer
(hereinafter also called "the Host"); therefore the device ("Slave") sends data only if requested by the Host.
Several Slaves can be connected on the same transmission line. The devices are to be addressed individually with a unique
Address Number. Setting of the device address is made manually with the device keyboard.
1. The Master-Slave principle is used; only the Slave confirms the received message, either with the corresponding an-
swer, which contains the same data set identification as the sending request (= reception Ok), or with the message
"NAK" (= faulty reception).
2. Each message (also confirmations) contains 3 bytes which, coded in ASCII, contain the binary number of the bytes of
the whole message (including check sum bytes, see item 3.).
At reception a check is made to verify whether the correct number of bytes has arrived.
3. Each message is terminated by 2 check-sum bytes, which are counted in the block length bytes (see item 2.).
The check-sum bytes are the 8 bit-wide binary sum coded in pseudo-ASCII of all bytes of the message, including block
length bytes but excluding check-sum bytes.
Parity can be selected by the user; transmissions can be with or without parity; in the first case a parity bit can be used to
check whether the preceding 8 bits are received without errors.
Parity can be selected by the user; he can choose to work with no parity, even parity or odd parity.
The baud rate can also be selected; values are: 1200, 2400, 4800, 9600 and 19200 Bauds.
The LSB (Least Significant Bit) is sent first; all characters are in Hexadecimal format (hex).
Default values are: 8 data bits, 1 start bit, 1 stop bit, even parity, 9600 Baud.
The highest data bit (bit 7) is set to "1" (= 80 hex) for the address code and to "0" for all the following data of the message.
This only applies to transmissions of the Master.
ENGLISH 4- G
The transmission frame looks like the following:
1st byte:
2nd-4th byte:
5th byte:
6th-nth byte:
(n+1)st-(n+2)nd byte:
Check-sum bytes.
In the following only the information bytes (bytes 6, …, n of message) are indicated.
Identification: 41 hex
Length: 14 bytes
Set value, three digits before decimal point. Each byte is coded is ASCII (30 hex - 39 hex). Negative values (minus sign ' -
', 2D hex) are permitted by the protocol but are not considered by the device.
Always 60 hex.
5- G ENGLISH
1 byte (byte 11):
The commands: 61 hex ("a"), 6B hex ("k"), 73 hex ("s") has the same meaning as 70 hex ("p") and acts to Start Forced
Cooling.
Always 20 hex.
Identification: 41 hex
Length: 19 bytes
Bit 0 : Always 0
Bit 1 : Always 1
Bit 2 : Set value check: 0 = Ok, 1 = value not accepted
Bit 3 : Always 0
Bit 4 : Collective alarm : 0 = no alarm(s), 1 = alarm(s) active(s)
Bit 5 : Always 1
Bit 5 : Always 1
Bit 7 : Always 0
ENGLISH 6- G
DRYER (1/2 beds, H/G heating device):
Device Status:
c) Not acknowledged
Identification: 7F hex
Length: 7 bytes
7- G ENGLISH
When a Slave receives a faulty message addressed to it, it answers with this message (the Master never sends this NAK
message).
3.6. Note
The minus sign ("-", 2D hex), if present, is transmitted in the first byte.
Only numerical values (30 hex, ..., 39 hex) and the minus sign are admitted.
Actual value only: in the case of over-range/under-range the maximum/minimum value (9999/-999), respectively, is trans-
mitted.
The percentage of acting power is transmitted as an integer in the range -100 % /100 % and is to be considered as "Heating
power / Cooling power".
The Dew Point value (Celsius or Fahrenheit) is transmitted in the four digit format without the decimal point (".", 2E hex).
The minus sign ("-", 2D hex), if present, is transmitted in the first byte.
Only numerical values (30 hex, ..., 39 hex) and the minus sign are admitted.
c) Time behavior
The Slave has to be able to receive messages at any time; it starts to reply in 700 µs ... 500 ms; however it disables receiv-
ing during check-sum control and preparation of reply.
Obviously, because of half-duplex protocol, it disables receiving during transmission of reply to Master.
d) Error behavior
Each wrong character (parity error or overflow error) stops and resets each reception.
If the Slave receives any character with bit 7 = 1, it stops and resets reception; this character will be interpreted as a new
address.
ENGLISH 8- G
3.7. Examples
9- G ENGLISH
4. MODBUS PROTOCOL FOR PIOVAN EQUIPMENT (TP / TW / TO)
4.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.
Range Byte
Slave address 1
Function code 1
Data n
Error check (crcl6) 2
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).
Range Byte
Slave address (1-255) 1
Function code (01-02) 1
Bit starting address (high byte) 1
Bit starting address (low byte) 1
Number of bits (high byte) 1
Number of bits (low byte) 1
Error check (crc16) 2
Range Byte
Slave address (1-255) 1
Function code (01-02) 1
Byte count 1
Data n
Error check (crcl6) 2
ENGLISH 10 - G
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.
Range Byte
Slave address (1-255) 1
Function code (03-04) 1
Word starting address (high byte) 1
Word starting address (low byte) 1
Number of word (high byte) 1
Number of word (low byte) 1
Error check (crc16) 2
Range Byte
Slave address (1-255) 1
Function code (03-04) 1
Byte count 1
Data n
Error check (crc16) 2
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.
Range Byte
Slave address (1-255) 1
Function code (05) 1
Bit address (high byte) 1
Bit address (low byte) 1
Data 2
Error check (crc16) 2
Range Byte
Slave address (1-255) 1
Function code (05) 1
Bit address (high byte) 1
Bit address (10w byte) 1
Data 2
Error check (crci6) 2
11 - G ENGLISH
4.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 Byte
Slave address (1-255) 1
Function code (06) 1
Word address (high byte) 1
Word address (low byte) 1
Data 2
Error check (crc16) 2
Range Byte
Slave address (1-255) 1
Function code (06) 1
Word address (high byte) 1
Word address (low byte) 1
Data 2
Error check (crc16) 2
Range Byte
Slave address (1-255) 1
Function code (i5) 1
Bit starting address (high byte) 1
Bit starting address (low byte) 1
Number of bits (high byte) 1
Number of bits (low byte) 1
Number of data bytes 1
Data n
Error check (crc16) 2
Range Byte
Slave address (1-255) 1
Function code (15) 1
Bit starting address (high byte) 1
Bit starting address (low byte) 1
Number of bits (high byte) 1
Number of bits (low byte) 1
Error check (crc16) 2
ENGLISH 12 - G
4.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
Slave address (1-255) 1
Function code (16) 1
Word starting address (high byte) 1
Word starting address (low byte) 1
Number of words (high byte) 1
Number of words (low byte) 1
Number of data bytes 1
Data n
Error check (crc16) 2
Range Byte
Slave address (1-255) 1
Function code (16) 1
Word starting address (high byte) 1
Word starting address (low byte) 1
Number of words (high byte) 1
Number of words (low byte) 1
Error check (crc16) 2
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 an-
swer 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
Slave address 1
Function code (+80h) 1
Error code 1
Error check (crc16) 2
13 - G ENGLISH
• 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 Read / Write
130 Power for heating R
131 Power for cooling R
136 Type of set point R/W
138 Principal set point R/W
142 Maximum set point R/W
144 Ramp applied to a set point change R/W
1010 Temperature for automatic cooling stop R/W
1014 Maximum real temperature over set point R/W
1015 Maximum real temperature under set point R/W
1020 Principal process temperature R
BITS
Address Description Read / Write
218 Local (0) / Remote (1) Control R/W
222 Reset alarm W
1001 Over temperature alarm R
1002 Under temperature alarm R
1003 Pump in alarm R
1004 Over temperature in process heater R
1005 Loading water too long R
1006 Time between two loading too short R
1018 Process temperature probe alarm R
1029 Nr. of all alarms R
1030 Pump on (normal mode) R
1031 Pump on (reverse mode) R
1032 Process heater on R
1033 Pressurization valve R
1034 Cooling valve R
1035 Loading valve R
1036 Alarm R
1061 Start R/W
1062 Automatic cooling stop R/W
ENGLISH 14 - G