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

以下脚本通过一个简单的循环与一个间接标记,使用 0 值来重新初始化 100 个标记(Tag001 到 Tag100)。

DIM Counter AS INTEGER;

FOR Counter = 1 TO 100

IndirectInteger.Name = "Tag" + Text(Counter, "000");

IndirectInteger.Value = 0;

NEXT;

以下脚本通过两个嵌套的循环与一个间接标记,使用 0 来重新初始化 1000 个标记(Line01_Tag001 到 Line10_Tag100)。

DIM LineCounter AS INTEGER;

DIM TagCounter AS INTEGER;

FOR LineCounter = 1 TO 10

FOR TagCounter = 1 TO 100

IndirectInteger.Name = "Line" + Text(LineCounter, "00") + "_Tag" + Text(TagCounter, "000");

IndirectInteger.Value = 0;

NEXT;

NEXT;

Related Links