コード例 #1
0
        protected ErrorCode SetCommand(DecimalCommand command, decimal value)
        {
            if (command == null)
            {
                return(ErrorCode.InvalidSettingId);
            }

            WaitDecimalCommandListener listener = new WaitDecimalCommandListener();

            Context.Communicator.SetValue <decimal>(command, value, listener, 0);
            ErrorCode?error;

            listener.Get(out error);
            return(error ?? ErrorCode.NoError);
        }
コード例 #2
0
        protected decimal QueryCommand(DecimalCommand command)
        {
            if (command == null)
            {
                return(0);
            }

            WaitDecimalCommandListener listener = new WaitDecimalCommandListener();

            Context.Communicator.QueryValue <decimal>(command, 0, listener);
            ErrorCode?error;
            decimal?  value = listener.Get(out error);

            return(value ?? 0);
        }