public override void ServerEncode(
     ModbusCommand command,
     ByteArrayWriter body)
 {
     ModbusCodecBase.PushDiscretes(
         command,
         body);
 }
Exemplo n.º 2
0
 public override void ServerEncode(
     ModbusCommand command,
     ByteArrayWriter body)
 {
     ModbusCodecBase.PushRequestHeader(
         command,
         body);
 }
 public override void ClientDecode(
     ModbusCommand command,
     ByteArrayReader body)
 {
     ModbusCodecBase.PopDiscretes(
         command,
         body);
 }
Exemplo n.º 4
0
 public override void ClientDecode(
     ModbusCommand command,
     ByteArrayReader body)
 {
     ModbusCodecBase.PopRequestHeader(
         command,
         body);
 }
Exemplo n.º 5
0
        public override void ClientEncode(ModbusCommand command, ByteArrayWriter body)
        {
            ModbusCodecBase.PushRequestHeader(command, body);
            int count = command.Count;

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

            command.Data              = new ushort[command.Count];
            command.QueryTotalLength += 2;
        }
Exemplo n.º 7
0
        public override void ServerDecode(ModbusCommand command, ByteArrayReader body)
        {
            ModbusCodecBase.PopRequestHeader(command, body);
            int length = (int)body.ReadByte() / 2;

            command.Data              = new ushort[length];
            command.QueryTotalLength += length + 3;
            for (int index = 0; index < length; ++index)
            {
                command.Data[index] = body.ReadUInt16BE();
            }
        }
Exemplo n.º 8
0
        public override void ServerDecode(
            ModbusCommand command,
            ByteArrayReader body)
        {
            ModbusCodecBase.PopRequestHeader(
                command,
                body);

            ModbusCodecBase.PopDiscretes(
                command,
                body);
        }
Exemplo n.º 9
0
        public override void ClientEncode(
            ModbusCommand command,
            ByteArrayWriter body)
        {
            ModbusCodecBase.PushRequestHeader(
                command,
                body);

            ModbusCodecBase.PushDiscretes(
                command,
                body);
        }
Exemplo n.º 10
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 * 2 + 3);

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