DVP - Communication Protocol
DVP - Communication Protocol
DVP - Communication Protocol
1
1. Communication Interface: RS-232C
2. Communication Protocol ASCII mode, 9600(Baud rate),7(Data length),
EVEN(Parity),1(Stop bit)
3. Communication Data Frame
ADR(Communication Address)
Valid communication addresses are in the range of 0…31. Communication address equals to
0 means broadcast to all PLC, the PLC will reply normal message to the master device.
For example, communication to PLC with address 16 decimal:
(ADR 1, ADR 0)=’1’,’0’’1’=31H, ‘0’ = 30H
2
Number of Points Lo 08
Error Check ( LRC ) DA
Number of Points(max)
= 18(for 16 bit register)
= 9(for 32 bit register)
“:01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 B8 CR LF”
3
LRC CHK(check sum)
LRC (Longitudinal Redundancy Check) is calculated by summing up, module 256, the values
of the bytes from ADR1 to last data character then calculating the hexadecimal representation
of the 2’s-complement negation of the sum.
For example, reading 1 word form address 0401H of the PLC with address 01H
STX ‘:’
ADR 1 ‘0’
ADR 0 ‘1’
CMD 1 ‘0’
CMD 0 ‘3’
‘0’
‘4’
Starting data address
‘0’
‘1’
‘0’
‘0’
Number of data
‘0’
‘1’
LRC CHK 1 ‘F’
LRC CHK 0 ‘6’
END 1 CR
END 0 LF
01H+03H+04H+01H+00+01H = 0AH
the 2’s-complement negation of 0AH is F6H
Exception response:
The PLC is been expected to return a normal response after receiving command messages
from the master device. The following depicts the conditions that no normal response is
replied to the master device.
The PLC does not receive the messages due to a communication error; thus the PLC has no
response. The master device will eventually process a timeout condition.
The PLC receives the messages without a communication error, but cannot handle it, an
exception response will return to the master device. In the exception response, the most
significant bit of the original command code is set to 1, and an exception code explains the
4
condition that caused the exception is returned.
5
An example of exception response of command code 01H and exception 02H:
Command message:
Response message:
Exception
Meaning:
code:
Illegal command code:
01 The command code received in the command message is not
available for the PLC.
Illegal device address:
02 The device address received in the command message is not
available for the PLC.
Illegal device value:
03 The device value received in the command message is not
available for the PLC.
07 Check Sum Error
Check if the check Sum is correct
Illegal command messages
6
The command message is too short.
Command message length is out of range.
7
The format of data characters depends on the command. The available command codes are
described as followed,
8
9
Command Code:01, Read Coil Status
Heading 3A
Slave Address 00
Command code 01
Starting Address Hi 08
Starting Address Lo 00
Number of Points Hi 00
Number of Points Lo 05
Error Check ( LRC ) F2
00H+01h+08h+00h+00h+05h = 0eh
3A000108000005F2
10
:00 01 0C 30 0001C2..
Field Name Example (Hex) Chú giải
Heading 3A :
Slave Address 00 Đại chỉ 00
Command code Mã lênh: 01 Read
01 Coil Status
3a 30 30 30 31 30 38 30 32 30 30 30 31 46 34 0d 0a
Field Name Example (Hex) Chú giải
Heading 3A :
Slave Address 00 Đại chỉ 00
Command code Mã lênh: 01 Read
01 Coil Status
TRả về”
:00010102FC bit 0
:00010103FB bit 1
11
Field Name Example (Hex)
Slave Address 00
Command code 01
Bytes Count 01
02
FC
12
Number of Points Lo 25
Error Check ( LRC ) BF
Number of Points(max)
= 18(for 16 bit register)
= 9(for 32 bit register)
13
PLC→PC
“:01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 B8 CR LF”
14
MMNN = 0xFF00….Coil ON
MMNN = 0x0000….Coil OFF
15
Command Code:06, Preset Single Register
Example:Setting Register T0 to 00 03
PC→PLC “:01 06 06 00 12 34 AD CR LF”
PLC→PC “:01 06 06 00 12 34 AD CR LF”
Switch ( c )
Case 0:T0
Q →:01 06 06 00 12 34 AD CR LF
Case 1:C0
Q →:01 06 0E 00 12 34 AF CR LF
Case 2:C232
Q →:01 06 0E E8 12 34 56 78 EF CR LF
Case 3:D10
16
Q →:01 06 10 0A 12 34 99 CR LF
Case 4:D1000
Q →:01 06 13 E8 12 34 BA CR LF
17
Command Code:15, Force Multiple Coils
18
Command Code:16, Preset Multiple Register
Number of Register(max)
= 16(for 16 bit register)
= 8(for 8 bit register)
Example:Setting Register T0 to 00 0A, T1 to 01 02.
PC→PLC “:01 10 06 00 02 00 04 00 0A 01 02 D6 CR LF”
PLC→PC “:01 10 06 00 00 02 E7 CR LF”
19
Command Code:17, Report Slave ID
Returns a description of controller present at the slave address, the current status of the slave
Run indicator, and other information specific to the slave device.
Command message:
Response message:
20
DVP Series PLC Internal Device Communication Address
Effective range
Device Range Type Address
ES/EX/SS SA/SX/SH EH
21
Effective
Device Range Type Address
ES/EX/SS SA/SX/SC EH
22
D 7680~7935 word 9E00~9EFF
D 7936~8191 word 9F00~9FFF
D 8192~8447 word A000~A0FF
D 8448~8703 word A100~A1FF
D 8704~8959 word A200~A2FF
D 8960~9215 word A300~A3FF
D 9216~9471 word A400~A4FF
D 9472~9727 word A500~A5FF
D 9728~9983 word A600~A6FF
D 9984~9999 word A700~A70F
23