Anda di halaman 1dari 15

DELTA DVP Series PLC

COMMUNICATION PROTOCOL VER 1.0

DELTA ELECTRONICS, INC.

Communication Interface: RS-232C Communication Protocol ASCII mode, 9600Baud rate,7(Data length), EVENParity,1Stop bit 1. Communication Data Frame STX ADR 1 ADR 0 CMD 1 CMD 0 DATA0 DATA1 . DATAn-1 LRC CHK 1 LRC CHK 0 END 1 END 0 Start character :3AH Communication address: 8-bit address consists of 2 ASCII codes Command code: 8-bit command consists of 2 ASCII codes Contents of data: n 8-bit data consist of 2n ASCII codes. n 37, maximum of 74 ASCII codes LRC check sum: 8-bit check sum consists of 2 ASCII codes End character: END 1 = CR0DHEND 0 = LF0AH

ADRCommunication Address Valid communication addresses are in the range of 031. 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,01=31H, 0 = 30H CMD (Command code) and DATA (data characters)

The format of data characters depends on the command code. For example, reading continuous 8 words form starting device address 0614H of PLC with address 01H. Field Name Heading Slave Address Command code Starting Address Hi Starting Address Lo Number of Points Hi Number of Points Lo Error Check ( LRC ) Number of Points(max) = 18for 16 bit register = 9for 32 bit register Example (Hex) 3A 01 03 06 14 00 08 DA

ExampleReading Coils T20~T27 from slave device 01 PCPLC 01 03 06 14 00 08 DA CR LF PLCPC 01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 B8 CR LF Field Name Slave Address Command code Bytes Count Data HiT20 Data LoT20 Data HiT21 Data LoT21 Data HiT22 Data LoT22 Data HiT23 Data LoT23 Data HiT24 Data LoT24 Data HiT25 Data LoT25 Data HiT26 Data LoT26 Data HiT27 Data LoT27 Error CheckLRC LRC CHKcheck sum Example (Hex) 01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 C8

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 2s-complement negation of the sum.

For example, reading 1 word form address 0401H of the PLC with address 01H
STX ADR 1 ADR 0 CMD 1 CMD 0 Starting data address 0 1 0 3 0 4 0 1 0 0 0 1 F 6 CR LF

Number of data

LRC CHK 1 LRC CHK 0 END 1 END 0

01H+03H+04H+01H+00+01H = 0AH the 2s-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 condition that caused the exception is returned.

An example of exception response of command code 01H and exception 02H: Command message: Field Name Heading Slave Address Function Starting Address Hi Starting Address Lo Number of Points Hi Number of Points Lo Error Check ( LRC ) Response message: Field Name Heading Slave Address Function Exception Code Error Check ( LRC ) Example (Hex) 3A 01 81 02 7C Example (Hex) 3A 01 01 04 00 00 10 EA

Exception code: 01

Meaning: Illegal command code: The command code received in the command message is not available for the PLC. Illegal device address: The device address received in the command message is not available for the PLC. Illegal device value: The device value received in the command message is not available for the PLC. Check Sum Error Check if the check Sum is correct Illegal command messages The command message is too short. Command message length is out of range.

02

03

07

The format of data characters depends on the command. The available command codes are described as followed, Code 01 02 03 05 06 15 16 17 Name Read Coil Status Read Input Status Read Holding Registers Force Single Coil Preset Single Register Force Multiple Coils Preset Multiple Register Report Slave ID Description S, Y, M, T, C S, X, Y, M,T, C T, C, D S, Y, M, T, C T, C, D S, Y, M, T, C T, C, D None

DELTA DVP-ES Series PLC DEVICE ADDRESS Device S S S S X Y T M M M M M C D D D D D Range 000~255 246~511 512~767 768~1023 000~377 (Octal) 000~377 (Octal) 000~255 000~255 256~511 512~767 768~1023 1024~1279 000~255 000~255 256~511 512~767 768~1023 1024~1279 Effective Range 000~127 Address 0000~00FF 0100~01FF 0200~02FF 0300~03FF 0400~04FF 0500~05FF 0600~06FF 0800~08FF 0900~09FF 0A00~0AFF 0B00~0BFF 0C00~0CFF 0E00~0EFF 1000~10FF 1100~11FF 1200~12FF 1300~13FF 1400~14FF

000~177 (Octal) 000~177 (Octal) 000~127 0000~1279

000~127 232~255 000~599 1000~1143

