• 大小: 15.63MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-07-20
  • 语言: 其他
  • 标签: c#  redis  scada  

资源简介

HSL安装源码 需要的可以自行下载哦 非常好用的额 支持多款plc

资源截图

代码片段和文件信息

import HslCommunication.Core.Net.NetHandle;
import HslCommunication.Core.Transfer.DataFormat;
import HslCommunication.Core.Types.ActionOperateExThree;
import HslCommunication.Core.Types.ActionOperateExTwo;
import HslCommunication.Core.Types.OperateResult;
import HslCommunication.Core.Types.OperateResultExOne;
import HslCommunication.Enthernet.ComplexNet.NetComplexClient;
import HslCommunication.Enthernet.PushNet.NetPushClient;
import HslCommunication.Enthernet.SimplifyNet.NetSimplifyClient;
import HslCommunication.ModBus.ModbusTcpNet;
import HslCommunication.Profinet.Melsec.MelsecMcAsciiNet;
import HslCommunication.Profinet.Melsec.MelsecMcNet;
import HslCommunication.Profinet.Melsec.MelsecA1ENet;
import HslCommunication.Profinet.Siemens.SiemensPLCS;
import HslCommunication.Profinet.Siemens.SiemensS7Net;

import java.util.Arrays;

public class Main {

    public static void main(String[] args) {

        //NetSimplifyClientTest();

        //MelsecA1ETest();
        //MelsecTest();
        //PushNetTest();

        //ModbusTcpTets();
        //SiemesTest();



        try {
            //Constructor[] aa = Integer.class.getDeclaredConstructors();
            //int i = (Integer) (aa[1].newInstance(“1“));
            //System.out.println(Utilities.bytes2HexString( Utilities.getBytes(String.format(“%04x“100)“ASCII“)));
            //System.out.println(i);

            //System.out.println(Arrays.toString(“123“.split(“\\.“ )));
            //ModbusTcpTets();
            //MelsecMcNet melsec_net = new MelsecMcNet(“192.168.8.12“ 6001);
            //System.out.println(melsec_net.ReadInt16(“D100“).Content);

            //SiemensS7Net siemensS7Net = new SiemensS7Net(SiemensPLCS.S1200“192.168.8.12“);
            //OperateResult write = siemensS7Net.Write(“M200“(short)200);

            //if(!write.IsSuccess){
                //System.out.println(“Write failed:“+write.Message);
            //}

            //OperateResultExOne read = siemensS7Net.ReadInt16(“M200“);
            //if(read.IsSuccess){
                //System.out.println(“Value:“+read.Content.toString());
            //}
            //else {
                //System.out.println(“Read failed:“+read.Message);
            //}
            ModbusTcpNet modbus = new ModbusTcpNet(“127.0.0.1“503(byte)1);
            OperateResultExOne read = modbus.ReadCoil(“100“);
            if(read.IsSuccess){
                System.out.println(“Value:“+read.Content.toString());
            }
            else {
                System.out.println(“Failed:“+read.Message);
            }
        }
        catch (Exception ex){
            System.out.println(ex.getMessage());
        }

        try {
            Thread.sleep(1000);
        } catch (Exception ex) {

        }
    }


    public static void NetSimplifyClientTest() {
        NetSimplifyClient client = new NetSimplifyClient(“127.0.0.1“ 12345);

        OperateResultExOne read = client.ReadFromServer(new NetHandle(2) “测试数据“)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-11 08:10  HslCommunication\
     文件        2518  2019-03-11 08:10  HslCommunication\.gitattributes
     文件        4305  2019-03-11 08:10  HslCommunication\.gitignore
     目录           0  2019-03-11 08:10  HslCommunication\Download\
     文件     2851231  2019-03-11 08:10  HslCommunication\Download\HSLSharp.zip
     文件      152610  2019-03-11 08:10  HslCommunication\Download\HslCommunication.jar
     文件     1046787  2019-03-11 08:10  HslCommunication\Download\HslCommunication.zip
     文件      750872  2019-03-11 08:10  HslCommunication\Download\HslCommunicationDemo.zip
     文件      946460  2019-03-11 08:10  HslCommunication\Download\ModbusTcpServer.zip
     文件      760592  2019-03-11 08:10  HslCommunication\Download\PushNetServer.zip
     目录           0  2019-03-11 08:10  HslCommunication\Help\
     文件     6927008  2019-03-11 08:10  HslCommunication\Help\HslCommunication.chm
     文件        9357  2019-03-11 08:10  HslCommunication\HslCommunication.sln
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\
     文件         425  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\HslCommunication.iml
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Basicframework\
     文件        6633  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Basicframework\SoftBasic.class
     文件         956  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Basicframework\SoftIncrementCount.class
     文件         325  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Basicframework\SoftSecurity.class
     文件        1645  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Basicframework\SoftZipped.class
     文件        2854  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Basicframework\SystemVersion.class
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Core\
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Core\Address\
     文件         937  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Core\Address\DeviceAddressbase.class
     目录           0  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Core\IMessage\
     文件        1600  2019-03-11 08:10  HslCommunication\HslCommunication_Java\HslCommunication\out\production\HslCommunication\HslCommunication\Core\IMessage\FetchWriteMessage.class
............此处省略1004个文件信息

评论

共有 条评论