博图-SCLPPT课件_第1页
博图-SCLPPT课件_第2页
博图-SCLPPT课件_第3页
博图-SCLPPT课件_第4页
博图-SCLPPT课件_第5页
已阅读5页,还剩109页未读 继续免费阅读

下载本文档

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

文档简介

1、TIA Portal V11 SP2,SCL in STEP 7 V11 SP2,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,TIA Portal V11 SP2,TIA Portal V11 SP2,Exercises,Source files,Compiling/testing,Further models for addressing,

2、Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2Introduction,Valid for S7-300, S7-400 ,WinAC and S7-1200,Function available,Function available with restrictions,Function not available,S7-1200,S7-1200,Valid for S7-300, S7-400 and WinAC,S7-1200,Valid

3、 for S7-1200,Description of used symbols,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,What is the Totally Integrated Automation portal?,The Totally Integrated Automation Portal provides the work

4、environment for end-to-end engineering with SIMATIC STEP 7 V11 and SIMATIC WinCC V11. Centralized engineering framework A common user interface concept for all automation tasks with common services(e.g. configuration, communication, diagnostics) Automatic data and project consistency Powerful librar

5、ies across all automation objects,The customer buys the individual products but he works with the TIA Portal,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,Totally Integrated Automation PortalIntui

6、tive efficient future-proof,End-to-end engineering,Control,Drives,HMI,Networks,Totally Integrated Automation Portal Usability Interoperability ,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in

7、 STEP 7 V11 SP2Usage of SCL: IF data_operation THEN SCL,Example: Storage of Real-values in an array,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Usage of SCL: IF data_operat

8、ion THEN SCL,S7-1200,S7-1200,Code in STL for S7-300/400,Code in LAD for S7-1200,Solution in SCL for S7-300/400 AND S7-1200 (with SP2),Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,TIA Portal V11 S

9、P2,TIA Portal V11 SP2,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2Add a new block,Add a new block,Programming language,Block name,Exercises,Source files,Compiling/testing,Fu

10、rther models for addressing,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2Programming with SCL,Advantages: Handling of SCL block is same like LAD/FBD/STL (No Source* any more)! The blocks are compiled in the right order automatically (Neither Mak

11、e-File* nor organization of the compile order is necessary)!,* In contrast to S7-SCL V5.x,SCL are compiled in the right order automatically, like LAD/FBD/STL!,One SCL Source“ is dealed as one block from creating onwards!,Editor: Favorites bar for frequently usedinstructions Easy to use drag Example:

12、 switch_on := manual_on OR auto_on; All assignments, control operations and calls are ended by ;,S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data

13、Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2Direct addressing,Direct Addressing : symbolic and absolute!,S7-1200,SCL in STEP 7 V11 SP2 SP2 Direct addressing- Slice Zugriffe,BYTE,WORD,DWORD,ANY_Bit Operands in blocks and I/Q/M,My_DW_Variable“,My_W_Variable“,My_B_Variable“,Slice“ access:

14、 Definition not necessary high program efficiency,Bit-wise,Byte-wise,Word-wise,Operand names are only an example,My_W_Variable.X0“,My_DW_Variable.B1“,Examples:,S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect ad

15、dressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2Direct addressing,In the SCL-Editor, inputs, outputs and Bit memory are always Symbolic,: Tags symbols and addresses in table form,S7-1200,Exercises,Source files,Compiling/testing

16、,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2Indirect addressing,Indirect addressing, with symbolic address access of Arrays,Example

17、:,Syntax: “. Index,S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2Indirect addressing-

18、 (S7-300/S7-400),Indirect addressing with absolut address access , as well for I/Q/M as for data blocks!,SCL supports Indirect Addressing of: Global Operands Operands within data blocks Data blocks (number of DB),S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Type con

19、version,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,Example: Value False“,SCL in STEP 7 V11 SP2 Indirect addressing,Accessing addresses via pointers Read with PEEK,Value,Pointer,E / A / M / DB,Exampl

20、e: Pointer of the address M0.0,The pointer includes following information: Area: Inputs Outputs Memory bits Standard DBs (compatible with S7-300/400) DB Number Offset,S7-1200,SCL in STEP 7 V11 SP2 Indirect addressing- S7-1200,Indirect addressing, with PEEK,Area,Pointer,Target-Variable,S7-1200,Exerci

21、ses,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Indirect addressing,Accessing addresses via pointers

