S7-300-400联机调试使用说明

合集下载

西门子s7300的pid实例西门子S7_300_400PID模块参数说明和使用方法

西门子s7300的pid实例西门子S7_300_400PID模块参数说明和使用方法

西门子s7300的pid实例西门子S7_300_400PID模块参数说明和使用方法导读:就爱阅读网友为您分享以下“西门子S7_300_400PID模块参数说明和使用方法”资讯,希望对您有所帮助,感谢您对的支持!Machinery&Equipment机械与装备西门子S7-300/400PID模块参数说明和使用方法汤顺斌(KHS广东轻工机械二厂有限公司,广东汕头515061)摘要:国内的啤酒、饮料包装行业大量应用西门子S7-300/400PLC作为主控系统。

在这些行业中,用户经常要对温度、压力、流量、等模拟量做PID处理。

就S7-300/400PLC 的PID模块的参数说明和使用方法与各位交流。

关键词:PID;模块参数中图分类号:TS7203文献标识码:CPID是英文比例、积分、微分各取第一个字母P_SEL:BOOL:比例选择位:该位ON时,选择P的缩写,PID控制器是应用最广泛的闭环控制器,(比例)控制有效;一般选择有效;据估计90%的闭环控制采用PID算法。

I_SEL:BOOL:积分选择位;该位ON时,选择FB41称为连续控制的PID用于控制连续变化(I积分)控制有效;一般选择有效;的模拟量,与FB42的差别在于后者是离散型的,INT_HOLDBOOL:积分保持,不去设置它;用于控制开关量,其他二者的使用方法和许多参I_ITL_ONBOOL:积分初值有效,I-ITLV AL(积数都相同或相似。

分初值)变量和这个位对应,当此位ON时,则使用PID的初始化可以通过在OB100中调用一次,I-ITLVAL 变量积分初值。

一般当发现PID功能的将参数COM-RST 置位,当然也可在别的地方初始积分值增长比较慢或系统反应不够时可以考虑使化它,关键的是要控制COM-RST。

用积分初值;PID的调用可以在OB35中完成,一般设置时D_SEL:BOOL:微分选择位,该位ON时,选择间为200MS,一定要结合STEP7V5.3帮助文档中D(微分)控制有效;一般的控制系统不用;的PID框图研究以下的参数,可以起到事半功倍CYCLE:TIME:PID采样周期,一般设为200MS;的效果。

西门子S7-300_400PLC的PID调节功能模块的详细说明

西门子S7-300_400PLC的PID调节功能模块的详细说明

