Arduino Timeout / Interrupts

I have many Arduino boards I'm programming to do the same thing. However they all have a varied number of sensors on them 1 - 5. I want to make the code the Arduino runs the same no matter how many sensors. The problem is my code goes down the line getting readings from sensor1, sensor2, and so on. If a board only has one sensor on it and the board asks for sensor2's readings then my program sits and waits for the readings that will never come. Is there a way to tell the arduino if a process is talking more then lets say 2 minutes then move on to the next sensor? I think an interrupt could be used, but I've never used one.

Well, you really haven't given us a lot to go on there, so I'll just say "yes".

The problem is my code goes down the line getting readings from sensor1, sensor2, and so on.

If the sensors are consecutive ie always have #1 then 2 then 3 etc, then just have a constant that tells the code how many there are

#define N_SENSORS 3

for (int i = 0; i < N_SENSORS; i++)
    read_sensor(i);

if they can be any combination then something like

#define MAX_SENSORS 6

byte sensors[] = {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE};

for (int i = 0; i < MAX_SENSORS; i++) {
    if (sensors[i])
        read_sensor(i);
}

Rob