示例#1
0
 public override void ClientDecode(
     ModbusCommand command,
     ByteArrayReader body)
 {
     ModbusCodecBase.PopRequestHeader(
         command,
         body);
 }
示例#2
0
 public override void ServerEncode(
     ModbusCommand command,
     ByteArrayWriter body)
 {
     ModbusCodecBase.PushRequestHeader(
         command,
         body);
 }
示例#3
0
 public override void ServerEncode(
     ModbusCommand command,
     ByteArrayWriter body)
 {
     ModbusCodecBase.PushDiscretes(
         command,
         body);
 }
示例#4
0
 public override void ClientDecode(
     ModbusCommand command,
     ByteArrayReader body)
 {
     ModbusCodecBase.PopDiscretes(
         command,
         body);
 }
        public override void ServerDecode(
            ModbusCommand command,
            ByteArrayReader body)
        {
            ModbusCodecBase.PopRequestHeader(
                command,
                body);

            command.Data              = new ushort[command.Count];
            command.QueryTotalLength += 2;
        }
示例#6
0
        public override void ServerDecode(
            ModbusCommand command,
            ByteArrayReader body)
        {
            ModbusCodecBase.PopRequestHeader(
                command,
                body);

            ModbusCodecBase.PopDiscretes(
                command,
                body);
        }
示例#7
0
        public override void ClientEncode(
            ModbusCommand command,
            ByteArrayWriter body)
        {
            ModbusCodecBase.PushRequestHeader(
                command,
                body);

            ModbusCodecBase.PushDiscretes(
                command,
                body);
        }
示例#8
0
        public override void ClientEncode(
            ModbusCommand command,
            ByteArrayWriter body)
        {
            ModbusCodecBase.PushRequestHeader(
                command,
                body);

            var count = command.Count;

            body.WriteByte((byte)(count * 2));
            for (int i = 0; i < count; i++)
            {
                body.WriteUInt16BE(command.Data[i]);
            }
        }
示例#9
0
        public override void ServerDecode(
            ModbusCommand command,
            ByteArrayReader body)
        {
            ModbusCodecBase.PopRequestHeader(
                command,
                body);

            var count = body.ReadByte() / 2;

            command.Data              = new ushort[count];
            command.QueryTotalLength += (count + 3);

            for (int i = 0; i < count; i++)
            {
                command.Data[i] = body.ReadUInt16BE();
            }
        }