Group Topic1Simple PID Controllers for the S7-300/400OverviewThis programming example shows a method for programming a Proportional Integral Derivative (PID) controller on a S7 PLC. The example is already a fully functioning program, needing only for the user to tie the actual inputs and outputs to appropriate variables to be a working controller. This program is suitable for simple PID applications.For complex PID applications, Siemens offers the SIMATIC S7 Standard Control software package, which offers numerous features that this applications tip lacks. These features include alarming, scaling, deadband control, feed-forward control, range limiting, ramp/soak steps, and an integrated scheduler. The Standard Control package includes a Windows-based configuration tool that greatly simplifies configuring and tuning a PID loop.To prepare a user to make these programming changes, the text will explain the basics of the PID controller implemented in the sample code. Below is a brief outline for the rest of this document:1.What does the example program do?2.Where do you use a PID controller?3.Auto Mode vs. Manual Mode4.What does a PID controller do, and how?5.What are the Sample, Gain, Rate, and Reset?6.How is the Error figured?7.How is the Proportional term figured?8.How is the Integral term figured?9.How is the Derivative term figured?10.What if the final Output is too high?11.What should the user add to make the program work for his system?12.Adjusting the Reset, Rate, Gain, Sample time and Mode during run-timePID ExploredWhat does the example program do?示例程序的用途?This programming example is a skeleton program for a true PID controller and, as such, requires that the user make a few additions (i.e. read/write input/output variables) before it is fully functional. Before discussing these, however, let’s get a better feel for what a PID program actually does through a brief example.When do you use a PID controller?Figure 2.1 shows a picture of an example system to which a user might connect a PID controller. The figure shows a water tank sitting atop a hot plate, with a temperature control device for the hot plate and a small, monitored turbine for measuring the rate of the steam flow. This is a system that will work with a PID controller because of the relationship between the two variables: You can directly control the steam flow rate by adjusting the temperature of the hot plate. Figure 2.2 shows how both variables relate to the PID controller.The variable which represents the state of the system being controlled is called the ‘Process Variable.’ In our example above, you can see that the rate at which the steam spins the turbine is a good indicator of the event that we are trying to control: the speed at which the water is being boiled off. The output is the variable which, being altered by the controller, can affect the process variable by different degrees based on its intensity -- By turning the hot plate up, the water boils more quickly, more steam is produced, and the turbine’s speed increases. Therefore, when a variable that accurately reflects the state of the process and an adjustable control which proportionally affects the process variable, then it is possible to use a PID controller. Common systems using PID controllers are air conditioning systems, solution mixing, heaters, etc.Auto Mode vs. Manual Mode自动模式和手动模式There are two settings available on our PID controller. Putting a controller in Manual mode causes the PID loop do nothing, so that the user can directly control the output. The second, Auto, is the mode in which the PID loop is actually controlling the system. For the rest of this text, it will be assumed that the controller is in Auto mode.What does the PID controller do, and how does it do it? PID控制器作些什么?如何去做?Quite simply, a PID controller adjusts the value of its output to try and balance the value of the process variable to a given ‘setpoint.’To calculate the output value for a given instance, the controller finds the value of three different terms (using its user defined Sample time, Gain, Rate, and Reset values along with the calculated Error value): a Proportional term, an Integral term, and a Derivative term.Output = M P + M I + M DFormula 2.1What are the Sample, Gain, Rate, and Reset, and where do they come from?The sample rate is the cycle time (in milliseconds) at which the PID loop recalculates the output. The gain controls the sensitivity of the output calculation by affecting the influence of all the terms. The reset is a time given in milliseconds which is used to increase or decrease the influence of the Integral term in the equation. Finally, the rate value is used to control the influence of the Derivative term in the equation. Each of these values needs to be preset by the user before the PID controller starts.If the user does not want integral action (no I in the PID calculation), then a value of infinity or a value of 0 should be specified for the integral time. If the user does not want derivative action (no D in the PID calculation), then a value of 0 should be specified for the derivative time. If the user does not want proportional action (no P in the PID), then a value of 0 should be specified for the gain (gain is normally a multiplier in the integral and derivative coefficient calculation, but is removed from the coefficient calculation, if gain = 0, to allow I, ID, or D loop control).How is the Error figured? 误差是如何计算的?Error is figured as the difference between the normalized values of the setpoint and the process variable. The controller calculates this value in three steps. The first two steps are to change both the setpoint and the process variable into values that are based on a 0 to 1 (normalized) scale. This is done using the formulae:SP = raw_SP / max_valPV = raw_PV / max_valFormulae 2.2 & 2.3In the above formulae, the raw_SP and raw_PV values are the actual values that come into the controller, and the max_val term is the maximum value that either can take on. For example, ifthe values of raw_SP and raw_PV were being read in as values from 0 to 27,648, then the max_val term would have the value 27,648.After these two values have been calculated, the error term is figured as follows:Error = SP - PVFormula 2.4How is the Proportional term calculated?The proportional term, M P, is calculated using the following equation:M P = Gain * ErrorFormula 2.2Going back to our earlier example with the water tank, the proportional term says that as the speed of the turbine increases further above the setpoint, the heat is decreased proportionally to bring the speed down. As the turbine slows below the setpoint, the heat is increased to proportionally to bring the speed up.How is the Integral Term calculated? 积分项如何计算?The integral term, M I, is calculated using the following equation:M I = Bias + (C I * Error)Formula 2.3In this equation, two new terms are introduced. The first, C I, is the coefficient系数 of the Integral term, and is calculated from the Reset:C I = Gain * (Sample / Reset)Formula 2.4Both the Sample and Reset terms were introduced earlier, but in this equation their uses become apparent. The larger the Reset value is, the less impact the integral term will have onthe output, while larger Sample times give it a bigger influence (Sample time also affects the Derivative term, which will be explained later).The Bias term in Formula 2.3 represents (technically speaking) the area under the curve of a graph plotting the Error vs. time.Abstractly, however, the Bias value (ideally) grows to an output level that keeps the system stable, letting the Proportional and Derivative terms handle any small fluctuations. In relation to our water tank example from earlier, this means that eventually the Bias portion of M I would be the only significant contribution to the final output value, and the M P and M D terms would only be active (non-zero) when a fluctuation occurred.At a time n the equations for M I and the Bias term are:M I,n = Bias n-1 + (C I * Error)Bias n = M I,nFormula 2.5How is the Derivative term calculated?微分项如何计算?The derivative formula for a given time n is calculated with the following equation:M D = C D * (PV n-1 - PV n)Formula 2.6This formula only introduces 1 new term, C D, which is calculated using Formula 2.7.C D = Gain * (Rate / Sample)Formula 2.7The Sample term (which is also used in figuring C I) is the sample time from earlier. In the Derivative term, the Sample time is indirectly proportional to the derivative component, while the Rate is directly proportional.What if the final output value is too high?如果最终输出值太高怎么办?During many processes (such as the water tank example earlier), the Process variable doesn’t respond immediately to a change in the value of the output -- if the water in the tank were ice cold, then even an output of 100% is not going to cause an instantaneous increase in steam flow. Likewise, setting the output to 0% when the water is boiling doesn’t provide an immediate reduction in steam production.Because of this ‘system inertia,’ the output value for a give time could take on a value greater than 100% or less than 0%. In response to this, the PID program implements Output Clamping. If the output is greater than 100%, then it is clamped to 100%. If the output falls lower than 0%, then it is held to 0%.The only problem left to solve lies with the Bias portion of the Integral term. When the output for a system remains at 100% for a long period of time (such as when heating up cold water in our tank from earlier), the integral sum (which the Bias term represents) can grow to extremely large values. This means that when the variable starts responding, the Bias term will be keeping the calculated output well over 100% until it can be wound down. This generally results in the output swinging wildly from one limit to the other, but can be avoided using Bias Clamping. There are a few different types of Bias Clamping, but the only pertinent one here is the one used in the program. There are two different conditions which cause Bias clamping to occur and two formulae as well:If Output > 1Bias = 1 - (M P + M D)Formula 2.8If Output < 0Bias = -(M P + M D)Formula 2.9As the formulae show, when the Output grows to be greater than 1, the value of the Bias is adjusted so that the sum of M P, M D, and the Bias will be 1. Likewise, when the Output slips below 0, the value of the Bias is adjusted so that the above sum will be 0. The adjusted Bias value is then clamped such that its maximum value is 1 and its minimum value is 0.What should be added to make the program work for the system?1. Read in the Process Variable2. Write the Output3. Set the Setpoint4. Adjust the scale for the Input and Setpoint5. Adjust the scale for the Output6. Adjust the Reset, Rate, Gain, and Sample time values.Read in the Process VariableThe Process variable (the variable which accurately reflects the state of the system to be controlled) should be passed to the PV parameter of the function block.Write the OutputThe OUT parameter of the PID loop should be set to the analog output being controlled in the PID function block call.Set the SetpointThe user’s code must pass the Setpoint value to the PID function block via the SP parameter.Adjust the scale for the Process Variable and Setpoint 调整过程值和设定点值。

