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

AVEVA™ InTouch HMI

作为脚本参数传递的数字

  • Last UpdatedSep 24, 2024
  • 1 minute read

当数字字符串用引号括起来作为参数传递时,含有 SignedWrite() 函数的脚本会遇到相似的千位分隔符解释问题。

示例

SignedWrite("AO1.PV1","8.456,56","",true,1,null);

用引号括起来的数字值被当作字符串数据类型,并且逗号千位分隔符被解释为参数分隔符。如果运行可视化应用程序的计算机的区域语言环境设置为德国,该脚本会错误地将 8.46 写入属性。

替代解决方案

使用以模拟数据类型代替字符串的自定义属性。

SignedWrite("AO1.PV1",CP1,"",true,1,null);

其中 CP1=8.456,56 由用户在运行时设置。