Command Code01, Read Coil Status Field Name Heading Slave Address Command code Starting Address Hi Starting Address Lo Number of Points Hi Number of Points Lo Error Check ( LRC ) Example (Hex) 3A 01 01 06 14 00 25 BF

Number of Points(max) = 255 = 0x00FF ExampleReading Coils T20~T56 from slave device 01 PCPLC 01 01 06 14 00 25 BF CR LF PLCPC 01 01 05 CD 6B B2 0E 1B D6 CR LF Field Name Slave Address Command code Bytes Count DataCoils T27T20 DataCoils T35T38 DataCoils T43T36 DataCoils T51T44 DataCoils T56T52 Error CheckLRC Example (Hex) 01 01 05 CD 6B B2 0E 1B E6

Command Code02, Read Input Status Field Name Heading Slave Address Command code Starting Address Hi Starting Address Lo Number of Points Hi Number of Points Lo Error Check ( LRC ) Example (Hex) 3A 01 02 05 14 00 25 BF

ExampleReading Contact Y024~Y070 from slave device 01 PCPLC 01 02 05 14 00 25 BF CR LF PLCPC 01 01 05 CD 6B B2 0E 1B E5 CR LF Field Name Example (Hex)
7

Slave Address Command code Bytes Count DataCoils Y033Y024 DataCoils Y043Y034 DataCoils Y053Y044 DataCoils Y063Y054 DataCoils Y070Y064 Error CheckLRC

01 02 05 CD 6B B2 0E 1B E5

Command Code03, Read Holding Register Holding RegisterT, C, D Field Name Heading Slave Address Command code Starting Address Hi Starting Address Lo Number of Points Hi Number of Points Lo Error Check ( LRC ) Number of Points(max) = 18for 16 bit register = 9for 32 bit register ExampleReading Coils T20~T27 from slave device 01 PCPLC 01 03 06 14 00 08 DA CR LF PLCPC 01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 B8 CR LF Field Name Slave Address Command code Bytes Count Data HiT20 Data LoT20 Data HiT21 Data LoT21 Data HiT22 Data LoT22 Data HiT23 Example (Hex) 01 03 10 00 01 00 02 00 03 00
8

Example (Hex) 3A 01 03 06 14 00 08 DA

Data LoT23 Data HiT24 Data LoT24 Data HiT25 Data LoT25 Data HiT26 Data LoT26 Data HiT27 Data LoT27 Error CheckLRC

04 00 05 00 06 00 07 00 08 C8

Command Code05, Force Single Coil Field Name Heading Slave Address Command code Coil Address Hi Coil Address Lo Force Data Hi Force Data Lo Error Check ( LRC ) Example (Hex) 3A 01 05 05 00 FF 00 F6

MMNN = 0xFF00.Coil ON MMNN = 0x0000.Coil OFF ExampleForcing Coil Y000 ON PCPLC 01 05 05 00 FF 00 F6 CR LF PLCPC 01 05 05 00 FF 00 F6 CR LF Field Name Heading Slave Address Command code Coil Address Hi Coil Address Lo Force Data Hi Force Data Lo Error Check ( LRC ) Example (Hex) 3A 01 05 05 00 FF 00 F6

Command Code06, Preset Single Register Field Name Heading Slave Address Command code Register Address Hi Register Address Lo Preset Data Hi Preset Data Lo Error Check ( LRC ) Example (Hex) 3A 01 06 06 00 12 34 AD

ExampleSetting Register T0 to 00 03 PCPLC 01 06 06 00 12 34 AD CR LF PLCPC 01 06 06 00 12 34 AD CR LF Field Name Heading Slave Address Command code Register T0 Address Hi Register T0 Address Lo Preset Data Hi Preset Data Lo Error Check ( LRC ) Switch ( c ) Case 0T0 Q 01 06 06 00 12 34 AD CR LF Case 1C0 Q 01 06 0E 00 12 34 AF CR LF Case 2C232 Q 01 06 0E E8 12 34 56 78 EF CR LF Case 3D10 Q 01 06 10 0A 12 34 99 CR LF Case 4D1000 Q 01 06 13 E8 12 34 BA CR LF Example (Hex) 3A 01 06 06 00 12 34 AD

10

Command Code15, Force Multiple Coils Field Name Heading Slave Address Command code Coil Address Hi Coil Address Lo Quantity of Coils Hi Quantity of Coils Lo Byte Count Force Data Hi Force Data Lo Error Check (LRC) Example (Hex) 3A 01 0F 05 00 00 0A 02 CD 01 11