S7-300使用方法说明

S7-300使用方法说明

S7-300 系列PLC组态简介一、系统构成西门子S7-300系列的常用组件主要有电源模块(1)、CPU模块(1)、开关量模块(2)、开关量输出模块(2)、模拟量输入模块(2)、模拟量输出模块。

说明如下:1.电源模块:PS307—5A;为PLC系统提供稳定的24V直流电源。

2.CPU模块:CPU314;是系统的核心负责程序的运行,数据的存储与处理,与上位机的通讯和数据的传输。

3.开关量输入模块:SM321;可进行32路开关量的检测,输入信号为24V有效,若输入为无源触点,可利用电源模块提供24V驱动信号。

4.开关量输出模块:SM322;可提供8路开关量输出,为继电器输出方式;分为4组每两路公用一个公共端。

5.模拟量输入模块:SM331;为实现对8路模拟量数据采集,输入信号可以是电流信号、电压信号、热电偶输入、热电阻输入,可根据不同的应用场合对模块进行设置。

6.模拟量输出模块:SM332;可提供4路模拟量输出信号,根据应用可将各路输出设置为电压输出或电流输出。

图1、系统模块组成。

二、硬件组态1.基本机架(中心机架)机架即是用于安装固定各个模块的专用槽架。

PLC的各个模块就遵循一定的规则固定在上面。

