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); }
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); }