发表于:2004/7/13 16:54:00
#0楼
CAREL-COMMUNICATION PROTOCOL among CAREL’s peripheral units and Supervisory computer
We would like to point out that using the present Communication Protocol implies the written acceptance of any conditions started on Mod.1. previously completed and signed. This Communication Protocol allows you to connect to the RS422 serial line any Carel’s electronic controller and exchange date with a supervisory computer.
Carel’s network has a multi-point MASTER/SLAVE structure: the Master is represented by the supervisory computer or Carel’s Gateway, the Slaves are represented by all Carel’s peripheral units. Each RS422 serial line can receive up to 16 peripheral units(no.15 IR32/Asm% controllers)
The hardware support on based on standard RS422 with the following.
The figure below shows the architecture of the networks:
COMMUNICATION PROTOCOL SPECIFICATIONS
For the symbols and messages , please refer to the keys indicated below, The peripherals act as Slave units towards the Master(either the supervisory computer or the Gateway)with the following protocol.
***The peripheral unit is asked to transmit any variable whose value has changed since the last polling.
The Master asks the information to the Slave addressing it with <ind_per>
The answer of the Slave will depend on the changes concerning the required variables since the last polling, with the following results:
MASTER’s message to the Slave:
<ENQ><ind_per>
SLAVE’s answer to the Master:
If at least one variable has changed since the last polling, the Slave’s answer will be as follow:
<STX><TYPE><ind_var><val><ETX><c1><c2>
If no changes as all have occurred to the variables since the last polling , the Slave’s answer will be:
<NULL>
Checking transmission correctness from MASTER to SLAVE:
It is the Master that checks the correctness of the message (syntax and checksum). If the message has been correctly transmitted the Master will answer:
<ACK>
If the message has been incorrectly transmitted, no answer will be given.
In this case the peripheral unit will not exchange any information until the Master’s next polling.
****Setting the parameter’s value of any peripheral unit whose address is identified by <ind_per>):
Protocol procedure allowing you to change the value of any peripheral’s parameter (Carel’s controller) directly via supervisory computer.
MASTER’s message to the Slave:
<STX><ind_per><type><ind_var><val><ETX><c1><c2>
SLAVE’s message to Master:
Affirmative answer (correct message transmission):
<ACK>
negative answer(incorrect message transmission):
<NAK>
In the latter case the Master will prompt the necessary action (it will send the message again)
***Forcing database reading of any peripheral unit whose address identified by<ind_per>
Sending the F command (ASCII character)to any peripheral unit force the transmission of all the peripheral’s data(this message is usually the first one sent by the Master to the peripheral after the two units have been connected).
MASTER’s message to the Slave:
<STX><ind_per><F><ETX><c1><c2>
F-46h.
SLAVE’s answer (message recognition) to the Master:
Affirmative answer (correct message transmission):
<ACK>
negative answer(incorrect message transmission):
<NAK>
From now on, every time the Master sends an <ENQ> message, the variables of the addressed peripheral will be sent to the Master one by one. Transmission will end as soon as the Slave’s answer is <NULL>.
***Keys
<c1><c2> is the sum of all the previous characters, codified as two consecutive ASCII-type characters obtained by adding 30H to the two checksum nibbles.
If, for example, checksum=6AH, the result will be: <c1>=36H and <c2>=3AH.
<ind_per> with 31h<=< ind_per_<=40h(1-16) identifies Cares’s peripheral unit that send data back to the Master after having been required.
<type> identifies the type of variable(‘A’ analogue, ‘T’ integer, ‘D’ digital) through the relative ASCII character ‘A’, ‘T’ and ‘D’.
<ind_var> identifies the variable inside the database of Carel’s peripheral unit. It is transmitted as a single character by adding 30H(h=hexadecimal) to the integer value of the address.
(Ex: address=10 then ind_var=30h+0Ah=3ah).
<val> is the ASCII hexadecimal code of the variable value. The characters that will be transmitted are 1-9 and A-F, Analogue variables are multiplied by 10d and transmitted as a 2-byte integer.
(Ex: 100 corresponds to 0064,that is 30h(ASCII=0),3Ch(ASCII=0), 26H(ASCII=6), 34H(ASCII=4).Negative numbers complement to 2. Example:
INTEGER 100 0064 30h, 30h, 36h, 34h
431 01AF 30h, 31h, 41h, 46h
ANALOG 10.0 0064 30h, 30h, 36h, 34h
43.1 01AF 30h, 31h, 41h, 46h
Integer(‘T’) and Analogue(‘A’) variables are transmitted through 4 consecutive bytes in ASCII text. Analogue variables are transmitted with the same code used for integer(see <val> above) but are previously multiplied by 10.Digital variables are transmitted one by one in just one byte (30H if the value is false(0),31H if it is right(1)).
***Control characters
<NULL) 0
<ENQ> 1
<STX> 2
<ETX> 3
<ACK> 6
<NAK> 7
Transmission parameters between Master (computer or external protocol translation unit) and Slave (Carel controllers):
Baud rate 1200 Word: 8 bit Stop bit: 2 Parity: None
***Timing
We would like to point out that using the present Communication Protocol implies the written acceptance of any conditions started on Mod.1. previously completed and signed. This Communication Protocol allows you to connect to the RS422 serial line any Carel’s electronic controller and exchange date with a supervisory computer.
Carel’s network has a multi-point MASTER/SLAVE structure: the Master is represented by the supervisory computer or Carel’s Gateway, the Slaves are represented by all Carel’s peripheral units. Each RS422 serial line can receive up to 16 peripheral units(no.15 IR32/Asm% controllers)
The hardware support on based on standard RS422 with the following.
The figure below shows the architecture of the networks:
COMMUNICATION PROTOCOL SPECIFICATIONS
For the symbols and messages , please refer to the keys indicated below, The peripherals act as Slave units towards the Master(either the supervisory computer or the Gateway)with the following protocol.
***The peripheral unit is asked to transmit any variable whose value has changed since the last polling.
The Master asks the information to the Slave addressing it with <ind_per>
The answer of the Slave will depend on the changes concerning the required variables since the last polling, with the following results:
MASTER’s message to the Slave:
<ENQ><ind_per>
SLAVE’s answer to the Master:
If at least one variable has changed since the last polling, the Slave’s answer will be as follow:
<STX><TYPE><ind_var><val><ETX><c1><c2>
If no changes as all have occurred to the variables since the last polling , the Slave’s answer will be:
<NULL>
Checking transmission correctness from MASTER to SLAVE:
It is the Master that checks the correctness of the message (syntax and checksum). If the message has been correctly transmitted the Master will answer:
<ACK>
If the message has been incorrectly transmitted, no answer will be given.
In this case the peripheral unit will not exchange any information until the Master’s next polling.
****Setting the parameter’s value of any peripheral unit whose address is identified by <ind_per>):
Protocol procedure allowing you to change the value of any peripheral’s parameter (Carel’s controller) directly via supervisory computer.
MASTER’s message to the Slave:
<STX><ind_per><type><ind_var><val><ETX><c1><c2>
SLAVE’s message to Master:
Affirmative answer (correct message transmission):
<ACK>
negative answer(incorrect message transmission):
<NAK>
In the latter case the Master will prompt the necessary action (it will send the message again)
***Forcing database reading of any peripheral unit whose address identified by<ind_per>
Sending the F command (ASCII character)to any peripheral unit force the transmission of all the peripheral’s data(this message is usually the first one sent by the Master to the peripheral after the two units have been connected).
MASTER’s message to the Slave:
<STX><ind_per><F><ETX><c1><c2>
F-46h.
SLAVE’s answer (message recognition) to the Master:
Affirmative answer (correct message transmission):
<ACK>
negative answer(incorrect message transmission):
<NAK>
From now on, every time the Master sends an <ENQ> message, the variables of the addressed peripheral will be sent to the Master one by one. Transmission will end as soon as the Slave’s answer is <NULL>.
***Keys
<c1><c2> is the sum of all the previous characters, codified as two consecutive ASCII-type characters obtained by adding 30H to the two checksum nibbles.
If, for example, checksum=6AH, the result will be: <c1>=36H and <c2>=3AH.
<ind_per> with 31h<=< ind_per_<=40h(1-16) identifies Cares’s peripheral unit that send data back to the Master after having been required.
<type> identifies the type of variable(‘A’ analogue, ‘T’ integer, ‘D’ digital) through the relative ASCII character ‘A’, ‘T’ and ‘D’.
<ind_var> identifies the variable inside the database of Carel’s peripheral unit. It is transmitted as a single character by adding 30H(h=hexadecimal) to the integer value of the address.
(Ex: address=10 then ind_var=30h+0Ah=3ah).
<val> is the ASCII hexadecimal code of the variable value. The characters that will be transmitted are 1-9 and A-F, Analogue variables are multiplied by 10d and transmitted as a 2-byte integer.
(Ex: 100 corresponds to 0064,that is 30h(ASCII=0),3Ch(ASCII=0), 26H(ASCII=6), 34H(ASCII=4).Negative numbers complement to 2. Example:
INTEGER 100 0064 30h, 30h, 36h, 34h
431 01AF 30h, 31h, 41h, 46h
ANALOG 10.0 0064 30h, 30h, 36h, 34h
43.1 01AF 30h, 31h, 41h, 46h
Integer(‘T’) and Analogue(‘A’) variables are transmitted through 4 consecutive bytes in ASCII text. Analogue variables are transmitted with the same code used for integer(see <val> above) but are previously multiplied by 10.Digital variables are transmitted one by one in just one byte (30H if the value is false(0),31H if it is right(1)).
***Control characters
<NULL) 0
<ENQ> 1
<STX> 2
<ETX> 3
<ACK> 6
<NAK> 7
Transmission parameters between Master (computer or external protocol translation unit) and Slave (Carel controllers):
Baud rate 1200 Word: 8 bit Stop bit: 2 Parity: None
***Timing