PI SDK连接服务器和读取PI测点数据

本文提供了一个使用C#连接PI服务器并获取特定标签实时数据的示例代码。通过该示例,读者可以了解到如何利用PI SDK进行登录、选择点位及读取快照值等基本操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

见下面的例子,使用C#:


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


namespace pisdk_t1
{
    class Program
    {
        static void Main(string[] args)
        {
            PISDK.PISDK pisdk = new PISDK.PISDK();
            
            //连接PI服务器
            Server svr = pisdk.Servers["192.168.55.220"];
            
            //login
            svr.Open("UID=piadmin;PWD=");

            PIPoints points = svr.PIPoints;

            PIPoint point = points["DL_173"]; //tagname
            PIData data = point.Data;
            Console.WriteLine(data.Snapshot.Value); //输出snapshot值

        }
    }
}



PI数据库开发SDK例程 The introduction provides an architectural overview of how the PI-SDK fits into various programming environments. A description and simplified view of the PI-SDK object model is also presented. What Is the PI-SDK? The PI Software Development Kit (PI-SDK) is a programming tool providing access to PI Servers. The software consists of an ActiveX in-process server, an ActiveX control, and supporting code libraries. The kit comes with online documentation, example code, various support files, and tools. The PI-SDK runs on 32-bit Windows platforms and provides access to servers on all PI platforms. Based on Microsoft’s Component Object Model (COM), the PI-SDK can be used with most WIN32 programming environments. The kit is particularly well integrated with Microsoft Visual Basic providing rapid development and deployment of PI applications. The PI-SDK provides an object-oriented approach to program interaction with PI Systems. It delivers a hierarchical model of objects and collections representing the components of PI Servers. This approach provides for intuitive and efficient access. What Documentation Is Provided? The PI-SDK User Guide and the PI-SDK Programming Reference are the primary sources for information related to the PI-SDK. Both are incorporated in the online help system. A version of the user guide in MS Word format is also installed during the setup for printing or for use in training programs. Programming Reference Detailed programming references for properties and methods of each object in the PI-SDK and the PI-SDK Control and Dialogs are available in online help. Most methods provide an example of their usage in Visual Basic. Other code examples, including examples of calling the PI-SDK
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值