• 大小: 4.79M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-03
  • 语言: C#
  • 标签: SCADA  修复  源码  C#  

资源简介

C# SCADA源码修复,完全可用

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
using System.Timers;
using DataService;
using Tuxeip;

namespace ABPLCDriver
{
    [Description(“EtherNet IP协议“)]
    public unsafe class ABEtherNetReader : IPLCDriver
    {
        Eip_Connection* connection;
        Eip_Session* session;
        byte _rack = 1;
        byte _slot;
        string _ip;

        short _id;
        public short ID
        {
            get
            {
                return _id;
            }
        }

        public bool IsClosed
        {
            get
            {
                return connection == null || session == null;
            }
        }

        public int PDU
        {
            get
            {
                return 492;
            }
        }

        int _timeOut = 1000;
        public int TimeOut
        {
            get
            {
                return _timeOut;
            }
            set
            {
                _timeOut = value;
            }
        }

        string _name;
        public string Name
        {
            get
            {
                return _name;
            }
        }

        public string ServerName
        {
            get
            {
                return _ip;
            }
            set
            {
                _ip = value;
            }
        }


        public byte Rack
        {
            get
            {
                return _rack;
            }
            set
            {
                _rack = value;
            }
        }

        public byte Slot
        {
            get
            {
                return _slot;
            }
            set
            {
                _slot = value;
            }
        }

        public ABEtherNetReader(IDataServer server short id string name)
        {
            _id = id;
            _server = server;
            _name = name;
        }

        public bool Connect()
        {
            try
            {
                if (session != null) Dispose();
                session = Tuxeip_Class.OpenSession(_ip);
                byte[] path = new byte[] { _rack _slot };
                if (session != null)
                {
                    int res = Tuxeip_Class._RegisterSession(session);
                    connection = Tuxeip_Class.ConnectPLCOverCNET(session Plc_Type.LGX path);
                }
                return (session != null && connection != null);
            }
            catch (Exception error)
            {
                if (onerror != null)
                {
                    onerror(this new IOErrorEventArgs(error.Message));
                }
                return false;
            }
        }

        List _groups = new List();
        public IEnumerable Groups
        {
            get { return _groups; }
        }

        IDataServer _server;
        public IDataServer Parent

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-05-04 13:17  SharpSCADALite-master\
     文件         439  2019-05-04 13:17  SharpSCADALite-master\.gitignore
     目录           0  2019-05-04 13:17  SharpSCADALite-master\ABPLCReader\
     文件       17224  2019-05-04 13:17  SharpSCADALite-master\ABPLCReader\ABPLCDriver.cs
     文件        7545  2019-05-04 13:17  SharpSCADALite-master\ABPLCReader\ABPLCDriver.csproj
     目录           0  2019-05-04 13:17  SharpSCADALite-master\ABPLCReader\Properties\
     文件        1398  2019-05-04 13:17  SharpSCADALite-master\ABPLCReader\Properties\AssemblyInfo.cs
     文件        6885  2019-05-04 13:17  SharpSCADALite-master\ABPLCReader\Tuxeip_Class.cs
     文件        2715  2019-05-04 13:17  SharpSCADALite-master\ABPLCReader\Tuxeip_Struct.cs
     目录           0  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\
     文件         479  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\App.config
     文件        4408  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\BatchCoreTest.csproj
     文件       41662  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\DAService.cs
     文件        4535  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\Program.cs
     目录           0  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\Properties\
     文件        1725  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\Properties\AssemblyInfo.cs
     文件        2809  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\Properties\Resources.Designer.cs
     文件        5496  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\Properties\Resources.resx
     文件        1090  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\Properties\Settings.Designer.cs
     文件         195  2019-05-04 13:17  SharpSCADALite-master\BatchCoreTest\Properties\Settings.settings
     目录           0  2019-05-04 13:17  SharpSCADALite-master\Bin\
     文件       28160  2019-05-04 13:17  SharpSCADALite-master\Bin\BatchCoreTest.exe
     文件         479  2019-05-04 13:17  SharpSCADALite-master\Bin\BatchCoreTest.exe.config
     文件       22688  2019-05-04 13:17  SharpSCADALite-master\Bin\BatchCoreTest.vshost.exe
     文件         479  2019-05-04 13:17  SharpSCADALite-master\Bin\BatchCoreTest.vshost.exe.config
     文件       19968  2019-05-04 13:17  SharpSCADALite-master\Bin\ClientDriver.dll
     文件       40448  2019-05-04 13:17  SharpSCADALite-master\Bin\ClientDriver.pdb
     文件       16896  2019-05-04 13:17  SharpSCADALite-master\Bin\CoreExample.dll
     文件       32256  2019-05-04 13:17  SharpSCADALite-master\Bin\CoreExample.pdb
     文件      218112  2019-05-04 13:17  SharpSCADALite-master\Bin\CoreTest.exe
     文件         160  2019-05-04 13:17  SharpSCADALite-master\Bin\CoreTest.exe.config
............此处省略438个文件信息

评论

共有 条评论