每个机架中:插槽1为电源模板插槽;插槽2为CPU模板插槽;插槽3留给通讯模板接口模板及扩展模板。

插槽4以后留给应用模板。

每个模块最多可以安装8个应用模块。

模块的底部通过总线连接器与前后的模块想连接,构成一个整体系统。

中心机架至少应装配电源模块和CPU模块,再根据需要配置其他功能模块。

说明:所谓插槽,在这里只是抽象的概念,S7—300系统中的机架物理形态上只是一个槽形轨道,上面没有具体的插槽,模块也只是按一定顺序固定在上面,模块之间也无须保留空间,而是紧密地相邻安装。

插槽的概念只有在对系统进行软件组态时才能具体化。

(软件组态将在后面介绍)2.机架的扩展当基本机架不能满足系统要求时,可通过扩展机架对系统进行扩展,扩展方式有两种:①、用IM365模板:可扩展一个机架,需用两块IM365模板,连接长度最长为一米。

S7-300-400联机调试使用说明

S7-300-400联机调试使用说明

最小安 装
改变安 装的路


定义STEP7 V5.2安装路径
指明安 装路径
点击 OK

选择安装帮助文档的内容
一般默认值为英 语,不用可将其
左端小沟去掉
可选的 语言有 如图的 几种, 选择其 中一种 或几种 打勾
选择下一步 进入下一步
安装

选中要添加的从站设备,双击就可添加入网络中。
双击鼠标弹 出网络配置
窗体
图标即为 选择
从站 站号
点击OK

配置从站的数据传输方式技术定义
展开从站选 择通讯方式 将要使用的通讯方 式拖到图示位置

若从站设备在设备区没有可通过添加设备的GSD文件 来增加设备,如下面窗体所示:

5. 联机调试 下面我们将主要介绍绍怎样进行与PLC联机,上
下载程序及其联机调试的知识。
要进行与PLC联机可以有几种方法,由于上面提 到的我们采用的为PC Adapter 现在我们将主要从这 个方面介绍:
采用PC Adapter,首先需要将PC Adapter 与 PLC和安装有Step7 的计算机连接起来,由于在PC Adapter 与计算机连接端的接口不能直接到计算机 上,因此我们需要自己制作一根连接电缆,电缆的长 度必须小于15米,且为多芯屏蔽线,线的芯数只要不 小于 7芯即可。
若使用向导我们可点击Next,进入向导使 用。否则可点接击Finish,直接进入程序。

出现向导画面,可按引导选择CPU型号及 其名称,MPI地址
MPI的地 址
可选的 CPU的型

CPU的 名称
点击 Next

此窗体中将显示OB块选择,编程方式及其是否 创建源文件(用于高级编程)

西门子PLC-300-400与WINCC通讯设置

西门子PLC-300-400与WINCC通讯设置

