code: public DevCmdHistory[] command_inout_history_2(final String command, int n) throws DevFailed,
  	    SystemException {
  	Util.out4.println("Device_2Impl.command_inout_history_2 arrived");
  
  	final String cmd_str = command.toLowerCase();
  
  	// Record operation request in black box
  	blackbox.insert_op(Op_Command_inout_history_2);
  
  	// Check that device supports this command
  	check_command_exists(cmd_str);
  
  	// Check that the command is polled
  	PollObj polled_cmd = null;
  	final Vector poll_list = get_poll_obj_list();
  	for (int i = 0; i < poll_list.size(); i++) {
  	    final PollObj poll_obj = (PollObj) poll_list.elementAt(i);
  	    if (poll_obj.get_type() == Tango_POLL_CMD && poll_obj.get_name().equals(cmd_str)) {
  		polled_cmd = poll_obj;
  	    }
  	}
  	if (polled_cmd == null) // NOT found
  	{
  	    Except.throw_exception("API_CmdNotPolled", "Command " + cmd_str + " not polled",
  		    "Device_2Impl.command_inout_history_2");
  	}
  
  	// Check that some data is available in cache
  
  	assert polled_cmd != null;
  	if (polled_cmd.is_ring_empty()) {
  	    Except.throw_exception("API_NoDataYet", "No data available in cache for command "
  		    + cmd_str, "Device_2Impl.command_inout_history_2");
  	}
  	// Set the number of returned records
  	final int in_buf = polled_cmd.get_elt_nb_in_buffer();
  	if (n > in_buf) {
  	    n = in_buf;
  	}
  
  	// return command result history
  	return polled_cmd.get_cmd_history(n);
      }
docs: --------------------------------------------------------------------------