V2/Cet/IO/Cet.IO.Protocols.Modbus/ModbusCodecBase.cs
/// <summary>
/// Extract the typical header for a request command (server-side)
/// </summary>
/// <param name="command"></param>
/// <param name="body"></param>
/// <returns>True if the data could be read</returns>
Extract the typical header for a request command (server-side)
Extract the typical header for a request command ( server - side )
internal static bool PopRequestHeader(
            ModbusCommand command,
            ByteArrayReader body)
        {
            if (body.CanRead(4))
            {
                command.Offset = body.ReadUInt16BE();
                command.Count = body.ReadInt16BE();
                command.QueryTotalLength += 4;
                return true;
            }
            else
            {
                return false;
            }
        }
internal static bool PopRequestHeader ( ModbusCommand command , ByteArrayReader body ) { if ( body . CanRead ( 4 ) ) { command . Offset = body . ReadUInt16BE ( ) ; command . Count = body . ReadInt16BE ( ) ; command . QueryTotalLength += 4 ; return true ; } else { return false ; } }
Extract the typical header for a request command (server-side)
Extract the typical header for a request command ( server - side )
True if the data could be read
True if the data could be read
command
ModbusCommand
None
body
ByteArrayReader
None