We've eliminated these issues by always writing the camera settings to the camera when the code starts.
We do this with a csv file that has a list of all the attributes that we care about stored on the roboRIO. When the code loads we loop through each setting and set the camera accordingly.
The list of attributes and the list for the csv I have saved in a google doc
here. Each tab has some different info, the 'optimal settings' I listed is for the vision tracking and not good for viewing. The 'Values for CSV' tab is a copy of the actual csv file that we send to the robot.
I've attached the LabVIEW code we used, I do not know the equivalent IMAQ function, but it may give you an idea.
