Login  •  Register


Raading a matrix

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Raading a matrix

Postby moff » 18 Jan 2019, 11:25

Hi,

How can I read a two dimensional variant matrix?

Many Thanks
moff
Newbie
Newbie
 
Posts: 7
Joined: 13 Sep 2016, 12:32

Re: Raading a matrix

Postby moff » 18 Jan 2019, 15:42

Hi, I found the solution: cast to Matrix and use ToArray:

var uaMatrix = m_DataValue.Value as Matrix;
var data = uaMatrix.ToArray();

Then iterate and GetValue:

for (var i = 0; i < uaMatrix.Dimensions[0]; i++)
{
for (var j = 0; j < uaMatrix.Dimensions[1]; j++)
{
var uaValue = (Variant)data.GetValue(i, j);
..
:-)
moff
Newbie
Newbie
 
Posts: 7
Joined: 13 Sep 2016, 12:32


Return to .NET based OPC UA SDK

Who is online

Users browsing this forum: No registered users and 1 guest

cron