S7数据类型和变量.pdf
文本预览下载声明
STEP 7数据类型和变量
SIMATIC S7 Date: 2010-7-30 SITRAIN Training for
Siemens AG 2001. All rights reserved. File: PRO2_05E.1 Automation and Drives
变量及数据类型含义
数据类型描述了数据基本特性
连续区域:例如:实际速度
“是/非” 特性:例如:扰动
数据类型建立:
允许范围
(INT:-32 768 ... +32 767,等等。)
允许使用的指令
(算术指令:+,- 等。)
存储器中位的表示方法抽象出的数据类型
Actual_speed: REAL
Set_speed: REAL
变量可以保存并在以后继续处理数值
扰动: BOOL
使能: BOOL
SIMATIC S7 Date: 2010-7-30 SITRAIN Training for
Siemens AG 2001. All rights reserved. File: PRO2_05E.2 Automation and Drives
变量特性及变量的声明
变量声明确定变量的如下特性:
符号名
数据类型
有效范围
声明类型变量可以:
在全局符号表中声明
(基本数据类型) Meas_point: ARRAY[1..10]
在全局数据块的声明表中进行声明 Meas_point[1]: Real
(所有数据类型) Meas_point[2]: Real
在逻辑块的声明表中进行声明 Meas_point[3]: Real
(OB,FB和FC)
Meas_point[10]: Real
SIMATIC S7 Date: 2010-7-30 SITRAIN Training for
Siemens AG 2001. All rights reserved. File: PRO2_05E.3 Automation and Drives
STEP 7数据类型概述
基本数据类型 • 位(Bit)数据类型(BOOL, BYTE, WORD, DWORD, CHAR)
(最长32位)
• 算术数据类型(INT, DINT, REAL)
显示全部