This VI compares an input value to an alarm level and holds the alarm on for a specific set of time. Inputs include reset, value, msecs to hold on, and alarm level. Outputs include boolean in alarm value.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.