22、 Write with POKE,Pointer,E / A / M / DB,Example: Pointer on the address M0.0,The pointer includes following information: Area: Inputs Outputs Memory bits Standard DBs (compatibel wiht S7-300/400) DB Number Offset,Value,Example: value False“,S7-1200,SCL in STEP 7 V11 SP2 Indirect addressing- S7-1200,

23、Indirect addressing, with POKE,Src_area,Dst_Offset,S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in ST

24、EP 7 V11 SP2 Control operations Overview,Control operations can be programmed easily using the code snippet!,S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language descr

25、iption,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Program Branching - Syntax,IF Condition1 THEN Statements 1; ELSIF Condition 2 then Statements 2; ELSE Statement s; END_IF; Condition is of type Bool,IF Statement:,Example of use,STL,SCL,Exercises,Source files,Compiling/testing,Fu

26、rther models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Program Branching - Syntax,CASE Selection OF Const1: Statements 1; . Constn: Statements n

27、; ELSE Statements 3; END_CASE; Selection is of type INT,CASE Statement:,Example of use,STL,SCL,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL

28、in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Program Branching - Syntax,For START_VAR TO END_VAR BY STEP_WIDTH DO Statements; END_FOR; START_VAR, END_VAR und STEP_WIDTH must be of type INT or DINT,FOR Statement:,WHILE Condition DO Statements;. END_WHILE; Condition is of type BOOL,WHILE Statement

29、:,REPEAT Statement:,REPEAT Statements; UNTIL Condition; END_REPEAT; Condition is of type BOOL,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL i

30、n TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Program loop - Example,Example of use,STL,SCL,With SCL: Symbolic Programming possible,OR,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Oper

31、ators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Loop abort - Syntax,For i:= a To c DO IF condition THEN CONTINUE; END_IF; further Statements END_FOR; After Continue, the control variable is incremented by the specified increment immediately.,CONTINUE :,For

32、i:= a To c DO IF condition THEN EXIT; END_IF; END_FOR; Execution of the program is continued after the end of the loop (FOR Loop).,EXIT :,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Ope

33、rators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Block abort - Syntax,IF condition THEN Return; ELSE statement1; END_IF; RETURN exits the currently active block (OB, FB, FC) and returns to the calling block,Return :,IF condition THEN GOTO LABEL;END_IF ; . L

34、ABEL: INDEX := 1 ; GOTO causes an immediate jump to the specified label and therefore to a different statement within the same block.,GOTO :,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,

35、Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Calling blocks,Input parameters are with := and output parameters with = typified.,FC without a return value,FC with a return value,S7-1200,Exercises,Source files,Compiling/testing,Further models for addre

36、ssing,Type conversion,Calling blocks,Control operations,Indirect addressing,Direct addressing,Operators,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Calling blocks,Input parameters are with := and output parameters with = typified.,Calling FB as a single-insta

37、nce,Calling FB as a Multi-instance,S7-1200,Programming with SCL in STEP 7 V11 SP2,Live Demo Create a Function in SCL Insert an IF Statement Create a Function block in SCL Call the Function in the Function block,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,La

38、nguage description,Data Types,SCL in TIA Portal,Introduction,TIA Portal V11 SP2,TIA Portal V11 SP2,Exercises,Source files,Compiling/testing,Further models for addressing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,Implicit data type conversion:Pro

39、cessing of operands of different data types,Automatic conversion of data types,Automatic conversion of data types to match the biggest one No explicit conversion necessary,DInt,Int,SInt,LReal,S7-1200,Example:,Implicit data type conversion:Processing of operands of different data types (e.g. INT * RE

40、AL),FBD (for S7 - 300 / S7-400),SCL,Thanks to the implicit data type conversion programming stays easy and consistent!,In LAD/FBD/STL for S7-300 / S7-400 the data type conversion must be programmed explicitly. In LAD/FBD for S7-1200 the implicit data type conversion is supported similar to SCL.,In S

41、CL the implicit data type conversion is supported for all controllers (S7-1200 / S7-300 / S7-400).,S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 Imp

42、licit data type conversion (S7-300/S7-400),S7-1200,Binary Data types,The implicit conversion is only for elementary data types possible!,Exercises,Source files,Compiling/testing,Further models for addressing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduc

43、tion,SCL in STEP 7 V11 SP2 Implicit conversion (S7-300/S7-400),S7-1200,Numeric Data types,Character,Exercises,Source files,Compiling/testing,Further models for addressing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 implicit c

44、onversion (S7-300/S7-400),S7-1200,Time Data type,Exercises,Source files,Compiling/testing,Further models for addressing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 implicit conversion (S7-1200),Binary Data types,S7-1200,Impli

