- {{item.name}}
在 STEP 7 (TIA Portal) 的一个 S7-SCL 项目中如何定义常数?
- 0
- 686
- 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
剩余80%未阅读,请登录后下载/查看文档
- 评论
-
分享
扫码分享
- 收藏 收藏
- 点赞 点赞
- 纠错 纠错
- STEP 7(TIA Portal)项目中的备份文件有何意义 ?
- 在 S7-SCL 中如何进行 SFC14 和 SFC15 ANY 参数的编程?
- PCS7中如何定制自定义消息的报警回路功能
- 如何把一个 WinCC flexible 创建的操作面板项目集成到一个 TIA Portal 项目中?
- 当通信模块 CM1242-5 的 GSD 文件在 DP 主站项目中配置时,在 S7-1200 的项目中如何设置传输区域的一致性?
- 如何在 WinCC flexible 或 WinCC (TIA Portal) 项目中插入变频器 (SINAMICS 和 MICROMASTER) 的错误信息?
- 如何在 WinCC flexible 或 WinCC (TIA Portal) 项目中插入变频器 (SINAMICS 和 MICROMASTER) 的错误信息?
- 如何在WinCC (TIA Portal) Runtime Advanced项目中以XML格式导入和导出数据?
- 在WinCC(TIA Portal)项目中,如何正确的使用面板,模板,弹出窗口和滑入窗口?
- 在 STEP 7 (TIA Portal) 中如何从一个数据块复制存储区和结构体数据到另一个数据块?
{{item.nickName}}