• {{item.name}}
工业自动化软件 {{item.name}}
{{item2.name}}
更多
常问问题

在 STEP 7 (TIA Portal) 的一个 S7-SCL 项目中如何定义常数?

star star star star star
5.0 分
文档编号:52258437| 文档类型:常问问题| 发布时间:2023年10月25日
  • 0
  • 294
  • 1
如何在 STEP 7(TIA Portal)中定义 S7-SCL 程序中的常量?

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.

  1. Open the block in the S7-SCL programming language, in this example FC1.
  2. Define your local user constants in the block interface under "Constant".
  3. Here you must define a data type for the use constants.
  4. 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.

  1. Open the PLC tags and switch to the "User constants" tab.
  2. 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


FAQ changes since last release

  • The FAQ has been revised and the video added

您可以前往全球资源库查看此文档:https://support.industry.siemens.com/cs/cn/zh/view/52258437


  • 评论
更多
  • 分享

    扫码分享

提示
您即将前往“全球技术资源库”。
“全球技术资源库”的用户名与本地支持中心(下载中心、技术论坛、找答案、1847工业学习平台)的用户名不通用。如果需要在全球技术资源库下载文档,您需要重新登录或注册。
确定

扫码进入移动端

信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。