使用手册编辑软件eb8000的教程资料使用手册plc_connect_guidehmi500-ascii_第1页
使用手册编辑软件eb8000的教程资料使用手册plc_connect_guidehmi500-ascii_第2页
使用手册编辑软件eb8000的教程资料使用手册plc_connect_guidehmi500-ascii_第3页
使用手册编辑软件eb8000的教程资料使用手册plc_connect_guidehmi500-ascii_第4页
使用手册编辑软件eb8000的教程资料使用手册plc_connect_guidehmi500-ascii_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、MT500 SeriesASCII Protocol Specification8 December 2004Table of ContentsRelease Note3Command List3Optional Parameters3Network Support5Wiring5Addressing5Broadcast Messages5Command Usage6RD (Batch Read)6Request6Reply6WD (Batch Write)8Request8Reply9RR (Random Read)10Request10Reply10RW (Random Write)12R

2、equest12Reply12RC (Read Coils)13Request13Reply14WC (Write Coils)15Request15Reply16Error Codes17Release Note.pdshmi500AsciiDriver V3.12004/12/8Correct the Parameter 2 turn delay delay time problem.pdshmi500AsciiDriver V3.02004/12/1Correct the multi-HMI connects HMI response error.pdshmi500AsciiDriver

3、 V2.02004/2/27Add Parameter 5 for HMI station number.Correct System Severe Error 10001 problem.Command ListThe following commands are used for communication between the ASCII host and the MT500.Optional ParametersParameters 1 5 are used as follows:Parameter 1 is reserved for the RS485/RS422 Wiring M

4、ode.When serial port select RS485. The Parameter 1: 0: RS422, 1: RS485EB500 V2.3.0 and newer version, select the serial port by PLC I/F port. And set the Parameter 1 to 0.Parameter 2 is the Turn Around DelayThis sets the time delay (Range: 01000, Unit: about 10ms) between when the MT500 receives a c

5、ommand, and when a response is issued. Also, see Parameter 4.Parameter 3 sets the Protocol Mode 0: RobustThe protocol uses the non-printable characters STX (02H) and ETX (03H), ACK (06H), and NAK (15H); and includes a 2-byte checksum.MnemonicCommand NameDescriptionRDBatch ReadReads specified data in

6、 a continuous blockWDBatch WriteWrites specified data in a continuous blockRRRandom ReadReads data from multiple, non-consecutive devicesRWRandom WriteWrites data to multiple, non-consecutive devicesRCRead CoilReads the specified coils in a continuous blockWCWrite CoilWrites the specified coils in a

7、 continuous block1: SimpleSome Host devices (such as some Motion Controllers) are not capable of generating the non-printable characters, or calculating the checksum. In this mode, the data packets are formed as defined below, but do not include the STX, ACK, ETX, NAK, or checksum. The 0x0D at the e

8、nd of the packet, the packet sent by the MT500 also has a 0x0D at the end.Parameter 4 sets whether or not the MT500 responds to Write commands.0: Responses On1: Responses OffNote:If set to 1, the Turn Around Delay setting (Parameter 2) has no affect.Parameter 5 HMI station number. (pdshmi500ascii_dr

9、iverVer2)Network SupportWiringThe MT500 ASCII protocol shall support network wiring using RS485 2-wire or 4-wire, based on the setting of PLC I/F port.AddressingThe protocol shall support each MT500 having a unique Station ID. Valid Station IDs shall be from 1 to 255. Parameter 5: HMI station number

10、.Broadcast MessagesA command with a Station ID of 0 shall be considered to be a Broadcast Message. Broadcast Messages shall be processed by the MT500, regardless of the MT500s Station Address. The MT500 shall not issue a reply message when a Broadcast Message is received, regardless of the setting o

11、f Parameter 4.Command UsageRD (Batch Read)RequestThis command reads up to 99 consecutive 16-bit items from the HMIs LW memory area. The command is always 14 bytes long.Byte 1: Always STX (0x02)Bytes 2, 3: The Station Number of the HMI to read (2 Hex digits) Bytes 4, 5: The command to executeBytes 6-

12、9: This is the starting address to read from. Must be 4 bytes long,Bytes 10, 11: This the number of addresses to read, up to 99. Must be 2 bytes long. Byte 12: Always ETX (0x03)Bytes 13, 14: The checksum is the lowest 8 bits of the sum of bytes 2 through 12.Example: Read 3 words starting from addres

13、s LW100, from the HMI at station 10 (0AH). This will read addresses LW100 LW102.The checksum (bytes 13 and 14) is calculated as the lowest 8 bits of the sum of the Hex codes for bytes 2 12.30 + 41+ 52 + 44 + 30 + 31 + 30 + 30 + 30 + 33 + 03 = 22E.The lowest 8 bits of the result returns 2E.ReplyThe r

14、eply length isL = (N * 4 ) + 8Where N = the number of requested devicesByte 1Bytes 2, 3Bytes 4, 5Bytes 6-9Bytes 10, 11Byte 12Bytes 13, 14STX0ARD010003ETX2E0230,4152,4430,31,30,3030,330332,45Byte 1Bytes 2,3Bytes 4, 5Bytes 6-9Bytes 10, 11Byte 12Bytes 13, 141 Byte2 Bytes2 Bytes4 Bytes2 Bytes1 Byte2 Byt

