# File lib/nxt_comm.rb, line 380
  def get_output_state(port)
    cmd = [port]
    result = send_and_receive @@op_codes["get_output_state"], cmd

    if result
      result_parts = result.from_hex_str.unpack('C6V4')
      (7..9).each do |i|
        result_parts[i] = result_parts[i].as_signed if result_parts[i].kind_of? Bignum
      end
    
      {
        :port               => result_parts[0],
        :power              => result_parts[1],
        :mode               => result_parts[2],
        :reg_mode           => result_parts[3],
        :turn_ratio         => result_parts[4],
        :run_state          => result_parts[5],
        :tacho_limit        => result_parts[6],
        :tacho_count        => result_parts[7],
        :block_tacho_count  => result_parts[8],
        :rotation_count     => result_parts[9]
      }
    else
      false
    end
  end