rsqhrbhWPF上位机应用开发VIP课程_第1页
rsqhrbhWPF上位机应用开发VIP课程_第2页
rsqhrbhWPF上位机应用开发VIP课程_第3页
rsqhrbhWPF上位机应用开发VIP课程_第4页
rsqhrbhWPF上位机应用开发VIP课程_第5页
已阅读5页,还剩38页未读 继续免费阅读

付费下载

下载本文档

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

文档简介

20:00开始上课WPF上位机应用开发西门子S7协议:①仿真环境搭建②Modbus通信测试③了解S7系列PLC数据④S7报文结构与报文解析⑤S7通信库封装不公开报文结构复杂1、VisualStudio201916.9了解西门子 1、200Smart/STEP 2、PLCSIMAdvanced西门子 Q:数字量输出AIAQ:

区 区C: 区HC:高速计数器AC:累 器L:局部区S:顺序控制继

DB W:word->2byteBit:I0.0

PDU:ProtocolDataTPKT:TransportserviceontopoftheTCP(报文连接剂)COTP:Connection-OrirentedTransportProtocol

08Version,版本默认Version,版本默认18,保留默认,保留默认234858PDUType,连接请求PDUType6DSTDST78SRCSRC980000---0000--- Extended Extended Noexplilcitflow Noexplilcitflow8 Parametercode:tpdu-8ParameterSourceTSAP:01->PG;02->OP;03->S7单边(服务器模式);0x10->S7双边通机架与插槽号为TPDU8Parameter-code:dst- 8ParameterSourceDestination/8Parametercode:tpdu-Parameter8ParameterDestination8TPDU08Version,版本默认8Version,版本默认18,保留默认8,保留默认2348858PDUType,数据传输8PDUType68-000TPDU8-000TPDU1------Lastdata1------Lastdata78ProtocolId8ProtocolId88ROSCTR: 89RedundancyIdentificationRedundancyIdentificationProtocolDataUnitProtocolDataUnitParameterParameterDataData8Function:Setupcommunication8Errorclass:Noerror0x00)88Errorcode:MaxAmQ(paralleljobswithack)8Function:Setup8MaxAmQ(paralleljobswithack)MaxAmQ(paralleljobswithack)PDUMaxAmQ(paralleljobswithack)PDUlengthPDU 08Version,版本默认8Version,版本默认1882348858PDUType,数据传输8PDUType68-000TPDU8-000TPDU1------Lastdata1------Lastdata7S7-8ProtocolIdS7-8ProtocolId8889RedundancyIdentification)RedundancyIdentification)ProtocolDataUnitProtocolDataUnitParameterParameterDataDataS7-8Function:ReadVar0x048Errorclass:Noerror0x008Itemcount:8Errorcode:8结构标识,一般默认S7-8Function:ReadVar88Itemcount:8SyntaxId:S7ANY0x108Returncode:Success(0xff8Transportsize:BYTE28Transportsize:BYTE/WORD/DWORD数据块编号n数据(不定长度8Byte2-0Bit08Version,版本默认8Version,版本默认1882348858PDUType,数据传输8PDUType68-000TPDU8-000TPDU1------Lastdata1------Lastdata7S7-8ProtocolIdS7-8ProtocolId88ROSCTR:JOB89RedundancyIdentification)RedundancyIdentification)ProtocolDataUnitProtocolDataUnitParameterParameterDataData8Function:WriteVar0x0588Itemcount:8Errorcode:8结构标识,一般默认8Function:WriteVar88Itemcount:8SyntaxId:S7ANY8Returncode:Success(0xff8Transportsize:BYTE8Area18-位Byte2-0Bit8Return8Transportsize:n数据(不定长度协 协

0

Version,版本默认

Version,版本默认 3

PDUType

8

PDUType -0000000TPDU -0000000TPDU88

Lastdataunit:YesProtocolId,默认RedundancyIdentification( ProtocolDataUnitReferenceParameterlengthDatalengthUnknownParameterblocklengthStringlengthPI(programinvocation)Service:P_PROGRAM[PI-ServiceP_PROGRAM(PLCStart/

88 88

Lastdataunit:YesProtocolId,默认RedundancyIdentification( ProtocolDataUnitReferenceParameterlengthDataErrorclass:Noerror(0x00)Errorcode:0x00Function:PI-Service0881882348858868-000TPDU8-000TPDULastdataLastdata7S7-888889RedundancyIdentification)S7-RedundancyIdentification)ProtocolDataUnitProtocolDataUnitDataData8Function:PLC8Errorclass:NoerrorUnknown8Errorcode:8Function:PLCStop8

m-协

长度(bit)发送长度(bit)发送012388长度(bit)响应 Version,版本默认86789888-0000000TPDU1-------Lastdata-0000000TPDU1-------LastdataProtocolId,默认RedundancyIdentification)888ProtocolId,默认RedundancyIdentificationProtocolDataUnitS7-)S7-ProtocolDataUnitParameterParameterData8Parameter8Parameter888888 ----0111Functiongroup:Time1000----Type:Response----0111Functiongroup:TimefunctionsSubfunction:Setclock(1)Sequencenumber:0Returncode:Success(0xff)Transportsize:OCTETSTRING(0x09)S7Timestamp:8888888Subfunction:Readclock(1)Sequencenumber:1Dataunitreferencenumber:0Lastdataunit:Yes(0x00)Errorcode:Noerror(0x0000)Returncode:Success(0xff)Transportsize:OCTETSTRINGLength:00000000 Mi 0111

488588

Data

ParameterParameter218Method(Request/Response):Req8Method(Request/Response):Res8S7Timestamp-Year1:8S7Timestamp-Year2:85S7Timestamp-Month:88S7Timestamp-Day:8S7Timestamp-Hour:80S7Timestamp-Minute:80S7Timestamp-Second:协

2、模块信息列出为

协 008Version,版本默认8Version,版本默认1882348858PDUType8PDUType68-000TPDU8-000TPDU1------Lastdata1------Lastdata7S7-8ProtocolIdS7-8ProtocolId8889RedundancyIdentification RedundancyIdentification ProtocolDataUnitProtocolDataUnitParameterParameterDataData8Function:Startupload8Errorclass:Noerror8Function8Errorcode:Unknownbyte(s)inblockcontrol:8Function:Startupload8FunctionUploadID:Unknownbyte(s)inblockcontrol:UploadID:8Filename8_FileBlocktype:088Blocklengthstring0Block000218ADestinationfilesystem:A(Active6请求开始上传 -------1Moredata 0-协 08Version,版本默认8Version,版本默认18,保留默认8,保留默认2348858PDUType8PDUType68-000TPDU8-000TPDU1------Lastdata1------Lastdata78ProtocolId8ProtocolId8889RedundancyRedundancyIdentification ()ProtocolDataUnitProtocolDataUnitParameterParameterDataData8Function:Upload8Errorclass:Noerror8Function8Errorcode:Unknownbyte(s)in8Function:Upload8FunctionUploadID:Unknownbyte(s)inblockcontrol:n协

Version,版本默认

Version,版本默认

,保留默认

,保留默认3488 9

-0001------

PDUTypeTPDUnumberLastdataunit:YesProtocolId,默认RedundancyIdentification( ProtocolDataUnitReferenceParameterlengthDataFunction:endupload(0x1f)FunctionStatusErrorcode:0x0000(Noerror)UploadID:0x

-000 1------

PDUTypeTPDUnumberLastdataunit:YesProtocolId,默认RedundancyIdentification( ProtocolDataUnitReferenceParameterlengthDataErrorclass:Noerror(0x00)Errorcode:0x00Function:endupload协 M-Start

0

Version,版本默认 Version,版本默认 0 24848858PDUType8PDUTypeProtocolDataUnit

8

,保留默认

8

,保留默认

PDUType,数据传输TPDUnumberLastdataunit:YesProtocolId,默认RedundancyIdentification -0000000TPDU

-0000000TPDU

Parameter Lastdata

1-------Lastdata

ProtocolId

ProtocolId

Data

Errorclass:Noerror9 r n

RedundancyIdentification ProtocolDataUnitReferenceParameterlengthDataFunction:Startdownload(0xfa)Parameterdata

8888

RedundancyIdentification ProtocolDataUnitReferenceParameterlengthDataErrorclass:Noerror(0x00)Errorcode:0x00Function:Startdownload

Errorcode:Function:Startdownload

UnknowncharbeforeloadLengthofloadLengthofMC7协

0

Version,版本默认

0x03Version,版本默认 2

整个请求字节

DUType,数据传输DUnumberstdata

otocolId343488588

edundancyIdentification otocolDataUnit -000

TPDU

-0000000TPDU

rameter

Lastdata

Lastdata78788ta888rorclass:Noerror

RedundancyIdentification( ProtocolDataUnitReference

RedundancyIdentification( ProtocolDataUnitReference

rorcode:nction:Download(0x1b)e n

DatalengthFunction:download(0xfb)ParameterData

88

Datalength:226Errorclass:Noerror(0x00)Errorcode:0x00Function:Download

knownbyte(s)inblockcontrol: Destinationfilesystem:协 M-End

1 1 8Version,版本默认,保留默认8 PDUType-0000000TPDURedundancyIdentification ProtocolDataUnitParameterlengthDatalength

Version,版本默认 保留默认

数数

Version,版本默认保留默认数01

Version,版本默认,保留默认

r

33488Identification)

PDUType

-0000000TPDU

aUnitReference6767881------LastdataProtocolId881------LastdataProtocolId88899

8Function:ended8Errorclass:NoerrornParameter8Errorcode:

RedundancyIdentification ProtocolDataUnitParameterlengthDatalength:0Function:Download

wnload Destinationfilesystem:UnknownbytesJobrequestUserdata编程/调试、SZL、安全功能、时间设置请求错误(如果有错此码较多L7无效SZLL7DGSL7最大用户L7DGSL7PRTL7L7L7块PLCPLCS7ANY:AddressdataS7-Anypointer-likeDB1DBX10PBC-R_ID:R_IDfor :Alarm ALARM_IND:AlarmindicationALARM_ACK:AlarmacknowledgemessageALARM_QUERYREQ:AlarmqueryrequestNOTIFY_IND:NotifyindicationDRIVEESANY:seenonDriveESStarterwithroutingover1200SYM:SymbolicaddressmodeofS7-DBREAD:KindofDBblockreadseenonlyatanS7-NCK:SinumerikNCKHMITOD(Timeofday32DATEANDOCTETIECIECHS

温馨提示

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

评论

0/150

提交评论