-
//
I understand that the Encode Decode method operates when reading/writing in the "EncodeableObject" inherited class. It was confirmed that the "Encode" method was called during "Session.Write" and the data was converted. However, in the case of "Session.Read", "Decode" does not seem to be called. If you try to cast the read data to a structure, "System.InvalidCastException: 'Unable to cast object of type 'System.Byte[]' to type 'OPCApp.Models.TestStruct'.'" occurs. What is the problem? When is "Decode" Method called? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I Solved it. |
Beta Was this translation helpful? Give feedback.
I Solved it.
need to register first before creating a session.
"EncodeableFactory.GlobalFactory.AddEncodeableType" before "Session.Create"