I've implemented a solution into your program which should solve the problem.
It gives the on sequence a delay of 30 seconds.
Thanks, I will try it later after i get my daq card back. I thought need to use state machine in order to do this. I just wanted digital output(buzzer and led) turn on for 30 secs after getting signal from ir sensor. If I can put any value to turn on digital output will be great
A state machine could definitely handle your problem well. With all design patterns though, there is never one you must use, but some are more appropriate than others.
You may also want to think about what happens if you receive multiple triggers. Should the LED stay on for 30 seconds from the original trigger? Or should it reset the counter when a second trigger comes in? This is something that a simple "Wait (ms)" could not handle.