Quantity of Coils (max) = 255 ExampleSetting Coil Y007Y000 = 1100 1101, Y011Y010 = 01. PCPLC 01 0F 05 00 00 0A 02 CD 01 11 CR LF PLCPC 01 0F 05 00 00 0A E1 CR LF Field Name Heading Slave Address Command code Register T0 Address Hi Register T0 Address Lo Preset Data Hi Preset Data Lo Error Check ( LRC ) Example (Hex) 3A 01 0F 05 00 00 0A E1

11

Command Code16, Preset Multiple Register Field Name Heading Slave Address Command code Starting Address Hi Starting Address Lo Number of Register Hi Number of Register Lo Byte Count Data Hi Data Lo Data Hi Data Lo Error Check (LRC) Example (Hex) 3A 01 10 06 00 00 02 04 00 0A 01 02 C6

Number of Register(max) = 16for 16 bit register = 8for 8 bit register ExampleSetting Register T0 to 00 0A, T1 to 01 02. PCPLC 01 10 06 00 02 00 04 00 0A 01 02 D6 CR LF PLCPC 01 10 06 00 00 02 E7 CR LF Field Name Heading Slave Address Command code Starting Address Hi Starting Address Lo Number of Registers Hi Number of Registers Lo Error Check ( LRC ) Example (Hex) 3A 01 10 06 00 00 02 E7

12

Command Code17, 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: Field Name Heading Slave Address Command code Error Check (LRC) Response message: Field Name Heading Slave Address Command code Byte Count Slave ID Run Indicator Status 00 = OFF FF = ON Data 0D1001 HI Data 1D1001 LOW Error Check (LRC) Example (Hex) 3A 01 11 04 01 FF Example (Hex) 3A 01 11 EE

40 10 9A

13

DVP Series PLC Internal Device Communication Address


Range Type Address Effective range ES/EX/SS SA/SX/SH EH

Device

S S S S X Y T M M M M M M M M M M M M M M M M C

000~255 246~511 512~767 768~1023 000~377 (Octal) 000~377 (Octal) 000~255 000~255 256~511 512~767 768~1023 1024~1279 1280~1535 1536~1791 1792~2047 2048~2303 2304~2559 2560~2815 2816~3071 3072~3327 3328~3583 3584~3839 3840~4095 0~199 16-bit 200~255 32-bit

bit bit bit bit bit bit bit/word bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit/word bit/Dword

0000~00FF 0100~01FF 0200~02FF 0300~03FF 0400~04FF 0500~05FF 0600~06FF 0800~08FF 0900~09FF 0A00~0AFF 0B00~0BFF 0C00~0CFF 0D00~0DFF B000~B0FF B100~B1FF B200~B2FF B300~B3FF B400~B4FF B500~B5FF B600~B6FF B700~B7FF B800~B8FF B900~B9FF 0E00~0EC7 0EC8~0EFF

0~127

0~1023

0~1023

0~177 0~127 0~1279

0~177 000~255 0~4095

000~377 000~255 0000~4095

0~127 232~255

0~199 200~255

0~199 200~255

14

Device

Range

Type

Address

Effective ES/EX/SS SA/SX/SC EH

D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D

000~256 256~511 512~767 768~1023 1024~1279 1280~1535 1536~1791 1792~2047 2048~2303 2304~2559 2560~2815 2816~3071 3072~3327 3328~3583 3584~3839 3840~4095 4096~4351 4352~4607 4608~4863 4864~5119 5120~5375 5376~5631 5632~5887 5888~6143 6144~6399 6400~6655 6656~6911 6912~7167 7168~7423 7424~7679 7680~7935 7936~8191 8192~8447 8448~8703 8704~8959 8960~9215 9216~9471 9472~9727 9728~9983 9984~9999

word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word

1000~10FF 1100~11FF 1200~12FF 1300~13FF 1400~14FF 1500~15FF 1600~16FF 1700~17FF 1800~18FF 1900~19FF 1A00~1AFF 1B00~1BFF 1C00~1CFF 1D00~1DFF 1E00~1EFF 1F00~1FFF 9000~90FF 9100~91FF 9200~92FF 9300~93FF 9400~94FF 9500~95FF 9600~96FF 9700~97FF 9800~98FF 9900~99FF 9A00~9AFF 9B00~9BFF 9C00~9CFF 9D00~9DFF 9E00~9EFF 9F00~9FFF A000~A0FF A100~A1FF A200~A2FF A300~A3FF A400~A4FF A500~A5FF A600~A6FF A700~A70F

0~1311

0~4999

0000~9999

15

Anda mungkin juga menyukai