How to get the field settings in drupal 7
You can use a combination of field API and taxonomy API functions to get this info:

$field_name = 'field_FIELD_NAME';

// Get the field info
$info = field_info_field($field_name);

// The link to the vocab is stored as it's machine name
$vocab_machine_name = $info['settings']['allowed_values'][0]['vocabulary'];

// Load the vocab by machine name
$vocab = taxonomy_vocabulary_machine_name_load($vocab_machine_name);

// Finally, get the vid
$vid = $vocab-&gt;vid;