- {{item.name}}
在 STEP 7 (TIA Portal) 的一个 S7-SCL 项目中如何定义常数?
- 0
- 1126
- 1
How do you define the constants in an S7-SCL program in STEP 7 (TIA Portal)?
Instructions
In this video we will show you how you can define the constants in an S7-SCL program in STEP 7 (TIA Portal).
The definition of the constants in S7-SCL is different in the TIA Portal and in STEP 7 V5.x Classic. In STEP 7 V5.x Classic you can only define the local constants in the declaration part of the SCL block code and use them in the program.
In STEP 7 (TIA Portal) it is not possible to define constants in the declaration part of the SCL program code. STEP 7 (TIA Portal) differentiates between local and global user constants that you can define in the block interface or in the PLC tags.
- Open the block in the S7-SCL programming language, in this example FC1.
- Define your local user constants in the block interface under "Constant".
- Here you must define a data type for the use constants.
- You can then use the constants in the block program and create your program.
Only use local constants within a block. In this way the block remains universal and can be used in a library.
You define the global user constants, which are to be available CPU-wide, in the PLC tags.
- Open the PLC tags and switch to the "User constants" tab.
- Define your global constants. You must also specify the data type when defining the global user constants.
This allows you to define constants that have a fixed value that cannot change during program runtime.
Further Information
you will find under
- How do you define the "TRUE" constant in the LAD/FDB editor in STEP 7 (TIA Portal)?
- What is the meaning of the system constants in STEP 7 (TIA Portal) with S7-1200/S7-1500?
FAQ changes since last release
- The FAQ has been revised and the video added
您可以前往全球资源库查看此文档:https://support.industry.siemens.com/cs/cn/zh/view/52258437
- 评论
- 收藏 收藏
- 点赞 点赞
- 纠错 纠错
关联文档
- PCS7中如何定制自定义消息的报警回路功能
- 如何把一个 WinCC flexible 创建的操作面板项目集成到一个 TIA Portal 项目中?
- 如何在 WinCC flexible 或 WinCC (TIA Portal) 项目中插入变频器 (SINAMICS 和 MICROMASTER) 的错误信息?
- PCS 7项目中如何设置正确的语言选项
- 如何定义Simotion的系统循环时钟
- 怎样从 STEP 7 项目中分离集成的 WinCC 项目,并作为一个独立的 WinCC 项目?
- 如何手动安装STEP 7 V11项目中包含的GSD文件
- 在STEP 7 (TIA Portal)的硬件目录中无法找到S7-1500 CPU的固件版本时,如何加载项目数据?
- 在 STEP7(TIA博途) 项目中,使用块编辑器中打开项目后,为什么已有的文本、标题和注释不再显示?
- 在WinCC (TIA Portal) 中如何通过控制器实现画面的切换?
看过该文档的用户还看过哪些文档


西门子官方商城




{{item.nickName}}