コード例 #1
0
ファイル: CommunicationSetup.cs プロジェクト: mycroes/Sally7
        public readonly void Assert(FunctionCode functionCode)
        {
            if (FunctionCode != functionCode)
            {
                S7ProtocolException.ThrowUnexpectedFunctionCode(FunctionCode, functionCode);
            }

            if (Reserved != 0)
            {
                S7ProtocolException.ThrowIncorrectReserved(Reserved);
            }
        }
コード例 #2
0
ファイル: ReadRequest.cs プロジェクト: mycroes/Sally7
        public readonly void Assert(byte count)
        {
            if (FunctionCode != FunctionCode.Read)
            {
                S7ProtocolException.ThrowUnexpectedFunctionCode(FunctionCode.Read, FunctionCode);
            }

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