WINCC连接Siemens PLC的常用方式一.WINCC使用CP5611通讯卡通过MPI连接PLC2前提条件21.STEP 7 硬件组态22.安装CP5611通讯板卡33.添加驱动程序和系统参数设置34.设置Set PG/PC Interface35.添加通道与连接设置56.连接测试与通讯诊断6二.WINCC使用CP5611通讯卡通过PROFIBUS连接PLC7前提条件7I.STEP 7 硬件组态82.安装CP5611通讯板卡103.添加驱动程序和设置系统参数104.设置Set PG/PC Interface115.添加通道与连接设置146.连接测试与通讯诊断15三.WINCC使用普通网卡通过TCP/IP连接PLC16前提条件161.STEP7硬件组态162.设置IP地址与通讯检测183.添加驱动程序和设置系统参数194.设置Set PG/PC Interface205.添加通道与连接设置226.连接测试与通讯诊断24四.WINCC使用普通网卡通过Industrial Ethernet连接PLC24前提条件251.STEP7硬件组态262.添加驱动程序和设置系统参数273.设置Set PG/PC Interface284.添加通道与连接设置295.连接测试与通讯诊断31说明:1.文档并未列出所有的WINCC连接Siemens品牌PLC的所有方法,只是列举了一些常用的方法。

2.在各种连接方式中的参数设置可能会略有不同,在此列出的步骤和参数只是一套可以连通的设置方法。

一.WINCC使用CP5611通讯卡通过MPI连接PLC前提条件I〕通过CP5611实现PLC系统与WINCC6.0通讯的前提条件是在安装有WINCC的计算机上安装CP5611通讯板卡。

II〕使用STEP7编程软件能够通过MPI正常连接PLC。

1.STEP 7 硬件组态STEP7设置MPI通讯,具体步骤不在此详述,可参考如以下图1.1示:图1.1注意:1.新建一个MPI网络用来通讯,设置MPI网络的地址和波特率,且记住,在随后的设置中需要匹配。

西门子PLC-300-400与WINCC通讯设置

西门子PLC-300-400与WINCC通讯设置
图2.9
5
添加驱动连接,设置参数。打开WINCC工程在Tag Management-->SIMATIC S7 PROTOCOL SUITE->PROFIBUS,右键单击PROFIBUS,在下拉菜单中,点击New Driver Connection,如图2.10所示,在弹出的Connection properties对话框中点击Properties按钮,弹出Connection parameters-PROFIBUS属性对话框,填入参数,如图2.11所示:
右键单击PROFIBUS,在弹出菜单中点击System Parameter,如图2.4所示,弹出System Parameter- PROFIBUS对话框,选择Unit标签,查看Logic device name(逻辑设备名称)。默认安装后,逻辑设备名为CP_L2_1:,如图2.5所示:
图2.4
图2.5
WINCC连接Siemens PLC的常用方式
说明:
1.文档并未列出所有的WINCC连接Siemens品牌PLC的所有方法,只是列举了一些常用的方法。
2.在各种连接方式中的参数设置可能会略有不同,在此列出的步骤和参数只是一套可以连通的设置方法。
一.
前提条件
I)通过CP5611实现PLC系统与WINCC6.0通讯的前提条件是在安装有WINCC的计算机上安装CP5611通讯板卡。
6
通过WINCC工具中的通道诊断程序WinCC Channel Diagnosis即可测试通讯是否建立。注意:此时PLC必须处于运行状态,老版本的PLC必须处于RUN-P或者RUN状态,WINCC必须激活运行,根据图2.12所示的位置,进入通道诊断工具,检测通讯是否成功建立。如图2.13所示,绿色的“√”表示通讯已经成功建立。

S7-300_400扩展机架的配置与说明

S7-300_400扩展机架的配置与说明

S7-300/400扩展机架的配置与说明SIEMENS A&D CS2004-08-06首先我们建议您访问siemens A&D公司的技术支持网站:www4.ad.siemens.de您可以在该网站的检索窗口中键入 Extend Rack 关键字,获取相关信息:如上图所示,第一步在IE浏览器中输入www4.ad.siemens.de路径,第二步选择English页面,第三步在搜索框中输入您产品或问题的关键字(英文),第四步用鼠标点击Search键;一、S7-300系统扩展基本原理通常一套S7-300 PLC系统有一个主机架,安装有CPU的机架称为主机架,当主机架上的I/O模块(最多8块)上的控制点数不够时,可以再增加1-3个扩展机架,每个扩展机架最多可安装8个I/O模块,装在4到11槽,3个扩展机架最多安装24个I/O模块。

在使用扩展机架时,需要机架(Rack),电源模块(PS),接口模块(IM),连接电缆368,S7-300的模块(信号模块、通讯模块、功能模块等)。

