Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

C# PISDK ServerEvents Exapmle

$
0
0

Hi everyone!

How to subscribe to events PI SDK models in C#?

Can show the correct example?

 

This example causes the error.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            PISDK.PISDK mysdk = new PISDK.PISDK();
            PISDK.Server mysrv = mysdk.Servers.DefaultServer;

            mysrv.Events.OnClose += new PISDK._DServerEvents_OnCloseEventHandler(Events_OnClose);

            mysrv.Close();
            Console.ReadLine();
        }

        static void Events_OnClose(string OldUser)
        {
            Console.WriteLine("test");
        }
    }
}

Err:

 

 

Attached Images

  • Err_events_PISDK.PNG

Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>