您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 冶金工业 > 西门子传动产品与S7系列PLC通讯入门级学习教程
AutomationandDrivesA&DCustomerService&Support2Profibus通讯快速入门必备条件Step7编程软件PLC中具有Profibus-DP通讯口Profibus通讯电缆Profibus总线联结器Drive中有Profibus通讯模板.如:MASTERDRIVE的CBP2通讯模板,标准变频器的Profibus通讯模板.AutomationandDrivesA&DCustomerService&Support3121.将MASTERDRIVESCBP/CBP2加入组态2.Profibus地址硬件组态AutomationandDrivesA&DCustomerService&Support4硬件组态1.将MICROMASTER4加入组态2.Profibus地址12AutomationandDrivesA&DCustomerService&Support5121.MASTERDRIVE中可供选择的PP0类型选择数据格式2.I/QaddressMASTERDRIVEAutomationandDrivesA&DCustomerService&Support6选择数据格式121.MICROMASTER4中可供选择的数据格式2.I/QaddressMICROMASTERAutomationandDrivesA&DCustomerService&Support7Step7中的编程创建数据块DB1AutomationandDrivesA&DCustomerService&Support8Step7中的编程1.在Step7中对PKW(参数区)读写参数时调用SFC14和SFC152.SFC14(“DPRD_DAT”)用于读Profibus从站的数据3.SFC15(“DPWR_DAT”)用于将数据写入Profibus从站4.W#16#100(即256)是硬件组态时PKW的起始地址说明:AutomationandDrivesA&DCustomerService&Support9AK:任务ID或应答ID程序举例11.读参数r01512100F1.将W#16#100F写入DB1.DBW28(PWE)1:读取数值PNU:参数号F:十进制152.将W#16#0写入DB1.DBW30(IND)IND=0注:PKW,IND的详细说明见附录Step7中的编程AutomationandDrivesA&DCustomerService&Support10注:PKW,IND的详细说明见附录读取从站数据将数据写入从站1231.W#16#100(即256)是硬件组态时PKW的起始地址2.将从站数据读入DB1.DBX0.0开始的8个字节(P#DB1.DBX0.0BYTE8)PKEDB1.DBW0INDDB1.DBW2PWE1DB1.DBW4参数值的高字位PWE2DB1.DBW6参数值的低字位3.将DB1.DBX28.0开始的8个字节写入从站(P#DB1.DBX28.0BYTE8)DB1.DBW28PKEDB1.DBW30IND参数值的高字位DB1.DBW32PWE1参数值的低字位DB1.DBW34PWE2程序举例1.1Step7中的编程AutomationandDrivesA&DCustomerService&Support11AK:任务ID或应答ID程序举例2(读参数数组的数值)2.读参数P401.21261911.将W#16#6191写入DB1.DBW28(PWE)6:读取数组的数值PNU:参数号191:十进制4012.将W#16#2写入DB1.DBW30(IND)IND=2注:PKW,IND的详细说明见附录Step7中的编程AutomationandDrivesA&DCustomerService&Support12注:PKW,IND的详细说明见附录读取从站数据将数据写入从站123程序举例2.1(读参数数组的数值)Step7中的编程1.W#16#100(即256)是硬件组态时PKW的起始地址2.将从站数据读入DB1.DBX0.0开始的8个字节(P#DB1.DBX0.0BYTE8)PKEDB1.DBW0INDDB1.DBW2PWE1DB1.DBW4参数值的高字位PWE2DB1.DBW6参数值的低字位3.将DB1.DBX28.0开始的8个字节写入从站(P#DB1.DBX28.0BYTE8)DB1.DBW28PKEDB1.DBW30IND参数值的高字位DB1.DBW32PWE1参数值的低字位DB1.DBW34PWE2AutomationandDrivesA&DCustomerService&Support13AK:任务ID或应答ID程序举例3(读须置位参数页的参数)3.读参数U001.21260011.将W#16#6001写入DB1.DBW28(PWE)6:读取数组的数值PNU:参数号1:十进制12.将W#16#280写入DB1.DBW30(IND)注:PKW,IND的详细说明见附录0280IND=2参数页选择位置1Step7中的编程AutomationandDrivesA&DCustomerService&Support14注:PKW,IND的详细说明见附录读取从站数据将数据写入从站123Step7中的编程程序举例3.1(读须置位参数页的参数)1.W#16#100(即256)是硬件组态时PKW的起始地址2.将从站数据读入DB1.DBX0.0开始的8个字节(P#DB1.DBX0.0BYTE8)PKEDB1.DBW0INDDB1.DBW2PWE1DB1.DBW4参数值的高字位PWE2DB1.DBW6参数值的低字位3.将DB1.DBX28.0开始的8个字节写入从站(P#DB1.DBX28.0BYTE8)DB1.DBW28PKEDB1.DBW30IND参数值的高字位DB1.DBW32PWE1参数值的低字位DB1.DBW34PWE2AutomationandDrivesA&DCustomerService&Support15程序举例4(写参数)1234Step7中的编程4.写参数P401.1(将W#16#1000写入P401.1中)AutomationandDrivesA&DCustomerService&Support16AK:任务ID或应答ID81911.将W#16#8191写入DB1.DBW28(PWE)8:写数组的数值PNU:参数号191:十进制4012.将W#16#100写入DB1.DBW30(IND)注:PKW,IND的详细说明见附录0100IND=1参数页选择位为0程序举例4.1(写参数)3.将W#16#0写入DB1.DBW32(PKE1:参数值的高字节)4.将W#16#1000写入DB1.DBW32(PKE2:参数值的低字节)Step7中的编程AutomationandDrivesA&DCustomerService&Support17注:PKW,IND的详细说明见附录读取从站数据将数据写入从站123Step7中的编程1.W#16#100(即256)是硬件组态时PKW的起始地址2.将从站数据读入DB1.DBX0.0开始的8个字节(P#DB1.DBX0.0BYTE8)PKEDB1.DBW0INDDB1.DBW2PWE1DB1.DBW4参数值的高字位PWE2DB1.DBW6参数值的低字位3.将DB1.DBX28.0开始的8个字节写入从站(P#DB1.DBX28.0BYTE8)DB1.DBW28PKEDB1.DBW30IND参数值的高字位DB1.DBW32PWE1参数值的低字位DB1.DBW34PWE2程序举例4.2(写参数)AutomationandDrivesA&DCustomerService&Support181.在Step7中对PZD(过程数据)读写参数时调用SFC14和SFC152.SFC14(“DPRD_DAT”)用于读Profibus从站的数据3.SFC15(“DPWR_DAT”)用于将数据写入Profibus从站4.W#16#108(即264)是硬件组态时PZD的起始地址5.对特殊结构的PZD可用PQW,PIW进行读写对PZD(过程数据)的读写Step7中的编程说明:AutomationandDrivesA&DCustomerService&Support19对PZD(过程数据)的读写程序举例5:对PPO5中10PZD的读写PZD的起始地址264即:W#16#108对应10PZD读入字节数为20对应10PZD写入字节数为20Step7中的编程AutomationandDrivesA&DCustomerService&Support20对PZD(过程数据)的读写程序举例5:对PPO5中10PZD的读写DB1中与PZD相对应的数据字从PZD读入的数据写入PZD的数据PZD1DB1.DBW8PZD2DB1.DBW10PZD3DB1.DBW12PZD4DB1.DBW14PZD5DB1.DBW16PZD6DB1.DBW18PZD7DB1.DBW20PZD8DB1.DBW22PZD9DB1.DBW26PZD10DB1.DBW28DB1.DBW36PZD1DB1.DBW38PZD2DB1.DBW40PZD3DB1.DBW42PZD4DB1.DBW44PZD5DB1.DBW46PZD6DB1.DBW48PZD7DB1.DBW50PZD8DB1.DBW52PZD9DB1.DBW54PZD20Step7中的编程AutomationandDrivesA&DCustomerService&Support21Drive中的设置1.在P918中设置Profibus地址,必须与Step7中设置相同.地址不能重复.2.控制字第十位置“1”.PZD1=W#16#X4XX.AutomationandDrivesA&DCustomerService&Support22GOODLUCKYAutomationandDrivesA&DCustomerService&Support23附录AutomationandDrivesA&DCustomerService&Support24附录AutomationandDrivesA&DCustomerService&Support25附录AutomationandDrivesA&DCustomerService&Support26附录AutomationandDrivesA&DCustomerService&Support27附录AutomationandDrivesA&DCustomerService&Support28附录AutomationandDrivesA&DCustomerService&Support29附录AutomationandDrivesA&DCustomerService&Support30附录AutomationandDrivesA&DCustomerService&Support31附录AutomationandDrivesA&DCustomerService&Support32附录AutomationandDrivesA&DCustomerService&Support33附录AutomationandDrivesA&DCustomerService&Support34CustomerSupport
本文标题:西门子传动产品与S7系列PLC通讯入门级学习教程
链接地址:https://www.777doc.com/doc-4508470 .html