Break from while statement after 30 seconds run time

I have an rfid reader looking for an rfid tag. I want the reader to turn on and begin looking for a tag. After 30 seconds of looking I want the reader to stop looking. I am trying to do this with while statements but it just runs forever and never breaks out of the while statement. Here is my code:

 //set break millis
    ScannerBreak = millis();
    Serial.println("HI");
    while (ScannerBreak + 30000 > millis()&& responseType != RESPONSE_SUCCESS){
     while (responseType != RESPONSE_SUCCESS)//RESPONSE_IS_TAGFOUND)
    {
    myEPClength = sizeof(myEPC); //Length of EPC is modified each time .readTagEPC is called
    responseType = nano.readTagEPC(myEPC, myEPClength, 500); //Scan for a new tag up to 500ms
    Serial.println("Hit hard");
    }
   }

Response type is a boolean and response success is a read tag.
The first while statement is the timer and the second is the reader.

Hello.
Put a 'Serial.print("Reading…");' before and 'Serial.println("Done");' after the second while statement to see if which loops is stuck. I'm think that 'responseType' never equals 'RESPONSE_SUCCESS'

You don't need the second while loop since the first one already covers the second's condition.

Generally speaking though, for all but the simplest applications, you don't want to block your sketch waiting on just one thing.

Zaszigre:
Hello.
Put a 'Serial.print("Reading…");' before and 'Serial.println("Done");' after the second while statement to see if which loops is stuck. I'm think that 'responseType' never equals 'RESPONSE_SUCCESS'

Why not print responseType and find out what it is?

Delta_G:

ScannerBreak + 30000 > millis()&

This has a bug every 49 days. If this is for long term use then write like.

while(millis()-ScannerBreak<30000

Then get rid of the next line. That compound while is checking for both things. But inside you've got a while loop only checking for success on the read so it never comes back out to check the time.

I will be resetting the hardware every 14 days. So this should not be an issue.

arduarn:
You don't need the second while loop since the first one already covers the second's condition.

Generally speaking though, for all but the simplest applications, you don't want to block your sketch waiting on just one thing.

This is true. However when I write the code like this

While (responseType != RESPONSE_SUCCESS, ScannerBreak + 30000 >= millis()

Even if it does detect a tag it still waits for 30 seconds. I need a way for the code to detect the tag OR wait 30 seconds and then continue. If I write it in the manner stated above even if a tag is detected it continues waiting.

Delta_G:
Did you really just put a comma between them? That won't work.

And additionally, that's not what you had in your original post.

Delta_G:
Did you really just put a comma between them? That won't work.

My code loads up with a comma, can you expand your thoughts?

cledfo11:
I will be resetting the hardware every 14 days. So this should not be an issue.

Don't start a bad habit - take Delta_G's advice. Remember that others may eventually learn from your code...

Delta_G:
The comma means "evaluate the first thing but ignore the result and only pay attention to the second thing." Is that what you want? Usually you join conditions with &&. (and) or || (or).

Thats what I need is the ||, I thought the single line was the OR.