45、cit conversion also for S7-1200,Exercises,Source files,Compiling/testing,Further models for addressing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 implicit conversion (S7-1200),Numeric Data types,S7-1200,Exercises,Source file

46、s,Compiling/testing,Further models for addressing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 implicit conversion (S7-1200),Numeric Data types,S7-1200,Character,Exercises,Source files,Compiling/testing,Further models for addr

47、essing,Explicit,Implicit,Type conversion,Language description,Data Types,SCL in TIA Portal,Introduction,SCL in STEP 7 V11 SP2 implicit conversion (S7-1200),Time Data type,S7-1200,Explicit data type conversion:Processing of operands of different data types (e.g. Char - INT),FBD (for S7 - 300 / S7-400

48、),SCL,SCL is also offering instructions for the explicit data type conversion (especially for String and Character types). With those instructions code keeps more independent of the used controller type.,Exercises,Source files,Compiling/testing,Further models for addressing,Type conversion,Language

49、description,Data Types,SCL in TIA Portal,Introduction,TIA Portal V11 SP2,TIA Portal V11 SP2,For each task the appropriate programming language,Re-usable program code,Only,AT construct (Typecasting),Different machine code,Better machine code,100% compatible,100% compatible,compatible to STEP 7 V5.5?,

50、Only,Only,Slice“ Access (_Word.x1),Indirect Addressing (_arrayi),STEP 7 V11,Controller Programming language,Sequential Function Chart (S7-GRAPH),Structured Text (S7-SCL),*,Statement list (STL),Only,Ladder logic (LAD), function block diagram (FBD),S7-300/400WinAC,Investment protection,S7-300/400WinAC

51、,S7-1200,* For _arrayi“ in STL pointers have to be used (S7-300/400),S7-1200,S7-1200,S7-1200,S7-1200,OnlySlice“ - Access: Symbolic Bit-, Byte-, Word-wise access to greater ANY_Bit operands,BYTE,WORD,DWORD,S7-1200,ANY_Bit Operands in blocks and I/Q/M,My_DW_Variable“,My_W_Variable“,My_B_Variable“,Slic

52、e“ access: Definition not necessary high program efficiency,Bit-wise,Byte-wise,Word-wise,Operand names are only an example,My_W_Variable.X0“,My_DW_Variable.B1“,Examples:,S7-1200,A data view (type casting) Symbolic access to parts of any operands,Operands of any (even complex) data types in FC/FB,The

53、 data view: Must be defined manually Any structure possible High flexibility,My_Sight.Bit_Field0“,My_Sight.Mid_Byte“,SCL offers with a data view a comfortable possibility, to address parts of any operands symbolically.,Require-ment:,A Variable of any data type is in the interface of a block defined

54、Only a part of this variable should be accessed The access should be symbolically.,Here: Example with a structure My_Sight.,Solution:,Thanks to the data view a symbolic template can be superimposed on the variable The data view does not occupy any memory resources.,Here: Example with a DWORD-Variabl

55、e,S7-1200,A data view (type casting) with the AT construct Symbolic access to parts of any operands,Bit0,Bit6,.,Bit7,BoolSicht.Bit0,BoolSicht.Bit1,BoolSicht.Bit7,BoolSicht.Bit0,Example: Set Bit 1 of variable MainByte to true :,Bit1,The data view does not appear in the parameter set when calling the

56、block,A data view with the AT construct Definition in the declaration table of FCs / FBs Must be in the next line to the affected variable Not longer then the operand S7-1200: Also possible in LAD/FBD, but only in blocks created with standard access.,.,S7-1200,A data view (type casting) with the AT

57、construct Symbolic access to parts of any operands,max. length=254,char 1,char 2,.,char 254,AT_FiWo.maxlength,AT_FiWo.currlength,AT_FiWo.letter1,AT_FiWo.letter2,AT_FiWo.letter254,.,Example: Current length of the string: FirstWord initialized with 0 :,curr.length,The data view does not appear in the

58、parameter set when calling the block,A data view with the AT construct Definition in the declaration table of FCs / FBs Must be in the next line to the affected variable Not longer then the operand S7-1200: Also possible in LAD/FBD, but only in blocks created with standard access.,S7-1200,A data vie

59、w (type casting) with the AT construct Symbolic access to parts of any operands,Example: Read out only Month, only Day or only Year from the DateAndTime_Var,AT variable,The overlaid variable,Data type of the AT view,AT view occupies no memory resources,S7-1200,Exercises,Source files,Compiling/testing,Further m

温馨提示

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

评论

0/150

提交评论