台达PLC的通讯协议.doc

上传人:m**** 文档编号:544261122 上传时间:2024-03-16 格式:DOC 页数:22 大小:48KB
返回 下载 相关 举报
台达PLC的通讯协议.doc_第1页
第1页 / 共22页
台达PLC的通讯协议.doc_第2页
第2页 / 共22页
台达PLC的通讯协议.doc_第3页
第3页 / 共22页
台达PLC的通讯协议.doc_第4页
第4页 / 共22页
台达PLC的通讯协议.doc_第5页
第5页 / 共22页
点击查看更多>>
资源描述

《台达PLC的通讯协议.doc》由会员分享,可在线阅读,更多相关《台达PLC的通讯协议.doc(22页珍藏版)》请在金锄头文库上搜索。

1、台達PLC的通讯协议是公开的,只要对该协议有清楚理解,所有台达产品的通讯问题迎刃而解,下面是协议全文:1. Communication Interface: RS-232C2. Communication Protocol ASCII mode, 9600(Baud rate), EVEN(Parity), 1(Start bit),1(Stop bit)3. Communication Data FrameSTX Start character :(3AH)ADR 1 Communication address:ADR 0 8-bit address consists of 2 ASCII

2、codesCMD 1 Command code:CMD 0 8-bit command consists of 2 ASCII codesDATA(0) Contents of data:DATA(1) n8-bit data consist of 2n ASCII codes. . n37, maximum of 74 ASCII codesDATA(n-1) LRC CHK 1 LRC check sum:LRC CHK 0 8-bit check sum consists of 2 ASCII codesEND 1 End character:END 0 END 1 = CR(0DH),

3、END 0 = LF(0AH)n ADR(Communication 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

4、 = 30Hn 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 Example (Hex)Heading 3ASlave Address 01Command code 03Starting Address Hi 06St

5、arting Address Lo 14Number of Points Hi 00Number of Points Lo 08Error Check ( LRC ) DANumber of Points(max) = 18(for 16 bit register)= 9(for 32 bit register)Example:Reading Coils T20T27 from slave device 01PCPLC“: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

6、 08 B8 CR LF”Field Name Example (Hex)Slave Address 01Command code 03Bytes Count 10Data Hi(T20) 00Data Lo(T20) 01Data Hi(T21) 00Data Lo(T21) 02Data Hi(T22) 00Data Lo(T22) 03Data Hi(T23) 00Data Lo(T23) 04Data Hi(T24) 00Data Lo(T24) 05Data Hi(T25) 00Data Lo(T25) 06Data Hi(T26) 00Data Lo(T26) 07Data Hi(

7、T27) 00Data Lo(T27) 08Error Check(LRC) C8n 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 2s-complement negation of the sum. For example, re

8、ading 1 word form address 0401H of the PLC with address 01HSTX :ADR 1 0ADR 0 1CMD 1 0CMD 0 3Starting data address 0401Number of data 0001LRC CHK 1 FLRC CHK 0 6END 1 CREND 0 LF01H+03H+04H+01H+00+01H = 0AHthe 2s-complement negation of 0AH is F6HException response:The PLC is been expected to return a n

9、ormal 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 pro

10、cess 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 conditi

11、on that caused the exception is returned.An example of exception response of command code 01H and exception 02H:Command message:Field Name Example (Hex)Heading 3ASlave Address 01Function 01Starting Address Hi 04Starting Address Lo 00Number of Points Hi 00Number of Points Lo 10Error Check ( LRC ) EAR

12、esponse message:Field Name Example (Hex)Heading 3ASlave Address 01Function 81Exception Code 02Error Check ( LRC ) 7CException code: Meaning:01 Illegal command code:The command code received in the command message is not available for the PLC.02 Illegal device address:The device address received in t

13、he command message is not available for the PLC.03 Illegal device value:The device value received in the command message is not available for the PLC.07 Check Sum ErrorCheck if the check Sum is correctIllegal command messagesThe command message is too short.Command message length is out of range.u T

14、he format of data characters depends on the command. The available command codes are described as followed, Code Name Description01 Read Coil Status S, Y, M, T, C02 Read Input Status S, X, Y, M,T, C03 Read Holding Registers T, C, D05 Force Single Coil S, Y, M, T, C06 Preset Single Register T, C, D15

15、 Force Multiple Coils S, Y, M, T, C16 Preset Multiple Register T, C, D17 Report Slave ID NoneDELTA DVP-ES Series PLC DEVICE ADDRESSDevice Range Effective Range AddressS 000255 000127 000000FFS 246511 010001FFS 512767 020002FFS 7681023 030003FFX 000377 (Octal) 000177 (Octal) 040004FFY 000377 (Octal) 000177 (Octal) 050005FFT 000255 000127 060006FFM 000255 00001279 080008FFM 256511 090009FFM 512767 0A000AFFM 7681023 0B000BFFM 10241279 0C000

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号