15、esSTXStationRDAddr.No. of ItemsETXChecksumIf the command is successful, the reply length will be at least 12 bytes, but could be as long as 404 bytes. It consists of the STX, followed by four bytes for each requested device, then the ETX and Checksum.The above example returns the following, assuming

16、 the HMI contains the following data:The following is the packet sent from the HMI02H 30H 41H 52H 44H 30H 30H 34H 42H 31H 46H 36H 48H 33H 46H43H 31H02H 43H 32HThe values in each requested device are returned in Hex. The checksum is calculated on bytes 2 (L-2).In the event of an error, the reply isBy

17、te 1Byte 2,3Byte 4,5Byte 6NAKStationR, DErr CodeETXC2STX0ARD004B1F6F3FC1AddressData10075 (4BH)1018047 (1F6FH)10216,321 (3FC1H)Byte L-2Byte L-1, LETXChecksumByte 1Bytes 2, 3Bytes 4,5Bytes 6-9Bytes 10-13Bytes 14-17Bytes 18 - (L-7)Bytes (L-6) -(L-3)STXStationCMDData 1Data 2Data 3Data 4 Data (N-1)Data N

18、WD (Batch Write)RequestThis command writes up to 99 consecutive 16-bit items to the HMIs LW memory area. The length of the command isL = (N * 4) + 14Where N = the number of requested devicesThe command will be at least 18 bytes long, but can be up to 410 bytes long.Byte 1: Always STX (0x02)Bytes 2,

19、3: The Station Number of the HMI to write (2 Hex digits) Bytes 4, 5: The command to executeBytes 4-7: This is the starting address to write to. Must be 4 bytes long, Bytes 8, 9: This the number of addresses to write. Must be 2 bytes long. Bytes 10 (L-3): The data to write. Up to 99 items, four Hex d

20、igits each. Byte (L-2): Always ETX (0x03).Bytes L-1, L: ChecksumExample: Write 3 words starting from address D201, to the HMI at station 17 (11H). This will write to addresses LW201, LW202, and LW203.LW201 = 101 (0x65) LW202 = 575 (0x23F) LW203 = 1049 (0x419)The checksum (bytes 25 and 26) is calcula

21、ted as the lowest 8 bits of the sum of the Hex codes for bytes 2 24.31+ 31 + 57 + 44 + 30 + 32 + 30 + 31 + 30 + 33 + 30 + 30 + 36 + 35 + 30 + 32 + 33+ 46+ 30 + 34+ 31+ 39 + 03 = 49A.Byte 1Bytes 2, 3Bytes 4, 5Bytes 6-9Bytes 10,11Bytes 12-15Bytes 16-19Bytes 20-23Byte 24Bytes 25,26STX11WD0201030065023F

22、0419ETX9A0231,3157,4430,32,30,3130,3330,30,36,3530,32,33,4630,34,31,390339,41Byte 1Bytes 2, 3Bytes 4, 5Bytes 6-9Bytes 10, 11Bytes 12-15Bytes 16-19Bytes 20 - (L-7)Bytes (L-6) -(L-3)Byte L-2Byte L-1, LSTXStationWDAddr.No. of ItemsData 1Data 2Data 3 Data (N-1)Data NETXCheck-sumThe lowest 8 bits of the

23、result returns 9A.ReplyIf the command is successful, the reply isIn the event of an error, the reply isByte 1Byte 2,3Byte 4,5Byte 6NAKStationW, DErr CodeByte 1Byte 2,3Byte 4,5ACKStationW, DRR (Random Read)RequestThis command reads up to 99 independently-addressed 16-bit items from the HMIs LW memory

24、 area. The length of the command isL = (N * 4) + 8Where N = the number of requested devicesThe command will be at least 12 bytes long, but can be up to 402 bytes long.Byte 1: Always STX (0x02)Bytes 2, 3: The Station Number of the HMI to read (2 Hex digits) Bytes 4, 5: The command to executeBytes 6-9

25、: This is the first address from which to retrieve data. Must be 4 bytes long, Bytes 10-13: This is the second address from which to retrieve data. Must be 4 bytes long,Bytes 14 (L-7): The remaining addresses from which to retrieve data. Each address must be 4 bytes long.Byte (L-2): Always ETX (0x03

26、).Bytes L-1, L: Checksum, calculated as the lower 8 bits of the sum of bytes 2 (L-2).ReplyIf successful, the reply length isL = (N * 4) + 10Where N = the number of requested devicesIf successful, the reply length will be at least 12 bytes, but can be up to 406 bytes. It consists of the STX, followed

27、 by four bytes for each requested device, then the ETX and Checksum.Byte 1Bytes 2, 3Bytes 4, 5Bytes 6-9Bytes 10-13Bytes 14 - (L-7)Bytes (L-6) - (L-3)Byte L-2Byte L-1, LSTXStationRRAddr 1Addr 2Addr 3 Addr (N-1)Addr NETXCheck- sumThe values in each requested device are returned in Hex. The checksum is

