1

我想使用基本脚本引擎从我从控制系统连接的点获取值。问题是有很多点,所以我想建立一个有点像下面的循环:

For i As New Points = 0 To 70
     Dim Para + i  AS OracleParameter
    PointGet("SST(i)_H_MTR")

Next i

而不是这样做:

dim SST01 as New Points
dim SST02 as New Points
dim SST03 as New Points

pointget(SST01_H_MTR)
pointget(SST02_H_MTR)
pointget(SST03_H_MTR)

问题是,不能将点定义为数组。有人会发现我有同样的问题吗?非常感谢任何开放的想法。谢谢

4

1 回答 1

0

我知道这是旧的,但给你。

Dim ptMTR as New Point
Dim pointName as String
Dim pointType as String
Dim MTR_Value as Integer
Dim i as Integer

pointType = "_H_MTR"

For i = 0 To 70
   if i < 10 then
     pointName = "SST0"
   else
     pointName = "SST"
   end if

   ptMTR.Id = pointName + cstr(i) + pointType
   MTR_Value = ptMTR.GetValue

  'Write code to use the point value here

  'Go get the next point value

next i
...
于 2014-09-10T21:38:30.603 回答