logo资料库

学习S7-SCL语言.pdf

第1页 / 共258页
第2页 / 共258页
第3页 / 共258页
第4页 / 共258页
第5页 / 共258页
第6页 / 共258页
第7页 / 共258页
第8页 / 共258页
资料共258页,剩余部分请下载后查看
1 产品概述
1.1 S7-SCL应用范围
PLC无关性认可
应用范围(Area of application)
1.2 S7-SCL的功能
集成到STEP
开发环境(Development environment)
1.3 S7-SCL提供了哪些功能?
块库(Block libraries)
编程模板(Program templates)
来自高级编程的语言元素(Language elements from high-level programming)
程序通俗易懂(Program easy to understand)
高级语言级的调试(Debugger on high-level language level)
1.4 在版本V5.3 SP1中的新内容
语言的扩充(Language extensions)
在源文件中进行编译器的设置(Compiler settings in the source)
扩充的调试功能(Extended debugging functions)
彩色打印(Color printing)
扩充的查找功能(Extended search function)
在源文本中放置书签(Placing of bookmarks in the source text)
用外语字符集创建S7-SCL程序块(Creation of S7-SCL blocks with foreign-language character set)
2 安装
2.1 自动化许可证管理器
2.1.1 通过自动化许可证管理器使用授权
自动化许可证管理器
许可证
许可证证书(CoL)
许可证密钥
许可证类型
2.1.2 安装自动化许可证管理器
随后安装许可证密钥
2.1.3 处理许可证密钥的指南
2.2 安装
2.2.1安装要求(Installation Requirements)
系统要求(System Requirements)
硬件要求(Hardware Requirements)
2.2.2 S7-SCL的安装(Installation of S7-SCL)
启动安装程序(Starting the Installation Program)
安装许可证(Installing License Keys)
3 设计一个SCL程序
3.1一个针对初次用户的例子——“获取测量值”(Welcome to "Measured Value Acquisition" - A Sample Program for First-Time Users )
你将学到什么?
S7-SCL语言元素的使用
硬件要求(Required Hardware)
调试功能(Debugging Functions)
3.2任务(Task)
概述(Overview)
获取测量值(Acquire Measured Values)
处理测量值(Processing Measured Values)
选择性输出(Selectable Outputs)
3.3结构化S7-SCL程序的设计
块的种类(Block Types)
在S7-SCL源文件中块的约定(Arrangement of Blocks in S7-SCL Source Files)
3.4定义子任务(Defining the Subtasks)
子任务(Subtasks)
选择和指定要用的块类型(Selecting and Assigning the Available Block Types)
3.5定义块间接口(Defining the Interfaces Between Blocks)
概述(Overview)
Cycle OB
求值(Evaluate)
SQRT and Square
3.6定义输入/输出接口
3.7定义源文件中块的顺序
3.8定义符号(Defining Symbols)
3.9SQUARE函数的语句部分(Statement Section of the SQUARE Function)
语句部分(Statement Section)
3.10 建立EVALUATE功能块
3.10 .1EVALUATE的流程图(Flow Chart for EVALUATE)
3.10.2功能块EVALUATE的声明部分
声明部分的结构(Structure of the Declaration Section)
3.10.3EVALUATE功能块的声明语句
编程顺序(Program Sequence)
EVALUATE的语句部分(Statement Section of EVALUATE)
EVALUATE的语句部分(Statement Section of EVALUATE)
3.11 建立ACQUIRE功能块
3.11.1 ACQUIRE的流程图(Flow Chart for ACQUIRE)
3.11.2功能块ACQUIRE的声明部分(Declaration Section of FB ACQUIRE)
声明部分的结构(Structure of the Declaration Section)
静态变量(Static Variables)
初始化变量(Initializing Variables)
3.11.3 功能块ACQUIRE的语句部分(Statement Section of FB ACQUIRE)
语句部分的结构(Structure of the Statement Section)
计算地址(Calculating the Address)
声明部分(Statement Section)
3.12建立组织块CYCLE(Creating the CYCLE Organization Block)
组织块CYCLE的任务(Tasks of the CYCLE OB)
组织块CYCLE的程序代码(Program Code of the CYCLE OB)
数据类型转换(Data Type Conversion)
3.13 测试数据(Test Data)
要求(Requirements)
测试过程(Test Procedure)
附加测试(Additional Test )
4使用S7-SCL
4.1启动S7-SCL软件
从Windows界面启动
从SIMATIC管理器启动(Starting from the SIMATIC Manager)
4.2用户界面(User Interface)
4.3定制用户界面(Customizing the User Interface)
定制编辑器(Customizing the Editor)
更改式样和颜色(Adapting the Style and Color)
工具条、断点条、状态条(Toolbar, Breakpoint Bar, Status Bar)
“错误和警告”窗口("Errors and warnings" window)
4.4创建和管理S7-SCL源文件
4.4.1创建一个新的S7-SCL源文件(Creating a New S7-SCL Source File)
在SIMATIC管理器中S7程序的结构(Structure of an S7 Program in the SIMATIC Manager)
步骤大致如下(Follow the steps outlined below):
4.4.2打开一个S7-SCL源文件(Opening an S7-SCL Source File)
4.4.3关闭一个S7-SCL源文件(Closing an S7-SCL Source File)
4.4.4打开块(Opening Blocks)
4.4.5指定对象属性(Specifying Object Properties)
大致步骤如下(Follow the steps outlined below):
4.4.6用标准编辑器创建SCL源文件(Creating SCL Source Files with a Standard Editor)
4.4.7块保护(Block Protection)
块保护的结果(Result of Block Protection)
使用块保护的规则(Rules for Using Block Protection)
4.5 S7-SCL源文件指南
4.5.1S7-SCL源文件通用规则(General Rules for S7-SCL Source Files)
4.5.2块的次序(Order of the Blocks)
4.5.3使用符号地址(Using Symbolic Addresses)
本地的和共享的符号(Local and Shared Symbols)
4.6编辑S7-SCL源文件
4.6.1取消最后的编辑操作(Undoing the Last Editing Action)
4.6.2恢复编辑操作(Redoing an Editing Action)
4.6.3查找和替换文本对象(Finding and Replacing Text Objects)
4.6.4选择文本对象
4.6.5拷贝文本对象
4.6.6剪切文本对象
4.6.7删除文本对象
4.6.8将光标定位到指定行
定位到特定行号(Positioning in a specific line-number)
定位光标到下一个/前一个书签位置(Positioning on the next/previous bookmark)
定位光标到下一个/前一个程序代码中的出错位置(Positioning on the next/previous error in the program code)
4.6.9按语法调整行缩进(Syntactically Correct Indenting of Lines )
4.6.10设置字体和颜色
4.6.11在源文本中放置书签
合法性(Validity)
插入书签(Inserting bookmarks)
在书签间浏览(Navigating between the bookmarks)
删除书签(Deleting bookmarks)
4.6.12 插入模板
4.6.12.1插入块模板
4.6.12.2插入块调用
4.6.12.3插入注释模板
4.6.12.4插入参数模板
4.6.12.5插入控制结构
4.7 编译S7-SCL程序
4.7.1关于编译应明白什么
4.7.2自定义编译器
在"编译器(Compiler)"卡中的选项(Options in the "Compiler" tab)
在"建立块(Create Block)"卡中的选项(Options in the "Create Block" tab)
4.7.3编译程序
大致步骤如下(Follow the steps outlined below):
4.7.4建立编译控制文件
大致步骤如下(Follow the steps outlined below):
4.7.5编译之后调试程序
4.8保存和打印S7-SCL源文件
4.8.1保存一个S7-SCL源文件
4.8.2自定义页面格式
4.8.3打印一个S7-SCL源文件
大致步骤如下(Follow the steps outlined below):
4.8.4设置打印选项
4.9下载建立好的程序
4.9.1CPU内存复位
大致步骤如下(Follow the steps outlined below):
4.9.2下载用户程序到CPU
要求(Requirements)
过程(Procedure)
4.10测试创建的程序
4.10.1 S7-SCL的调试功能
S7-SCL的调试功能(S7-SCL Debugging Functions)
4.10.2 “监视”调试功能
“监视”调试功能("Monitor" debugging function)
监视范围(Monitoring range)
调试模式(Debugging modes)
4.10.3 调试
单步功能(Single Step Functions):
断点(Breakpoints)
要求(Requirements):
4.10.4 逐步监视
结果
调整监视功能
4.10.4.1定义块的调用环境
调用环境(Call environment)
按如下处理定义调用路径(Proceed as follows to define a call path)
按如下定义数据块
4.10.5用断点逐步调试
4.10.5.1定义断点
4.10.5.2 带断点启动测试
4.10.5.3 用断点停止测试
4.10.5.4 激活、取消和删除断点
4.10.5.5定义断点的调用环境
调用环境(Call environment)
按如下处理来定义调用路径(Proceed as follows to define a call path)
按如下处理定义一个数据块(Proceed as follows to define a data block)
4.10.5.6 用单步模式调试
4.10.6 使用STEP7测试/调试功能
4.10.6.1建立和显示参考数据
能够显示下列参考数据(You can display the following reference data):
建立参考数据(Creating reference data)
4.10.6.2监视和修改变量
4.10.6.3 检查块的一致性
必要条件(Prerequisites)
操作如下(Proceed as follows):
结果(Result)
4.11 显示和修改CPU特性
4.11.1 显示和修改CPU操作模式
4.11.2 显示和设置CPU的日期和时间
4.11.3 读出CPU数据
4.11.4 读出CPU诊断缓冲区
4.11.5 显示/比较CPU的用户内存
4.11.6 显示CPU的循环时间
4.11.7 显示CPU的时间系统
4.11.8 显示在CPU中的块
4.11.9 显示CPU有关通讯的信息(Displaying Information about Communication with the CPU)
4.11.10 显示CPU的堆栈(Displaying the Stacks of the CPU)
5 S7-SCL基本术语
5.1 解释句法图(Interpreting the Syntax Diagrams)
何谓句法图(What is a Syntax Diagram)?
有些什么类型的盒子(What Types of Boxes Are There)?
灵活的格式意味着什么(What Does Flexible Format Mean)?
词法规则(Lexical Rule)
句法规则(Syntax Rule)
5.2 字符集(Character Set)
字母和数字字符(Letters and Numeric Characters)
其他字符(Other Characters)
5.3 保留字(Reserved Words)
在SCL中的关键字(Keywords in SCL)
5.4 标识符(Identifiers)
定义(Definition)
例子(Examples)
5.5 标准标识符(Standard Identifiers)
5.6 块标识符(Block Identifiers)
定义(Definition)
规则(Rules)
例子(Example)
5.7 地址标识符(Address Identifiers)
定义(Definition)
例子(Example)
5.8 定时器标识符(Timer Identifiers)
规则(Rules)
5.9 计数器标识符(Counter Identifiers)
规则(Rules)
5.10 数字(Numbers)
整数(Integers)
实数(Real Numbers)
5.11 字符串(Character Strings)
定义(Definition)
规则(Rules)
5.12 符号(Symbol)
句法(Syntax):
5.13 注释部分(Comment Section)
规则(Rules)
句法(Syntax)
例子(Example)
5.14 行注释(Line Comment)
规则(Rules)
句法(Syntax)
例子(Example)
5.15 变量(Variables)
本地数据(Local Data)
共享的用户数据(Shared User Data)
CPU的内存区域(Memory Areas of a CPU)
6 S7-SCL程序结构
6.1 在S7-SCL源文件中的块(Blocks in S7-SCL Source Files)
块类型(Block Types)
预制块(Ready-made Blocks)
6.2 块的次序(Order of the Blocks)
6.3 块的一般结构(General Structure of a Block)
6.4 块的开始和结束(Block Start and End)
块名(Block name)
例子(Example)
6.5 块的属性(Attributes for Blocks)
定义(Definition)
规则(Rules)
例子(Examples)
6.6 块注释(Block Comment)
例子(Example)
6.7 块的系统属性(System Attributes for Blocks)
定义(Definition)
规则(Rules)
例子(Examples)
6.8 声明部分(Declaration Section)
定义(Definition)
结构(Structure)
6.9 参数的系统属性(System Attributes for Parameters)
定义(Definition)
规则(Rules)
例子(Example)
6.10 语句部分(Statement Section)
定义(Definition)
规则(Rules)
例子(Example)
6.11 语句(Statements)
定义(Definition)
规则(Rules)
例子(Example)
6.12 功能块(FB)的结构(Structure of a Function Block (FB))
定义(Definition)
句法(Syntax)
FB标识符(FB Identifier)
FB声明部分(FB Declaration Section)
例子(Example)
6.13函数(FC)的结构(Structure of a Function (FC))
定义(Definition)
句法(Syntax)
函数标识符(FC Identifier)
例子(Example)
数据类型说明(Data Type Specification)
FC的声明部分(FC Declaration Section)
FC的代码部分(FC Code Section)
例子(Example)
6.14 组织块(OB)的结构(tructure of an Organization Block (OB))
定义(Definition)
句法(Syntax)
OB标识符(OB Identifier)
OB的声明部分(OB Declaration Section)
例子(Example)
6.15 用户定义数据类型的结构(Structure of a User-defined Data Type)
UDT标识符(UDT Identifier)
例子(Examples:)
指定数据类型(Specifying the Data Type)
UDT定义的例子(Example of a UDT Definition)
6.16 在S7-SCL源文件中的编译选项(Compiler Options in S7-SCL Source Files)
定义(Definition)
合法性(Validity)
规则(Rules)
可用的选项(Available options)
例子(Example)
附:数据块(DB)的结构(Structure of a Data Block (DB))
定义(Definition)
句法(Syntax)
DB标识符(DB Identifier)
例子(Examples:)
数据块声明部分(DB Declaration Section)
例子(Example)
数据块赋值部分(DB Assignment Section)
例子(Example)
7 数据类型
7.1 在SCL中数据类型概述(Overview of the Data Types in SCL)
基本数据类型(Elementary Data Types)
复杂数据类型(Complex Data Types)
用户定义数据类型(User-Defined Data Types)
参数类型(Parameter Types)
ANY数据类型(ANY Data Type)
7.2 基本数据类型
7.2.1 位类数据类型(Bit Data Types)
7.2.2 字符类数据类型(Character Types)
7.2.3 数字类数据类型(Numeric Data Types)
7.2.4 时间类数据类型(Time Types)
7.3 复杂数据类型
7.3.1 日期时间数据类型(DATE_AND_TIME Data Type)
定义(Definition)
句法(Syntax)
值范围(Value Range)
例子(Example)
7.3.2 字符串数据类型(STRING Data Type)
定义(Definition)
句法(Syntax)
初始化字符串(Initializing Character Strings)
位置对齐(Alignment)
7.3.3 数组数据类型(ARRAY Data Type)
定义(Definition)
句法(Syntax)
索引说明(Index Specification)
数据类型说明(Data Type Specification)
例子(Example)
位置对齐(Alignment)
7.3.4 结构数据类型(STRUCT Data Type)
定义(Definition)
句法(Syntax)
组件声明(Component Declaration)
例子(Example)
位置对齐(Alignment)
7.4 用户定义数据类型(UDT)(User-Defined Data Types)
定义(Definition)
句法(Syntax)
UDT的标识符(UDT Identifier)
数据类型说明(Data Type Specification)
例子(Example)
7.5 参数的数据类型(Data type of Parameters)
7.5.1 定时器和计数器数据类型(TIMER and COUNTER Data Types)
7.5.2 块数据类型(BLOCK Data Types)
7.5.3 指针数据类型(POINTER Data Type)
限制(Restrictions)
例子(Example)
附:参数数据类型举例(Example of Data Types for Parameters)
7.6 ANY数据类型(ANY Data Type)
限制(Restrictions)
7.6.1 ANY数据类型举例(Example of the ANY Data Type)
8 本地变量和块参数的声明
8.1 本地变量和块参数(Local Variables and Block Parameters)
变量有类别(Categories of Variables)
块参数的类别(Categories of Block Parameters)
标志(OK标志)
8.2 变量或参数声明的常规句法(General Syntax of a Variable or Parameter Declaration)
变量或参数声明的句法(Syntax of a Variable or Parameter Declaration)
例子(Examples)
8.3 初始化(Initialization)
句法(Syntax)
例子(Example)
数组的初始化(Array Initialization)
数组初始化的句法(Syntax of Array Initialization)
例子(Examples)
8.4 声明变量范围上的视图(Declaring Views of Variable Ranges)
例子(Example)
规则(Rules)
8.5 使用多重实例(Using Multiple Instances)
8.6 实例声明(Instance Declaration)
句法(Syntax)
例子(Example)
8.7 标志(OK标志)
声明(Declaration)
例子(Example)
8.8 声明子域
8.8.1 声明子域概述(Overview of the Declaration Subsections)
8.8.2 静态变量(Static Variables)
句法(Syntax)
例子(Example)
存取(Access)
8.8.3临时变量(Temporary Variables)
句法(Syntax)
例子(Example)
存取(Access)
8.8.4 块参数(Block Parameters)
句法(Syntax)
例子(Example)
存取(Access)
9 声明常量和标号
9.1 常量(Constants)
9.1.1 为常量声明符号名(Declaring Symbolic Names for Constants)
语法(Syntax)
例子(Example)
9.1.2 常量的数据类型(Data Types for Constants)
类型定义符常量(Type-Defined Constants)
9.1.3 常量标记法(Notation for Constants)
可能的标记法概况(Overview of the Possible Notations)
9.1.3.1 位常量(Bit Constants)
语法(Syntax)
十进制数字串(Decimal Digit String)
二进制、八进制和十六进制值(Binary, Octal and Hexadecimal Values)
例子(Example)
9.1.3.2 整数常量(Integer Constants)
语法(Syntax)
十进制数字串(Decimal Digit String)
例子(Example)
9.1.3.3 实数常量(Real Number Constants)
语法(Syntax)
指数(Exponent)
例子(Examples)
9.1.3.4 字符常量(单字符)(Char Constants (Single Characters))
语法(Syntax)
例子(Example)
字符的语法(Syntax of a Character)
9.1.3.5 串常量(String Constants)
语法(Syntax)
字符的语法(Syntax of a Character)
中断一个串(Interrupting a String)
例子(Examples)
9.1.3.6 日期常量(Date Constants)
语法(Syntax)
例子(Example )
9.1.3.7 时长常量(Time Period Constants)
语法(Syntax)
十进制格式(Decimal Format)
复合格式(Composite format)
例子(Example)
9.1.3.8 日时间常量(Time-of-Day Constants)
语法(Syntax)
指定日时间(Specifying the Time of Day)
例子(Example)
9.1.3.9 日期时间常量(Date and Time Constants)
语法(Syntax)
日期(Date)
日时间(Time of Day)
例子(Example)
9.2 声明标号(Declaring Labels)
语法(Syntax)
例子(Example)
10 共享数据
10.1 共享数据概述(Overview of Shared Data)
存取共享数据(Access to Shared Data)
10.2 CPU的内存区域(Memory Areas of the CPU)
10.2.1 CPU的内存区域概述(Overview of the Memory Areas of the CPU)
存取的语法(Syntax for Access)
10.2.2 CPU内存区域的绝对存取(Absolute Access to Memory Areas of the CPU)
内存前缀(Memory Prefix)
大小前缀(Size Prefix)
地址(Address)
例子(Examples)
10.2.3 CPU内存区域的符号存取(Symbolic Access to Memory Areas of the CPU)
存取(Access)
例子(Example)
10.2.4 CPU内存区域的索引存取(Indexed Access to Memory Areas of the CPU)
绝对标识符的语法(Syntax of the Absolute Identifier)
索引(基数表达式)必须遵循以下规则(The indexing (base expression) must adhere to the following rules)
例子(Example)
10.3 数据块(Data Blocks)
10.3.1 数据块概述(Overview of Data Blocks)
存取(Access)
10.3.2 数据块的绝对存取(Absolute Access to Data Blocks)
语法(Syntax)
大小前缀(Size Prefix)
地址(Address)
例子(Example)
10.3.3 数据块的索引方式存取(Indexed Access to Data Blocks)
语法(Syntax)
例子(Example)
10.3.4 数据块的结构化存取(Structured Access to Data Blocks)
语法(Syntax)
例子(Example)
11 表达式、操作符和地址
11.1 表达式、运算符和地址概述(Overview of Expressions, Operations and Addresses)
11.2 运算符(Operations)
11.3 地址(Addresses)
常量(Constants)
扩展变量(Extended Variable)
11.4 表达式的语法(Syntax of an Expression)
语法(Syntax)
表达式的结果(Result of an Expression )
求值的顺序(Order of Evaluation)
规则(Rules)
表达式的例子(Examples of Expressions)
11.5 简单表达式(Simple Expression)
简单表达式的语法(Syntax of a simple expression)
简单乘法的语法(Syntax of simple multiplication)
例子(Example)
11.6 算术表达式(Arithmetic Expressions)
规则(Rules)
例子(Examples)
11.7 逻辑表达式(Logical Expressions)
基本逻辑运算符(Basic Logic Operations)
逻辑运算符(Logic Operations):
结果(Result):
例子(Examples)
11.8比较表达式(Comparison Expressions)
语法(Syntax)
规则(Rules)
比较表达式的组成(Combining of comparsion expressions)
例子(Examples)
12 语句
12.1 赋值(Value Assignments)
赋值的语法(Syntax of a Value Assignment)
12.1.1 基本数据类型变量的赋值(Value Assignments with Variables of an Elementary Data Type)
例子(Example)
12.1.2 STRUCT和UDT类型变量的赋值(Value Assignments with Variables of the Type STRUCT and UDT)
赋值一个完整结构(Assigning a Complete Structure)
赋值结构元素(Assigning Structure Components)
例子(Example)
12.1.3 ARRAY类型变量的赋值(Value Assignments with Variables of the Type ARRAY)
赋值一个完整数组(Assigning a Complete Array)
数组元素的赋值(Assigning a Component of an Array)
例子(Example)
12.1.4 STRING数据类型变量的赋值(Value Assignments with Variables of the Data Type STRING)
例子(Example)
12.1.5 DATE_AND_TIME类型变量的赋值(Value Assignments with Variables of the Type DATE_AND_TIME)
例子(Example)
12.1.6 内存区域中绝对变量的赋值(Value Assignments with Absolute Variables for Memory Areas)
例子(Example)
12.1.7 共享变量的赋值(Value Assignments with Shared Variables)
DB变量的语法(Syntax of the DB Variable)
例子(Example)
12.2 控制语句
12.2.1 控制语句概述(Overview of Control Statements)
选择语句(Selective Statements)
循环(Loops)
程序跳转(Program Jump)
12.2.2 条件(Conditions)
12.2.3 IF语句(IF Statements)
语法(Syntax)
例子(Example)
12.2.4 CASE语句(CASE Statement)
语法(Syntax)
值表(Value List)
值(Value)
12.2.5 FOR语句(FOR Statement)
语法(Syntax)
规则(Rules)
初始赋值(Initial Assignment)
终止值和增量(Final Value and Increment)
例子(Example)
12.2.6 WHILE语句(WHILE Statement)
语法(Syntax)
例子(Example)
12.3.7 REPEAT语句(REPEAT Statement)
语法(Syntax)
例子(Example)
语法(Syntax)
例子(Example)
12.2.9 EXIT语句(EXIT Statement)
语法(Syntax)
例子(Example)
12.2.10 GOTO语句(GOTO Statement)
语法(Syntax)
例子(Example)
12.2.11 RETURN语句(RETURN Statement)
语法(Syntax)
12.3 功能和功能块的调用
12.3.1 调用和参数传递(Call and Parameter Transfer)
调用功能和功能块(Calling FCs and FBs)
参数传递的基本原理(Basic Principle of Parameter Transfer)
参数传递的语法(Syntax of Parameter Transfer)
12.3.2调用功能块(Calling Function Blocks)
12.3.2.1 调用功能块(FB或SFB)(Calling Function Blocks (FB or SFB))
语法(Syntax)
作共享实例调用(Call as a Shared Instance)
作本地实例调用Call as a Local Instance
12.3.2.2 提供功能块参数(Supplying FB Parameters)
对定义的FB参数赋值的语法(Syntax of a Value Assignment for Defining FB Parameters)
执行块之后的结果(Result after Executing the Block)
例子(Example)
12.3.2.3 输入赋值(FB) Input Assignment (FB)
语法(Syntax)
12.3.2.4 输入/输出赋值(FB) In/Out Assignment (FB)
语法(Syntax)
12.3.2.5 读取输出值(FB调用) Reading Output Values (FB Call)
例子(Example)
12.3.2.6 作为共享实例调用的举例(Example of a Call as a Shared Instance)
功能块(Function Block)
调用(Call)
结果(Result):
读取输出值(Reading an Output Value)
12.3.2.7 作为本地实例调用的举例(Example of a Call as a Local Instance)
调用(Call)
读取输出值(Reading an Output Value)
12.3.3 调用功能(Calling Functions)
12.3.3.1 调用功能(FC) Calling Functions (FC)
语法(Syntax)
12.3.3.2返回值(FC) Return Value (FC)
12.3.3.3 功能的参数(FC Parameters)
语法(Syntax)
规则(Rules)
例子(Example)
12.3.3.4 输入赋值(FC) Input Assignment (FC)
语法(Syntax)
12.3.3.5 输出和输入/输出赋值(FC) Output and In/Out Assignment (FC)
语法(Syntax)
12.3.3.6 功能调用举例(Example of a Function Call)
功能被调用(Function to be Called)
调用块(Calling Block)
12.3.4 隐式定义参数
12.3.4.1 输入参数EN(Input Parameter EN)
例子(Example)
12.3.4.2 输出参数ENO(Output Parameter ENO)
例子(Example)
13 计数器和定时器
13.1 计数器
13.1.1 计数器函数(Counter Functions)
13.1.2调用计数器函数(Calling Counter Functions)
绝对或动态调用(Absolute or Dynamic Call)
例子(Examples)
13.1.3 提供参数给计数器函数(Supplying Parameters for Counter Functions)
规则(Rules)
例子(Example)
13.1.4 计数器值的输入和取得(Input and Evaluation of the Counter Value)
格式(Format)
输入(Input)
求值(Evaluation)
13.1.5 向上计数(S_CU)
13.1.6 向下计数(S_CD)
13.1.7 双向计数(S_CUD)
13.1.8 计数器函数的例子
参数赋值(Parameter Assignment)
例子(Example)
13.2 定时器
13.2.1 定时器函数(Timer Functions)
13.2.2 调用定时器函数(Calling Timer Functions)
绝对和动态调用(Absolute or Dynamic Call)
例子(Examples)
13.2.3 提供参数合定时器函数(Supplying Parameters for Timer Functions)
规则(Rules)
例子(Example)
13.2.4 输入和取得时间值(Input and Evaluation of a Time Value)
格式(Format)
输入(Input)
取值(Evaluation)
13.2.5 脉冲定时器(S_PULSE) Start Timer as Pulse Timer (S_PULSE)
定时器功能怎样(How the Timer Functions)
13.2.6 脉冲扩展定时器(Start Timer as Extended Pulse Timer (S_PEXT))
定时器函数如何工作(How the Timer Functions)
13.2.7 上电延时(闭合)定时器 Start Timer as On-Delay Timer (S_ODT)
定时功能如何工作(How the Timer Functions)
13.2.8 保持型上电延时(闭合)定时器(S_ODTS) Start Timer as Retentive On-Delay Timer (S_ODTS)
定时器函数如何工作(How the Timer Functions)
13.2.9 断电延时(断开)定时器(S_OFFDT) Start Timer as Off-Delay Timer (S_OFFDT)
定时器函数如何工作(How the Timer Functions)
13.2.10 定时器函数的例子 Example of Timer Functions
13.2.11 选择正确的定时器(Selecting the Right Timer)
14 S7-SCL的标准函数
14.1 数据类型转换函数
14.1.1 转换数据类型(Converting Data Types)
14.1.2 隐式数据类型转换(Implicit Data Type Conversion)
隐式数据类型转换的例子(Example of Implicit Data Type Conversion)
14.1.2.1 A类转换函数(Conversion Functions Class A)
14.1.3 显式数据类型转换的标准函数(Standard Functions for Explicit Data Type Conversion)
14.1.3.1 B类转换函数(Conversion Functions Class B)
14.1.3.2 四舍五入和截取函数(Functions for Rounding and Truncating)
例子(Example)
14.1.3.3用标准函数进行转换的例子(Examples of Converting with Standard Functions)
14.2 数字类标准函数
14.2.1 通用标准算术函数(General Arithmetic Standard Functions)
14.2.2 对数函数(Logarithmic Functions)
14.2.3 三角函数(Trigonometric Functions)
14.2.4 数字类标准函数举例(Examples of Numeric Standard Functions)
14.3 标准位串函数(Bit String Standard Functions)
14.3.1 标准位串函数举例(Examples of Bit String Standard Functions)
14.4 串处理函数
14.4.1 串操作函数(Functions for String Manipulation)
LEN
CONCAT
LEFT或RIGHT
MID
INSERT
DELETE
FIND
14.4.2 串比较函数(Functions for Comparing Strings)
EQ_STRNG和NE_STRNG
GE_STRNG and LE_STRNG
GT_STRNG and LT_STRNG
14.4.3 数据格式转换函数(Functions for Converting the Data Format)
INT_TO_STRING和STRING_TO_INT
DINT_TO_STRING和STRING_TO_DINT
REAL_TO_STRING and STRING_TO_REAL
14.4.4 字符串处理举例(Example of Processing Character Strings)
14.5 选值函数(Functions for Selecting Values)
14.5.1 选值函数(Functions for Selecting Values)
SEL
MAX
MIN
IMIT
MUX
14.6 系统函数/功能块和标准库
14.6.1 系统函数/功能块和标准库(System Functions/Function Blocks and the Standard Library)
调用接口(Call Interface (SFC/SFB))
带有条件的调用(Conditional Call (SFB/SFC))
14.6.2 传递到组织块的接口(Transfer Interface to OBs)
组织块(Organization Blocks)
可用的组织块(Available OBs)
附:系统函数/系统功能块举例(Example of SFCs/SFBs)
15 语言描述
15.1 规范化语言描述
15.1.1 语法图概述(Overview of Syntax Diagrams)
什么是句法图(What is a Syntax Diagram)?
有些什么类型的盒子(What Types of Boxes Are There)?
15.1.2 规则(Rules)
组词规则(Lexical Rules)
句法规则(Syntax Rules)
形态(Formal Aspects)
语义(Semantics)
15.1.3 在组词规则中使用的术语(Terms Used in the Lexical Rules)
定义(Definition)
字母和数字字符(Letters and Numeric Characters)
可打印字符和特殊字符(Printable Characters and Special Characters)
15.1.4 格式符、分隔符和运算符(Formatting Characters, Separators and Operations)
在组词规则中使用(Used in the Lexical Rules)
用于常量(For Constants)
在句法规则中(In the Syntax Rules)
运算符(Operations)
15.1.5 关键字和预定义标识符(Keywords and Predefined Identifiers)
15.1.6 地址标识符和块关键字(Address Identifiers and Block Keywords)
共享的系统数据(Shared System Data)
块关键字(Block Keywords)
15.1.7 非术语项概述(Overview of Non Terms)
15.1.8 语言符号概述(Overview of Tokens)
15.1.9 标识符(Identifiers)
标识符(Identifier)
大小写(Upper- and Lowercase)
15.1.10 在S7-SCL中取名(Assigning Names in S7-SCL)
指定可选名称(Assigning Selectable Names)
取名规则(Rules for Assigning Names)
限制(Restrictions)
使用标识符(Using IDENTIFIERS)
块标识符(BLOCK IDENTIFIER)
15.1.11 预定义的常量和标志(Predefined Constants and Flags)
常量(Constants)
标志(Flags)
15.2 组词规则
15.2.1 概述:组词规则(Overview: Lexical Rules)
15.2.2 标识符(Identifiers)
15.2.3 常量(Constants)
15.2.4 绝对地址(Absolute Addressing)
15.2.5 注释(Comments)
15.2.6 块属性(Block Attributes)
15.2.7 编译器选项(Compiler Options)
15.3 语法规则
15.3.1 概述:句法规则(Overview: Syntax Rules)
灵活的格式(Flexible Format)
15.3.2 S7-SCL源文件的结构
15.3.3 声明部分的结构(Structure of the Declaration Sections)
15.3.4 在S7-SCL中的数据类型(Data Types in S7-SCL)
15.3.5 语句部分(Statement Section)
15.3.6赋值(Value Assignments)
15.3.7 调用函数和功能块(Calling Functions and Function Blocks)
15.3.8 控制语句(Control Statements)
16 技巧与秘诀
在数据块中存取结构时的运行时优化代码
分配小型CPU的L堆栈的问题
监视期间实数的输出
管理源文件、接口和代码的时间戳
STEP 7标准函数和系统函数的返回值
重接(Rewiring Blocks)
给结构分配偶数字节长度
FOR语句的限制
术语表
目录 1 产品概述 4 使用S7-SCL 2.1.1 通过自动化许可证管理器使用授权 2.1.2 安装自动化许可证管理器 2.1.3 处理许可证密钥的指南 2.2 安装 2.2.1 安装要求(Installation Requirements) 2.2.2 S7-SCL的安装(Installation of S7-SCL) 3 设计一个SCL程序 1.1 S7-SCL应用范围 1.2 S7-SCL的功能 1.3 S7-SCL提供了哪些功能? 1.4 在版本V5.3 SP1 中的新内容 2 安装 2.1 自动化许可证管理器 ................................................................................................................................................................ 1 ......................................................................................................................................... 1 ............................................................................................................................................. 1 ......................................................................................................................... 2 ..................................................................................................................... 3 ........................................................................................................................................................................ 5 ................................................................................................................................. 5 .............................................................................................. 5 .............................................................................................................. 6 .................................................................................................................. 7 ............................................................................................................................................................. 7 ......................................................................................... 7 ........................................................................................... 7 .................................................................................................................................................. 9 3.1 一个针对初次用户的例子——“获取测量值”(Welcome to "Measured Value Acquisition" - A Sample Program for First-Time Users ) ...................................................................................................................... 9 3.2 任务(Task) ............................................................................................................................................ 10 3.3 结构化S7-SCL程序的设计 ....................................................................................................................... 11 3.4 定义子任务(Defining the Subtasks) ..................................................................................................... 12 3.5 定义块间接口(Defining the Interfaces Between Blocks) .......................................................................... 13 3.6 定义输入/输出接口 ................................................................................................................................... 14 3.7 定义源文件中块的顺序 ............................................................................................................................ 15 3.8 定义符号(Defining Symbols) .................................................................................................................... 16 3.9SQUARE函数的语句部分(Statement Section of the SQUARE Function) ............................................... 16 3.10 建立EVALUATE功能块 ......................................................................................................................... 17 ............................................................................ 17 ....................................................................................................... 18 ........................................................................................................ 18 ........................................................................................................................... 20 .......................................................................... 20 ........................................ 21 ......................................... 22 ....................................................... 24 .......................................................................................................................... 25 ............................................................................................................................................................ 28 .................................................................................................................................... 28 .................................................................................................................. 28 ............................................................................... 29 .................................................................................................................... 30 ............................................ 30 .......................................................... 30 ............................................................ 31 4.1 启动S7-SCL软件 4.2 用户界面(User Interface) 4.3 定制用户界面(Customizing the User Interface) 4.4 创建和管理S7-SCL源文件 3.11.1 ACQUIRE的流程图(Flow Chart for ACQUIRE) 3.11.2 功能块ACQUIRE的声明部分(Declaration Section of FB ACQUIRE) 3.11.3 功能块ACQUIRE的语句部分(Statement Section of FB ACQUIRE) 4.4.1 创建一个新的S7-SCL源文件(Creating a New S7-SCL Source File) 4.4.2 打开一个S7-SCL源文件(Opening an S7-SCL Source File) 4.4.3 关闭一个S7-SCL源文件(Closing an S7-SCL Source File) 3.10 .1EVALUATE的流程图(Flow Chart for EVALUATE) 3.10.2 功能块EVALUATE的声明部分 3.10.3EVALUATE功能块的声明语句 3.12 建立组织块CYCLE(Creating the CYCLE Organization Block) 3.13 测试数据(Test Data) 3.11 建立ACQUIRE功能块 1
4.5 S7-SCL源文件指南 4.6 编辑S7-SCL源文件 4.5.1S7-SCL源文件通用规则(General Rules for S7-SCL Source Files) 4.5.2 块的次序(Order of the Blocks) 4.5.3 使用符号地址(Using Symbolic Addresses) 4.4.4 打开块(Opening Blocks) 4.4.5 指定对象属性(Specifying Object Properties) 4.4.6 用标准编辑器创建SCL源文件(Creating SCL Source Files with a Standard Editor) 4.4.7 块保护(Block Protection) 4.6.1 取消最后的编辑操作(Undoing the Last Editing Action) 4.6.2 恢复编辑操作(Redoing an Editing Action) 4.6.3 查找和替换文本对象(Finding and Replacing Text Objects) 4.6.4 选择文本对象 4.6.5 拷贝文本对象 4.6.6 剪切文本对象 4.6.7 删除文本对象 4.6.8 将光标定位到指定行 4.6.9 按语法调整行缩进(Syntactically Correct Indenting of Lines ) 4.6.10 设置字体和颜色 4.6.11 在源文本中放置书签 4.6.12 插入模板 4.7 编译S7-SCL程序 ............................................................................................................ 31 ........................................................................... 31 .................. 32 .......................................................................................................... 32 ................................................................................................................................... 32 ................................................ 32 .................................................................................................. 33 ............................................................................... 33 ................................................................................................................................... 33 .......................................................... 33 ............................................................................... 33 ..................................................... 33 ................................................................................................................................. 34 ................................................................................................................................. 34 ................................................................................................................................. 34 ................................................................................................................................. 35 ..................................................................................................................... 35 ................................................ 35 ........................................................................................................................... 36 ................................................................................................................... 36 ...................................................................................................................................... 37 ...................................................................................................................................... 38 ..................................................................................................................... 38 ................................................................................................................................. 38 ....................................................................................................................... 41 .................................................................................................................. 41 ............................................................................................................................. 41 .................................................................................................................. 41 ................................................................................................................................. 42 .................................................................................................................................... 42 ................................................................................................................................... 42 ...................................................................................................................... 43 ...................................................................................................................................... 43 ........................................................................................................................ 43 ........................................................................................................................... 44 ............................................................................................................................................. 45 ...................................................................................................................................... 45 ........................................................................................................................... 47 ......................................................................................................... 49 ............................................................................................................................. 51 ........................................................................................................... 51 ................................................................................................... 51 ............................................................................................................................... 51 ................................................................................................................... 52 ......................................................................................................... 52 ................................................................................................................... 52 4.11.1 显示和修改CPU操作模式 4.11.2 显示和设置CPU的日期和时间 4.11.3 读出CPU数据 4.11.4 读出CPU诊断缓冲区 4.11.5 显示/比较CPU的用户内存 4.11.6 显示CPU的循环时间 4.10.1 S7-SCL的调试功能 4.10.2 “监视”调试功能 4.10.3 调试 4.10.4 逐步监视 4.10.5 用断点逐步调试 4.10.6 使用STEP7 测试/调试功能 4.7.1 关于编译应明白什么 4.7.2 自定义编译器 4.8 保存和打印S7-SCL源文件 4.8.1 保存一个S7-SCL源文件 4.8.2 自定义页面格式 4.8.3 打印一个S7-SCL源文件 4.8.4 设置打印选项 4.9 下载建立好的程序 4.9.1CPU内存复位 4.9.2 下载用户程序到CPU 4.10 测试创建的程序 4.11 显示和修改CPU特性 2
6 S7-SCL程序结构 5 S7-SCL基本术语 4.11.7 显示CPU的时间系统 4.11.8 显示在CPU中的块 4.11.9 显示CPU有关通讯的信息(Displaying Information about Communication with the CPU) 4.11.10 显示CPU的堆栈(Displaying the Stacks of the CPU) 5.1 解释句法图(Interpreting the Syntax Diagrams) 5.2 字符集(Character Set) 5.3 保留字(Reserved Words) 5.4 标识符(Identifiers) 5.5 标准标识符(Standard Identifiers) 5.6 块标识符(Block Identifiers) 5.7 地址标识符(Address Identifiers) 5.8 定时器标识符(Timer Identifiers) 5.9 计数器标识符(Counter Identifiers) 5.10 数字(Numbers) 5.11 字符串(Character Strings) 5.12 符号(Symbol) 5.13 注释部分(Comment Section) 5.14 行注释(Line Comment) 5.15 变量(Variables) ................................................................................................................... 52 ....................................................................................................................... 53 .... 53 ............................................................. 53 .................................................................................................................................................... 54 .................................................................................. 54 ......................................................................................................................... 55 ..................................................................................................................... 56 ............................................................................................................................... 57 ....................................................................................................... 57 ..................................................................................................................... 58 .............................................................................................................. 59 ............................................................................................................. 60 ..................................................................................................... 60 .................................................................................................................................. 60 ................................................................................................................. 61 .................................................................................................................................... 62 ............................................................................................................ 62 ..................................................................................................................... 63 .................................................................................................................................. 63 .................................................................................................................................................... 65 ................................................................. 65 ........................................................................................................... 65 ..................................................................................... 66 ............................................................................................... 66 ......................................................................................................... 67 ..................................................................................................................... 69 ..................................................................................... 69 ........................................................................................................... 70 .......................................................................... 71 ............................................................................................................ 71 ................................................................................................................................ 72 .................................................................. 73 ................................................................................. 74 .......................................................... 76 ................................................ 77 ................................. 78 ........................................................................ 79 .............................................................................................................................................................. 82 ........................................................... 82 ........................................................................................................................................... 83 ................................................................................................. 83 ................................................................................................ 83 .................................................................................... 84 .................................................................................................. 84 ........................................................................................................................................... 84 6.1 在S7-SCL源文件中的块(Blocks in S7-SCL Source Files) 6.2 块的次序(Order of the Blocks) 6.3 块的一般结构(General Structure of a Block) 6.4 块的开始和结束(Block Start and End) 6.5 块的属性(Attributes for Blocks) 6.6 块注释(Block Comment) 6.7 块的系统属性(System Attributes for Blocks) 6.8 声明部分(Declaration Section) 6.9 参数的系统属性(System Attributes for Parameters) 6.10 语句部分(Statement Section) 6.11 语句(Statements) 6.12 功能块(FB)的结构(Structure of a Function Block (FB)) 6.13 函数(FC)的结构(Structure of a Function (FC)) 6.14 组织块(OB)的结构(tructure of an Organization Block (OB)) 6.15 用户定义数据类型的结构(Structure of a User-defined Data Type) 6.16 在S7-SCL源文件中的编译选项(Compiler Options in S7-SCL Source Files) 附:数据块(DB)的结构(Structure of a Data Block (DB)) 7 数据类型 7.1 在SCL中数据类型概述(Overview of the Data Types in SCL) 7.2 基本数据类型 7.2.1 位类数据类型(Bit Data Types) 7.2.2 字符类数据类型(Character Types) 7.2.3 数字类数据类型(Numeric Data Types) 7.2.4 时间类数据类型(Time Types) 7.3 复杂数据类型 3
7.6 ANY数据类型(ANY Data Type) 7.6.1 ANY数据类型举例(Example of the ANY Data Type) 8 本地变量和块参数的声明 9 声明常量和标号 9.1 常量(Constants) 7.5.1 定时器和计数器数据类型(TIMER and COUNTER Data Types) 7.5.2 块数据类型(BLOCK Data Types) 7.5.3 指针数据类型(POINTER Data Type) 附:参数数据类型举例(Example of Data Types for Parameters) 7.3.1 日期时间数据类型(DATE_AND_TIME Data Type) 7.3.2 字符串数据类型(STRING Data Type) 7.3.3 数组数据类型(ARRAY Data Type) 7.3.4 结构数据类型(STRUCT Data Type) 7.4 用户定义数据类型(UDT)(User-Defined Data Types) 7.5 参数的数据类型(Data type of Parameters) 8.1 本地变量和块参数(Local Variables and Block Parameters) 8.2 变量或参数声明的常规句法(General Syntax of a Variable or Parameter Declaration) 8.3 初始化(Initialization) 8.4 声明变量范围上的视图(Declaring Views of Variable Ranges) 8.5 使用多重实例(Using Multiple Instances) 8.6 实例声明(Instance Declaration) 8.7 标志(OK标志) 8.8 声明子域 ................................................................... 84 ....................................................................................... 86 ............................................................................................ 87 .......................................................................................... 88 .................................................................. 89 ................................................................................ 91 .................................................. 91 ............................................................................................... 91 ........................................................................................ 92 ..................................................... 93 ......................................................................................................... 93 ................................................................. 94 .................................................................................................................................. 95 .............................................................. 95 .................... 95 .......................................................................................................................... 96 ......................................................... 98 ........................................................................................... 99 .......................................................................................................... 99 ........................................................................................................................................ 100 ................................................................................................................................................. 100 .................................................... 100 ..................................................................................................... 101 .............................................................................................. 102 ...................................................................................................... 103 ................................................................................................................................................ 105 ................................................................................................................................. 105 ............................................. 105 .......................................................................... 106 ..................................................................................... 106 ............................................................................................................. 117 ......................................................................................................................................................... 118 ...................................................................................... 118 ................................................................................. 118 ..................................... 118 ......................... 119 ......................... 120 .......................... 121 ....................................................................................................................... 122 ................................................................................. 122 .......................................................... 122 ................................................... 124 ................................................... 124 .................................................................................................................................. 126 ................... 126 ......................................................................................................................... 126 10.2.1 CPU的内存区域概述(Overview of the Memory Areas of the CPU) 10.2.2 CPU内存区域的绝对存取(Absolute Access to Memory Areas of the CPU) 10.2.3 CPU内存区域的符号存取(Symbolic Access to Memory Areas of the CPU) 10.2.4 CPU内存区域的索引存取(Indexed Access to Memory Areas of the CPU) 10.3.1 数据块概述(Overview of Data Blocks) 10.3.2 数据块的绝对存取(Absolute Access to Data Blocks) 10.3.3 数据块的索引方式存取(Indexed Access to Data Blocks) 10.3.4 数据块的结构化存取(Structured Access to Data Blocks) 8.8.1 声明子域概述(Overview of the Declaration Subsections) 8.8.2 静态变量(Static Variables) 8.8.3 临时变量(Temporary Variables) 8.8.4 块参数(Block Parameters) 9.1.1 为常量声明符号名(Declaring Symbolic Names for Constants) 9.1.2 常量的数据类型(Data Types for Constants) 9.1.3 常量标记法(Notation for Constants) 10.3 数据块(Data Blocks) 9.2 声明标号(Declaring Labels) 10 共享数据 10.1 共享数据概述(Overview of Shared Data) 10.2 CPU的内存区域(Memory Areas of the CPU) 11 表达式、操作符和地址 11.1 表达式、运算符和地址概述(Overview of Expressions, Operations and Addresses) 11.2 运算符(Operations) 4
11.3 地址(Addresses) 11.4 表达式的语法(Syntax of an Expression) 11.5 简单表达式(Simple Expression) 11.6 算术表达式(Arithmetic Expressions) 11.7 逻辑表达式(Logical Expressions) 11.8 比较表达式(Comparison Expressions) 12 语句 12.1 赋值(Value Assignments) ............................................................................................................................... 127 ........................................................................................ 128 ..................................................................................................... 129 .............................................................................................. 130 ................................................................................................... 131 ............................................................................................ 133 .................................................................................................................................................................. 135 ................................................................................................................ 135 12.1.1 基本数据类型变量的赋值(Value Assignments with Variables of an Elementary Data Type) ................................................................................................................................................................ 135 12.1.2 STRUCT和UDT类型变量的赋值(Value Assignments with Variables of the Type STRUCT and UDT) ..................................................................................................................................................... 136 12.1.3 ARRAY类型变量的赋值(Value Assignments with Variables of the Type ARRAY) .................. 137 12.1.4 STRING数据类型变量的赋值(Value Assignments with Variables of the Data Type STRING) ................................................................................................................................................................ 138 12.1.5 DATE_AND_TIME 类 型 变 量 的 赋 值 (Value Assignments with Variables of the Type DATE_AND_TIME) ................................................................................................................................ 139 12.1.6 内存区域中绝对变量的赋值(Value Assignments with Absolute Variables for Memory Areas) ................................................................................................................................................................ 140 .............................................. 141 12.1.7 共享变量的赋值(Value Assignments with Shared Variables) ............................................................................................................................................... 142 ................................................................ 142 .................................................................................................................. 142 ............................................................................................................ 143 ................................................................................................... 144 ...................................................................................................... 145 .............................................................................................. 147 ........................................................................................... 148 ..................................................................................................... 149 .............................................................................................. 150 ....................................................................................... 151 ........................................................................................................................... 151 ........................................................................... 151 .................................................................................... 152 ................................................................................................. 158 ............................................................................................................................ 162 .............................................................................................................................................. 164 ................................................................................................................................................... 164 .......................................................................................... 164 ........................................................................ 164 ............................. 165 ................................ 166 ......................................................................................................................... 167 ......................................................................................................................... 167 ...................................................................................................................... 168 .................................................................................................................... 168 13.1.1 计数器函数(Counter Functions) 13.1.2 调用计数器函数(Calling Counter Functions) 13.1.3 提供参数给计数器函数(Supplying Parameters for Counter Functions) 13.1.4 计数器值的输入和取得(Input and Evaluation of the Counter Value) 13.1.5 向上计数(S_CU) 13.1.6 向下计数(S_CD) 13.1.7 双向计数(S_CUD) 13.1.8 计数器函数的例子 12.2.1 控制语句概述(Overview of Control Statements) 12.2.2 条件(Conditions) 12.2.3 IF语句(IF Statements) 12.2.4 CASE语句(CASE Statement) 12.2.5 FOR语句(FOR Statement) 12.2.6 WHILE语句(WHILE Statement) 12.3.7 REPEAT语句(REPEAT Statement) 12.2.9 EXIT语句(EXIT Statement) 12.2.10 GOTO语句(GOTO Statement) 12.2.11 RETURN语句(RETURN Statement) 12.3.2 调用功能块(Calling Function Blocks) 12.3.3 调用功能(Calling Functions) 12.3.4 隐式定义参数 12.3 功能和功能块的调用 12.3.1 调用和参数传递(Call and Parameter Transfer) 12.2 控制语句 13 计数器和定时器 13.1 计数器 5
13.2 定时器 14 S7-SCL的标准函数 14.1 数据类型转换函数 14.2 数字类标准函数 14.1.1 转换数据类型(Converting Data Types) 14.1.2 隐式数据类型转换(Implicit Data Type Conversion) 14.1.3 显式数据类型转换的标准函数(Standard Functions for Explicit Data Type Conversion) 14.2.1 通用标准算术函数(General Arithmetic Standard Functions) 14.2.2 对数函数(Logarithmic Functions) 14.2.3 三角函数(Trigonometric Functions) 14.2.4 数字类标准函数举例(Examples of Numeric Standard Functions) 13.2.1 定时器函数(Timer Functions) 13.2.2 调用定时器函数(Calling Timer Functions) 13.2.3 提供参数合定时器函数(Supplying Parameters for Timer Functions) 13.2.4 输入和取得时间值(Input and Evaluation of a Time Value) 13.2.5 脉冲定时器(S_PULSE) Start Timer as Pulse Timer (S_PULSE) 13.2.6 脉冲扩展定时器(Start Timer as Extended Pulse Timer (S_PEXT)) 13.2.7 上电延时(闭合)定时器 Start Timer as On-Delay Timer (S_ODT) 13.2.8 保持型上电延时(闭合)定时器(S_ODTS) Start Timer as Retentive On-Delay Timer (S_ODTS) 13.2.9 断电延时(断开)定时器(S_OFFDT) Start Timer as Off-Delay Timer (S_OFFDT) 13.2.10 定时器函数的例子 Example of Timer Functions 13.2.11 选择正确的定时器(Selecting the Right Timer) ................................................................................................................................................... 169 .............................................................................................. 169 .......................................................................... 169 ................................ 171 ................................................. 172 ................................................... 173 ...................................... 173 ............................................. 174 . 175 ...................... 175 ................................................................... 176 ................................................................. 177 ............................................................................................................................................ 178 ............................................................................................................................... 178 ................................................................................ 178 ............................................................ 178 ... 179 ................................................................................................................................... 183 ............................................. 183 ........................................................................................ 184 .......................................................................................... 184 ........................................... 184 ..................................................................................... 185 .............................................. 185 ........................................................................................................................................... 186 ................................................................. 186 .................................................................... 188 ......................................... 189 ............................................... 190 ...................................................................................... 192 ............................................................................ 192 .................................................................................................................. 194 14.6.1 系统函数/功能块和标准库(System Functions/Function Blocks and the Standard Library) ............................................................................................................................................................... 194 ................................................................ 195 14.6.2 传递到组织块的接口(Transfer Interface to OBs) ......................................................................................................................................................... 197 ................................................................................................................................... 197 ......................................................................... 197 ........................................................................................................................... 198 .............................................. 199 ............... 200 ......................................... 202 .................................... 204 .............................................................................. 205 .................................................................................... 206 ............................................................................................................... 206 15.1.1 语法图概述(Overview of Syntax Diagrams) 15.1.2 规则(Rules) 15.1.3 在组词规则中使用的术语(Terms Used in the Lexical Rules) 15.1.4 格式符、分隔符和运算符(Formatting Characters, Separators and Operations) 15.1.5 关键字和预定义标识符(Keywords and Predefined Identifiers) 15.1.6 地址标识符和块关键字(Address Identifiers and Block Keywords) 15.1.7 非术语项概述(Overview of Non Terms) 15.1.8 语言符号概述(Overview of Tokens) 15.1.9 标识符(Identifiers) 14.4.1 串操作函数(Functions for String Manipulation) 14.4.2 串比较函数(Functions for Comparing Strings) 14.4.3 数据格式转换函数(Functions for Converting the Data Format) 14.4.4 字符串处理举例(Example of Processing Character Strings) 14.5 选值函数(Functions for Selecting Values) 14.5.1 选值函数(Functions for Selecting Values) 14.6 系统函数/功能块和标准库 14.3 标准位串函数(Bit String Standard Functions) 14.3.1 标准位串函数举例(Examples of Bit String Standard Functions) 14.4 串处理函数 15 语言描述 15.1 规范化语言描述 6
15.1.10 在S7-SCL中取名(Assigning Names in S7-SCL) 15.1.11 预定义的常量和标志(Predefined Constants and Flags) 15.2 组词规则 15.2.1 概述:组词规则(Overview: Lexical Rules) 15.2.2 标识符(Identifiers) 15.2.3 常量(Constants) 15.2.4 绝对地址(Absolute Addressing) 15.2.5 注释(Comments) 15.2.6 块属性(Block Attributes) 15.2.7 编译器选项(Compiler Options) .................................................................... 207 ................................................... 209 ............................................................................................................................................... 209 .......................................................................... 209 ............................................................................................................... 209 .................................................................................................................... 211 ........................................................................................... 214 .................................................................................................................. 216 ...................................................................................................... 216 ............................................................................................ 217 ............................................................................................................................................... 218 ........................................................................... 218 .................................................................................................................. 218 .................................................... 220 .................................................................... 223 .............................................................................................. 225 ....................................................................................................... 227 ................................................ 229 ............................................................................................. 230 ...................................................................................................................................................... 234 .................................................................................................................................................................... 237 15.3.1 概述:句法规则(Overview: Syntax Rules) 15.3.2 S7-SCL源文件的结构 15.3.3 声明部分的结构(Structure of the Declaration Sections) 15.3.4 在S7-SCL中的数据类型(Data Types in S7-SCL) 15.3.5 语句部分(Statement Section) 15.3.6 赋值(Value Assignments) 15.3.7 调用函数和功能块(Calling Functions and Function Blocks) 15.3.8 控制语句(Control Statements) 15.3 语法规则 16 技巧与秘诀 术语表 7
8
分享到:
收藏