This is probably a dumb question, but.... is there a simple way to create and initialize a blank PISDK.PIValue object?
I have tried creating an object as follows:
Dim n As New PISDK.PIValue
n.ValueAttributes = New PISDKCommon.NamedValues
n.TimeStamp = New PITimeServer.PITime
n.Value = 25
but no matter what I try, I can't seem to initialize it correctly. It dies on the SetToCurrent line with the error "PIValue is not properly initialized".
What I have resorted to as a workaround is to start with an existing PIValue, like this:
Public Function GetBlankPIValue() As PISDK.PIValue
and then overwrite the value and timestamp.