Siemens RS-485 User Manual

7
865.1
Master-slave principle
Interface RS-485
Application examples:
- Process visualization
- Plant control
- Reporting
Communication between a PC (master) and a device (slave) via MOD bus is based on the master-slave principle in the form of data query / instruction – reply.
RWF40...
CC1A7865.1en
31.10.2002
A master computer controls the exchange of data and can address up to 99 controllers via device addresses (slaves).
Siemens Building Technologies
HVAC Products
Transmission mode (RTU)
The transmission mode used is the RTU (remote terminal unit) mode. Data are trans­mitted in binary format (hexadecimal) with 8 bits. The LSB (least significant bit) is transmitted first. ASCII mode is not supported.
Data format
Device address
The data format describes the structure of the transmitted byte.
Data word Parity bit Stop bit ½ bit Number of bits
8 bit Not 1 9
The slaves’ device addresses can be selected between 1 and 99. Device address 0 is reserved.
A maximum of 31 slaves can be addressed via the RS-422 / RS-485 interface.
+
There are 2 choices of data exchange:
Query Data query / instructions delivered by the master to a slave via the re-
spective device address. The addressed slave responds.
Broadcast Master instructions to all slaves via device address 0.
The addressed slaves do not respond. A data query with device address 0 does not make sense. A certain setpoint can be transmitted to all slaves, for example. In that case, correct adoption of the value by the slaves should be checked by subsequent setpoint readout.
2/14
Siemens Building Technologies CC1A7865.1en HVAC Products 31.10.2002
Communication sequence
Both the start and end of a data block are characterized by transmission pauses. The maximum period of time that may elapse between 2 successive characters is 3 times the period of time required for the transmission of one character. The character transmission time (period of time required for the transmission of 1 char­acter) is dependent on the Baud rate and the type of data format.
Using a data format of 8 data bits, no parity bit and 1 stop bit, the character transmis­sion time is calculated as follows:
Character transmission time [ms] = 1000 * 9 bits / Baud rate
Process
Example
Data query by the master
Transmission time = n characters * 1000 * x bits / Baud rate
Identification of end of data query
3 characters * 1000 * x bits / Baud rate
Handling of data query by the slave (£ 250 ms)
Reply by the slave
Transmission time = n characters * 1000 * x bits / Baud rate
Identification of end of reply
3 characters * 1000 * x bits / Baud rate
Identification of the data query or end of the reply with a data format of 10 / 9 bits.
Waiting time = 3 characters * 1000 * x bits / Baud rate
Baud rate Data format [bits] Waiting time [ms]
9.600 9 2.813
19.200 9 1.406
3/14
Siemens Building Technologies CC1A7865.1en HVAC Products 31.10.2002
Data query sequence
Time sequence
The time sequence of a data query looks as follows:
Master
Slave
7865z12e/1102
Data query
Data query
Reply
t
t
0
1
t
t
0
2
t0 Identification of end = 3 characters
(time is dependent on the Baud rate)
t1 This time is dependent on internal handling.
The maximum handling time is 250 ms
t2 This is the time required by the device to switch from the transmitting mode back
to the receiving mode. This time must be observed by the master before it makes a new data query. It must always be maintained, even if the new data query is sent to some other device.
t2 ³ 20 ms
Communication during the slave’s internal handling time
The master is not allowed to make any data queries during the slave’s internal handling time. Data queries made during that period of time will be ignored by the slave.
Communication during the slave’s response time
The master is not allowed to make any data queries during the slave’s response time. Data queries made during that period of time cause all data currently on the bus to become obsolete.
4/14
Siemens Building Technologies CC1A7865.1en HVAC Products 31.10.2002
Structure of the data blocks
All data blocks use the same structure:
Data structure
Fault handling
Error codes
Slave address Function code Data field Checksum CRC16
1 byte 1 byte x byte 2 bytes
Every data block contains 4 fields:
Slave address
Function code
Data field
Checksum
Device address of a certain slave
Function selection (reading or writing words)
Contains the following information:
- Word address
- Number of words
- Word value
Identification of transmission errors
3 different error codes are used:
1 Invalid function 2 Invalid parameter address 8 Write access to parameter rejected
Reply in the event of fault
Example
Special cases
Slave address Function
Error code Checksum CRC16
XX OR 80 h
1 byte 1 byte 1 byte 2 bytes
The function code is OR linked with 0 x 80, that is, the MSB (most significant bit) will be set to 1.
Data query:
01 02 00 70 00 04 CRC16
Reply:
01 82 01 CRC16
In the following cases, the slave does not reply:
- The checksum (CRC16) is wrong
- The instruction given by the master is incomplete or overdefined
- The number of words or bits to be read is zero
5/14
Siemens Building Technologies CC1A7865.1en HVAC Products 31.10.2002
Loading...
+ 9 hidden pages