28、 calculated as the lower 8 bits of the sum of bytes 2 (L-2).In the event of an error, the reply isByte 1Byte 2,3Byte 4,5Byte 6NAKStationR, RErr CodeByte L-2Byte L-1, LETXChecksumByte 1Bytes 2,3Bytes 4,5Bytes 6-9Bytes 10-13Bytes 14-17Bytes 15 - (L-7)Bytes (L-6) -(L-3)STXStationCmdData 1Data 2Data 3Da

29、ta 4 Data (N-1)Data NRW (Random Write)RequestThis command writes up to 99 independently-addressed 16-bit items to the HMIs LW memory area. The length of the command isL = (N * 8) + 8Where N = the number of requested devicesThe command will be at least 16 bytes long, but can be up to 800 bytes long.B

30、yte 1: Always STX (0x02)Bytes 2, 3: The Station Number of the HMI to read (2 Hex digits) Bytes 4, 5: The command to executeBytes 6-9: This is the first address to write data to. Must be 4 bytes long,Bytes 10-13: This is the data to write to the address specified by the previous 4 bytes. Must be 4 by

31、tes long,Bytes 14 (L-3): The remaining addresses and data to write to the HMI. Each address and data item must be 4 bytes long.Byte (L-2): Always ETX (0x03).Bytes L-1, L: Checksum, calculated as the lower 8 bits of the sum of bytes 2 (L-2).ReplyIf the command is successful, the reply isIn the event

32、of an error, the reply isByte 1Byte 2,3Byte 4,5Byte 6NAKStationR, WErr CodeByte 1Byte 2,3Byte 4,5ACKStationR, WBytes(L-10) - (L-7)Bytes(L-6) - (L-3)Byte L-2Byte L-1, LAddr NData NETXCheck-sumByte 1Bytes 2,3Bytes 4, 5Bytes 6-9Bytes 10-13Bytes 14-17Bytes 18-21STXStationRWAddr 1Data 1Addr 2Data 2RC (Re

33、ad Coils)RequestThis command reads up to 99 consecutive coils from the HMIs LB memory area. The command is always 14 bytes long.Byte 1: Always STX (0x02)Bytes 2, 3: The Station Number of the HMI to read (2 Hex digits) Bytes 4, 5: The command to executeBytes 6-9: This is the starting address to read

34、from. Must be 4 bytes long, Bytes 10, 11: This the number of coils to read, up to 99. Must be 2 bytes long. Byte 12: Always ETX (0x03)Bytes 13, 14: The checksum is the lowest 8 bits of the sum of bytes 2 through 12.Example: Read 12 coils starting from address LB100, from the HMI at Station 7. This w

35、ill read coils LB100 LB111.The checksum (bytes 13 and 14) is calculated as the lowest 8 bits of the sum of the Hex codes for bytes 2 12.30 + 37 + 52 + 43 + 30 + 31 + 30 + 30 + 30 + 32 + 03 = 222.The lowest 8 bits of the result returns 22.Byte 1Bytes 2,3Bytes 4, 5Bytes 6-9Bytes 10, 11Byte 12Bytes 13,

36、 14STX07RC010012ETX220230,3752,4330,31,30,3030,320332,32Byte 1Bytes 2, 3Bytes 4, 5Bytes 6-9Bytes 10, 11Byte 12Bytes 13, 141 Byte2 Bytes2 Bytes4 Bytes2 Bytes1 Byte2 BytesSTXStationRCAddr.No. of ItemsETXChecksumReplyThe reply length isL = N + 8Where N = the number of requested devicesIf the command is

37、 successful, the reply length will be at least 9 bytes, but could be as long as 107 bytes. It consists of the STX, followed by one byte for each requested device, then the ETX and Checksum.If the HMI contains the following data:The the following data is returned02H 30H 37H 52H 43H 31H 30H31H 31H 31H

38、 30H 31H 31H 30H 30H30H31H 03H 34H 36HThe values in each requested device are returned in Hex. The checksum is calculated on bytes 2 (L-2).In the event of an error, the reply isByte 1Byte 2,3Byte 4,5Byte 6NAKStationR, CErr Code1ETX46STX07RC00101011000100101102103104105106107108109110111001010110001B

39、yte (L-3)Byte L-2Byte L-1, LData NETXChecksumByte 1Bytes 2,3Bytes 4,5Byte 2Byte 3Byte 4Bytes 5 - (L-4)STXStationRCData 1Data 2Data 3Data 4 Data (N-1)WC (Write Coils)RequestThis command writes up to 99 consecutive coils to the HMIs LB memory area. length of the command isTheL = N + 14Where N = the nu

40、mber of requested devicesThe command will be at least 15 bytes long, but can be up to 113 bytes long.Byte 1: Always STX (0x02)Bytes 2, 3: The Station Number of the HMI to read (2 Hex digits) Bytes 4, 5: The command to executeBytes 6-9: This is the starting address to write to. Must be 4 bytes long, Bytes 10, 11: This the number of addresses to write. Must be 2 bytes long. Bytes 1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论