Пример #1
0
        public readonly void Assert(FunctionCode functionCode)
        {
            if (FunctionCode != functionCode)
            {
                S7ProtocolException.ThrowUnexpectedFunctionCode(FunctionCode, functionCode);
            }

            if (Reserved != 0)
            {
                S7ProtocolException.ThrowIncorrectReserved(Reserved);
            }
        }
Пример #2
0
        public readonly void Assert(byte count)
        {
            if (FunctionCode != FunctionCode.Read)
            {
                S7ProtocolException.ThrowUnexpectedFunctionCode(FunctionCode.Read, FunctionCode);
            }

            if (ItemCount != count)
            {
                S7ProtocolException.ThrowUnexpectedItemCount(count, ItemCount);
            }
        }