IDlt698ReadFromCoreServer 方法 (Byte, Boolean, Boolean) |
命名空间: HslCommunication.Instrument.DLT.Helper
OperateResult<byte[]> ReadFromCoreServer( byte[] send, bool hasResponseData, bool usePackAndUnpack = true )
ModbusTcpNet modbus = new ModbusTcpNet( ); MelsecMcNet melsec = new MelsecMcNet( ); SiemensS7Net siemens = new SiemensS7Net( SiemensPLCS.S1200 ); // 创建一个管道 PipeTcpNet pipe = new PipeTcpNet( "192.168.0.100", 1000 ); pipe.OpenCommunication( ); // 叠加读写操作 OperateResult<byte[]> read_modbus = modbus.ReadFromCoreServer( pipe, SoftBasic.HexStringToBytes( "00 00 00 00 00 06 00 03 00 00 00 03" ), hasResponseData: true, usePackAndUnpack: true ); OperateResult<byte[]> read_melsec = melsec.ReadFromCoreServer( pipe, SoftBasic.HexStringToBytes( "50 00 00 FF FF 03 00 0D 00 0A 00 01 14 01 00 64 00 00 90 01 00 10" ), hasResponseData: true, usePackAndUnpack: true ); OperateResult<byte[]> read_siemens = siemens.ReadFromCoreServer( pipe, SoftBasic.HexStringToBytes( "03 00 00 24 02 F0 80 32 01 00 00 00 01 00 0E 00 05 05 01 12 0A 10 02 00 01 00 00 83 00 03 20 00 04 00 08 3B" ), hasResponseData: true, usePackAndUnpack: true ); pipe.CloseCommunication( );