Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ InTouch HMI

DText() 函数

  • Last UpdatedFeb 05, 2018
  • 1 minute read

在脚本中,通过使用 DText() 函数可以将布尔值转换为字符串值。您可以使用此函数来自定义消息显示动画链接。

此函数根据布尔值的值来返回不同的字符串值。

语法

result = Dtext (Boolean, stringtrue, stringfalse)

参数

Boolean

布尔值、离散标记名或布尔表达式。

stringtrue

Boolean 为真时要返回的字符串。字符串值、消息标记名或字符串表达式。

stringfalse

Boolean 为假时要返回的字符串。字符串值、消息标记名或字符串表达式。

示例

如果离散标记名 switch 为 TRUE,此脚本返回 “Running”;否则返回 “Stopped”。

DText(switch,"Running","Stopped")

此脚本根据离散标记 switch1 的值返回另一个离散标记 switch2 的“打开消息”与“关闭消息”。

DText(switch1,switch2.OnMsg,switch2.OffMsg)

In This Topic
Related Links