S7-300的安装机架是一种导轨。

你可以使用该导轨,安装S7-300系统的所有模板。

S7-300既可以水平安装,也可以垂直安装。

要注意其允许的环境温度为:垂直安装:0 至 40︒C水平安装:0 至 60︒CCPU和电源必须安装在左侧或底部。

应配合模板的安装宽度选择不同长度导轨,不同模板的宽度可查样本得知,模拟I/O模板和数字I/O模板的宽度一般为40 mm。

你必须保持图中所示的间隙,以提供模板安装空间,确保模板散热良好。

图1-1 间隙使用单机架或多机架是使用一个机架还是使用多个机架,取决于具体情况。

在下面的情况下应该使用单机架: ∙ 结构紧凑、需要节约空间∙ CPU312、312 IFM 、312C 和CPU 313只能用单机架 ∙ 所需处理的信号量少在下面的情况下应该使用多机架:所需处理的信号量大没有足够的插槽如需将S7-300装在几个机架上,则需要接口模板(IM ),接口模板的使命是将S7-300背板总线从一个机架扩展到下一个机架。

S7-300常用操作说明

S7-300常用操作说明

利用STEP7监视输入输出量的方法DP:高速数据传送1、打开PLC软件。

运行STEP7,打开PLC软件,将左侧的文件夹层层展开直到选中Blocks,如下图所示:2、找到VAT块。

在右侧找到V AT_??的块,双击打开。

一般此块排列在所有块的最后面,名称以V AT开头,后跟的下划线后的名称可能不一样,可以不管,如有不止一个,可以任意打开一个。

如下图:3、插入VAT块。

如没有找到此块,可以在自行添加一个,操作如下图,在右侧窗口空白处点击鼠标右键,选择Insert New Object(插入新对象)——Variable Table(变量表)4、选中后将出现如下窗口5、打开VAT块。

点击OK按钮即可生成V A T_1块。

打开V A T块,如下图:6、查找监视点地址。

在Address一列中输入想要监视的地址,如需要监视第一流自动转换开关状态,则察看接口表7、监视数字量输入点。

如上图,察看接口表得知,第一流转换开关的自动档输入点为I0.0,第二流转换开关的自动档输入点为I4.0。

将这两个地址输入到V AT窗口中的Address一栏中,如图:8、判断监视结果。

在第一行中输入I0.0后,回车后,光标自动移到第二行,第三列的Display format自动设为BOOL 类型。

在保证工控机与PLC联接正常的情况下,可以点上图方框所示的Monitor Variable按钮,则情况应如下图所示,窗口的标题栏变为高亮的青色,窗口右下角的RUN状态栏有绿色状态条不断闪动。

下图所示的监视结果,I0.0结果为绿色,true,I0.4结果为灰色,false,表明第一流转换开关处于手动档,第二流转换开关不处于手动档。

9、错误判断。

如在Address栏中输入要监视的量后字变为红色,说明输入有误,例如:10、修改显示格式。

所有的数字量输入输出点的数据类型都是BOOL型,即输入要监视的点后,使用系统给出的默认Display format(显示格式)BOOL就可以了,如要监视模拟量输入点(模拟量输出点无法用VAT 监视),应该将显示格式改为Decimal如下图所示,如需要监视第一流的液位采样输入点,看接口表得知,此点地址为386,则在V AT窗口的Address(地址)一栏中输入PIW386,在Display format 一栏中点右键,选择Decimal:11、监视模拟量输入。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
弹出画面,选择示范程序的安装位置
例程的安 装位置
更改例程的安 装路径
选择下 一步
画面主要用于选择您需安装的示例程序

弹出画面,显示各磁盘的使用情况
显示个磁盘的使 用情况及其安装 程序的磁盘要求

选择安装软件的授权
选择是现 在还是以 后再授权
左键鼠标 选中2号槽
弹出 PROFIBUS
配置窗口
选择站号 最大为125
显示网络
基本信息
选中要使用的配置 CPU,双击鼠网络
标左键(默认) 点击Network
Setting 点击New
配置网络

