I have a problem regarding reading/writing structures to/from the OPC server.
The setup:
A B&R PLC running the OPC server.
The PLC defines a structure with two members, an integer and a boolean:
A variable of this structure is enabled in the server. I can read/write to each of the members using UaExpert.
Now! For my client (.NET/C# application), I have defined a class:
Code: Select all
public class TestTyp
{
public int IntegerValue { get; set; }
public bool BoolValue { get; set; }
}
Secondly, I want my client to be able to write an object of this class to the variable.
Such as the following pseudo code:
Code: Select all
TestTyp readValues = ReadVariable(node) as TestTyp;
TestTyp writeValues = new TestTyp(1338, true);
WriteVariable(writeValues);