Solution
This error may occur because of the improper frame read setting. Depends on the codec of the AVI file, reading forward frames is needed. This is accomplished by specifying
Frame Read Lookahead input of IMAQ AVI Read Frame function (the default value is 0). So input numeric value (more than 0) in
Frame Read Lookahead can avoid this error. The proper numeric value depends on the codec of the AVI file.