在设备区中选定用于连接远程机架的模块(可不选)
选中3 号槽
双击选定的 连接模块
点击完成,进入下 面的配置窗口
到此处我 们就已完 成了我们 变成调试 所需的软 件STEP7
下面我们 将需要完 成一些配 置工作

弹出配置窗体
选择没有其 他的内存卡 (默认)
在弹出的菜 单上进行配

选择是否需 要外接打印

点击OK,进 行配置

对应机架的槽号,其中 1,2,3号槽有固定的用 法。1号一般为电源,2号 为CPU,3号为连接远程
模块

在设备区中选定要电源将其拖到机架的1号槽位
左击槽号1, 使其变色为图
示颜色 在设备区中选中电 源模块并双击鼠标 左键或拖动到1号槽

在设备区中选定要CPU将其拖到机架的2号槽位
点击Next
建立程序时 需包含的OB 块及其功能
描述
可选择编程的 方式:语句 表、梯形图、
功能图

为程序命名,完成向导。
完成引导, 进入编程界

为程序 命名

进入编程主界面
点击 Finish
,完成 树

类配置似Windows

的浏览区域



进入下一画面
同意安 装协议
选择下 一步

进入安装登记画面
用户名
用户所属组 织
软件ID号
需要注意的是安装的ID号不在光盘里,而在光盘上

定义STEP7 V5.2安装方式
典型安 装
完全安 装 选择完成 后,点击下 一步

启动程序后将依次出现如下画面:
可预览已 有程序
使用向导
退出向导
退出向导,打 开上次存盘为
程序
我们可使用向导或不用向导直接打开已有程序

菜单栏
点击VIEW弹
点击Window弹 出下
出下来菜单主要
拉菜单,其主要
包括窗体的状态包括点窗击体H布e置lp弹出下

若我们不使用向导,直接建立新程序,将出现 画面为:
将鼠标移动到File上 打开下拉菜单,选 择New命令就可建
立新程序了

弹出窗体,给程序启个名字并指定安装路径
给程序 命名
程序的类型:可 以为单项目,库 项目或多项目
改变安装路 径,可点击
弹出配置窗体
其他为 PCI调 试卡
选中我们常用的调 试用适配器 出现如图所示画 面点击YES 弹出窗口选中OK 选中属性可对连接 端口进行配置
点击安装 (INSTALL)

选择本地连 弹出窗体,进行
接可以设置
通讯参数 配置
有关本调试 PLC的站号 的设置
需要注意的是 我们通常需要 设置通讯的相 关参数
点击点Fil击e,P弹LC出弹下出下点击Option来弹菜帮出单助主文要件包括 拉菜单,其主要
拉菜单,其主要 包括PLC的状态下拉菜单,其主
包括对项目的操 要包括一些选项
作及打开过项目
新建文件
打开文件 上线
存储卡管理
帮助文件
仿真器 选择显示的组件

若点击Preview,将出现下面的画面。
以上介绍的都是我们在平时使用中经常需要用 到的快捷工具,有了这些工具以后我们将可以很快地 实现我们需要的操作。
左边的设备功能块区里集成了西门子公司开发好 的一些功能块,通过这些功能块可以很好的实现我们 需要的特殊功能,而不必自己开发。

预备知识: 对于西门子编程我们需要知道,西门子的程序采
下面我们将介绍工具栏的使用。
新建
重新建立一个新的程序
打开
打开一个已经存在的程序
成组上下线 以成组方示打开上线、下线
保存
保存完成的程序
打印
打印指定的程序
剪切
剪切选定的部分
复制 粘贴
复制选定的部分 粘贴指定的部分
上一步
还原到上一步操作
下一步
还原到下一步操作

编译 下载 注释
双击图标
如图展开西门子项目, 选择Blocks,在右端的工
作区内显示对应功能 块。OB1一般为主程序
块。

点击OB1后,出现下面的窗体
弹出窗体
完成
后点 击OK
பைடு நூலகம்
选择编 程方式

如下窗体即为编程窗口。
功能块区
工具栏
编程区

Browse

