使用搜索功能查看 Kepware 的信息库,其中包含 500 多篇知识库文章。缩小搜索结果范围,或在下面的搜索字段中输入您的查询。

或者,如果您无法找到解决方案,我们还有另一个资源:我们的 PTC eSupport Portal。 如果系统提示您登录 eSupport Portal,您可以使用“我的 Kepware”凭据。需要一个“我的 Kepware”帐户吗?在此处创建

搜索解决方案结果:
View All Solutions

Kepware Knowledge Base: Solution


Unable to Read a Multi-Dimensional Array from an OPC Server in VB.Net


Last Update: 2018/11/7

Problem:
This issue only applies to ClientAce projects written in VB.Net.

  • In ClientAce V1.0, a server item returned a two-dimensional array of data, but the item's Value Variable cannot be parsed.
  • In ClientAce V3.5, a server item returned a two-dimensional array of data, but the item's Value Variable is not in the correct array format.
  • In ClientAce V4.0, a server item returned a two-dimensional array of data, but the item's Value Variable is not in the correct array format.

Possible Cause:
The issue results from the way that VB.Net sees the SafeArray being passed from the unmanaged communication code layer to the .Net layer. Projects written with C# will not have problems.

Solution:
For the purpose of this explanation, the example array from the server will be a 2x5 array configured with the the following values:

01234
56789

1. For projects written against ClientAce V1.0, the array is unrecognizable. The best solution for users developing with this version is to upgrade to ClientAce V3.5 or V4.0.
2. In ClientAce V3.5 projects, the row and column indices are reversed to be 5x2, with the values appearing as follows:

01
23
45
67
89

3. In ClientAce V4.0 projects, the array is again reversed but the element values are presented as follows:

05
16
27
38
49

Note: As long as developers are aware of the Microsoft limitations, the array data can be processed.

Related Products
ClientAce