预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共22页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

台達PLC的通讯协议是公开的,只要对该协议有清楚理解,所有台达产品的通讯问题迎刃而解,下面是协议全文:1.CommunicationInterface:RS-232C2.CommunicationProtocolASCIImode,9600(Baudrate),EVEN(Parity),1(Startbit),1(Stopbit)3.CommunicationDataFrameSTXStartcharacter‘:’(3AH)ADR1Communicationaddress:ADR08-bitaddressconsistsof2ASCIIcodesCMD1Commandcode:CMD08-bitcommandconsistsof2ASCIIcodesDATA(0)Contentsofdata:DATA(1)n´8-bitdataconsistof2nASCIIcodes.……….n£37,maximumof74ASCIIcodesDATA(n-1)LRCCHK1LRCchecksum:LRCCHK08-bitchecksumconsistsof2ASCIIcodesEND1Endcharacter:END0END1=CR(0DH),END0=LF(0AH)nADR(CommunicationAddress)Validcommunicationaddressesareintherangeof0…31.Communicationaddressequalsto0meansbroadcasttoallPLC,thePLCwillreplynormalmessagetothemasterdevice.Forexample,communicationtoPLCwithaddress16decimal:(ADR1,ADR0)=’1’,’0’ð’1’=31H,‘0’=30HnCMD(Commandcode)andDATA(datacharacters)Theformatofdatacharactersdependsonthecommandcode.Forexample,readingcontinuous8wordsformstartingdeviceaddress0614HofPLCwithaddress01H.FieldNameExample(Hex)Heading3ASlaveAddress01Commandcode03StartingAddressHi06StartingAddressLo14NumberofPointsHi00NumberofPointsLo08ErrorCheck(LRC)DANumberofPoints(max)=18(for16bitregister)=9(for32bitregister)Example:ReadingCoilsT20~T27fromslavedevice01PC→PLC“:010306140008DACRLF”PLC→PC“:01031000010002000300040005000600070008B8CRLF”FieldNameExample(Hex)SlaveAddress01Commandcode03BytesCount10DataHi(T20)00DataLo(T20)01DataHi(T21)00DataLo(T21)02DataHi(T22)00DataLo(T22)03DataHi(T23)00DataLo(T23)04DataHi(T24)00DataLo(T24)05DataHi(T25)00DataLo(T25)06DataHi(T26)00DataLo(T26)07DataHi(T27)00DataLo(T27)08ErrorCheck(LRC)C8nLRCCHK(checksum)LRC(LongitudinalRedundancyCheck)iscalculatedbysummingup,module256,thevaluesofthebytesfromADR1tolastdatacharacterthencalculatingthehexadecimalrepresentationofthe2’s-complementnegationofthesum.Forexample,reading1wordformaddress0401HofthePLCwithaddress01HSTX‘:’ADR1‘0’ADR0‘1’CMD1‘0’CMD0‘3’Startingdataaddress‘0’‘4’‘0’‘1’Numberofdata‘0’‘0’‘0’‘1’LRCCHK1‘F’LRCCHK0‘6’END1CREND0LF01H+03H+04H+01H+00+01H=0AHt