I had to find out that this seems to be a documentation issue .
So here we are in VB.NET:
DimWithEvents _SrvDiscEv As PISDK._DServerDisconnectEvents_Event
Dim _PISrv As PISDK.Server
Dim _PISDK As PISDK.PISDK
PrivateSub _SrvDisk_OnDisconnect(ByVal PIServer As PISDK.Server) _
MsgBox("disconnected from " + PIServer.Name)
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
_PISrv = _PISDK.Servers.DefaultServer
_SrvDiscEv = _PISDK.Servers
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
_PISDK = New PISDK.PISDK()
hope this helps,
Any reason why the IServerDisconnect interface is not supported in the interop?
Seems that the .NET event handlers are different. This question started an internal discussion in the PI SDK team. If there is something interesting/usefull, I'll post it here.
When I asked about the differing code "exposure" from COM to the Interops at a recent vCampus webinar I think the answer I got back was that the code is present in the interops, it is just the intellisense that isn't working correctly (or something along those lines), which doesn't seem true.
Don't suppose I could get a written explanation from OSI on this one so I understand it better..?
Another example would be the "AddTags" method of the IPIPoints2 interface.
I'll check with Charlie - However, if I recall it right he mentioned that he had a look at the intreop with ILDASM - and if you do that with the OSIsoft.PISDK.dll you see that the IServerDisconnect does not expose an event while the _DServerDisconnectEvents_Event does.
Another example would be the "AddTags" method of the IPIPoints2 interface
This time the code example in PISDK works exactly as in .NET - what further explanation are you looking for?
I would like to reiterate Andreas' question about the IPIPoints2.AddTags method: can you give more information about the circumstances in which you cannot it? VS.NET version, language, OS, etc.? Are you able to reproduce reliably on other machines? It seems to be that may be a different issue that the former (secondary interface events required a different idl definition, I believe – the fact that "AddTags" does not show up for you may be IDE or project settings or cached information by your version of VS.NET – or you may be using VS.NET 2003 or some such). Did you check your references? Version of .NET Framework: 1.1 or 2.0/3.x?
Ooops, sorry didn't follow this one up.
I am trying to remember what setup I had when I only saw an "Add" method and no "AddTags" for the interface IPIPoints2. I was using virtual machines so just discarded the VM once I butchered it - from memory it was Vista, .Net 2.0, PI-SDK 1.3.4 (I think!), C#. I notice now that on 2 or 3 other VM's that the AddTags method is present so maybe I was just having one of those days