使用Visual Basic脚本引擎在Cimplicity中获取点

时间:2014-03-04 11:16:41

标签: vb.net dynamic-variables

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

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)
问题是,这些点不能定义为数组。有人会发现我的问题吗?非常感谢任何开放的想法。谢谢

1 个答案:

答案 0 :(得分: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
...