右键鼠标,在弹出窗口选择Insert New Object,再在 弹出菜单中选择SIMATIC 300 Station
右键程序名
将鼠标移动 到图示位置
选择图示 300PLC

在弹出的画面中将新增300PLC,我们需点击300站图 标进入硬件组态,须注意的是在西门子编程中需先完 成硬件组态才能进行编程操作。
机架
模块
软件 MPI 输入 版本 地址 地址
输出 地址

下面我们介绍Profibus DP网络的配置方法。首先选中 窗体中的Profibus 网络总线。
选中Profibus总 线,在设备区中 选择要添加的
Profibus从站
所选配置的 帮助

对应数 据类型
对应标 记名描


保存已编辑完成的变量表,则可在程序中直接使用 了。完成变量表编辑。
点击保存快 捷图标即可

4. 程序编制 下面我们将介绍程序的编制过程。
如下图所示我们在编程上可以采用如下图的不同方式

最小安 装
改变安 装的路


定义STEP7 V5.2安装路径
指明安 装路径
点击 OK

选择安装帮助文档的内容
一般默认值为英 语,不用可将其
左端小沟去掉
可选的 语言有 如图的 几种, 选择其 中一种 或几种 打勾
选择下一步 进入下一步
安装


S7-300-400联机调试使用说明


一.软件安装
首先将安装光盘放入到光驱内,将会弹 出现如下画面:
第一步: 选择案装 语言的种 类。一般 默认为英 语
选择案装 的语言
选择下 一步

编译完成的程序 将程序下载到指定的PLC 是否显示有关程序的注释
监控
是否上线监控程序的运行
上一个错误 下一个错误
显示上一个错误 显示下一个错误
预览开关
是否以预览方式查看
详细预览开关 是否已详细预览方式查看
新建程序段 新建一个程序段
长通触点
长闭触点 线圈 功能快

向下连线 向上连线 连线 帮助
新增的设
备在设备 点击Option区菜出单现,
弹出下来菜单选中 Import GSD选项
点击 OPEN, gsd文件将
导入到设
备区中

至此,我们就基本上完成了硬件配置。为了验证我么 的配置是否正确我们需要编译并保存。
编译并保存 完毕
左击鼠标,编译并保存快捷 键。若无错误将会提示无错 误,否则有提示窗体弹出
若使用向导我们可点击Next,进入向导使 用。否则可点接击Finish,直接进入程序。

出现向导画面,可按引导选择CPU型号及 其名称,MPI地址
MPI的地 址
可选的 CPU的型

CPU的 名称
点击 Next

此窗体中将显示OB块选择,编程方式及其是否 创建源文件(用于高级编程)
用机构化的编程方法。将需编辑得程序按照功能块和 数据块的形式进行结构化的分类,如下图:
如图所示OB1调用FB1功能快,FB1调用DB数据快
SFC
FC
OB n
如上图,图中SFC表示系统中自带的功能块,FC表示用户自己开发的功能块,OB为系统 的一些功能块,它们与上面的区别在于他们自己都没有数据区,只有赋值才有实际意义

3. 编辑变量表 如图所示展开右端目录树可看到S7 Program(0)
图示为变量 表图标,双 击图标打开

下面弹出的窗体为变量表编辑窗体
点击,写 入对应变 量的标识
对应变量的 物理地址
对应变量注释
对应变量的 数据类型
写入标 记名
标记名 地址

对于西门子编程我们可以采用的方式有如下的三种:
1. 梯形图编程
2. 语句表编程(西门子的语言)
3. 功能图编程
梯形图
语句表
功能图

有了上面的预备知识之后我们就可以结合自己的工作 情况的要求,采用结构化的方式进行编程,编程完毕 后编译保存。需要注意的是,如果在编程中遇到一些 问题可以通过F1键,使用帮助文件。
选中要添加的从站设备,双击就可添加入网络中。
双击鼠标弹 出网络配置
窗体
图标即为 选择
从站 站号
点击OK

配置从站的数据传输方式技术定义
展开从站选 择通讯方式 将要使用的通讯方 式拖到图示位置

若从站设备在设备区没有可通过添加设备的GSD文件 来增加设备,如下面窗体所示:
相关文档
最新文档