While various warning lights existed before 1996, all vehicles 1996 later must conform to a set of Federal standards known as "OBDII". The way in which the light behaves is a matter of Federal law. It has nothing to do with oil change reminders, being late on taking the vehicle in for service, or things like that. It is illuminated when the vehicle management system feels there may be a problem with the system, and specifically with anything related to emissions. In most cases whatever problem the system thinks is happening has to have already happened twice, under similar conditions, for the light to be illuminated. Certain potential problems are severe enough that even occurring once will be enough. If the severest of issues arises, a potentially catalyst damaging misfire is occurring, then the light will flash. The light never comes on because "of a glitch". Automotive manufacturers would like to never turn the light on, but they are required by Emission laws to do so.
Additionally, how the light is turned off is also a matter of law. If a problem occurs once a trouble code may be set. If the same problem occurs again, under similar conditions, the light may be turned on. If the problem does not occur again after three drive cycles, under the same conditions, then the light will be extinguished. The code will still remain for a number of engine starts, depending on the classification of the code.
If the light has been on, but went off, there may be codes left in the system. Those can be helpful for diagnosing the problem. If the light is on, it doesn't mean the problem is occurring right at that moment, and sometimes the problem can be a little more difficult to diagnose. Sometimes testing can be done without reproducing the problem, but in most cases that will be one of our first steps.
Trouble codes are the vehicle's management system's way of alerting the driver, and the technician, as to what area the failure may be in. A trouble code is like a complaint. It is up to a technician to diagnose that complaint -- find out what the root cause of the code is, and determine the proper course of action. Vehicles are very sophisticated and use a variety of methods to cross-check its own operations. Sometimes if there is a bad sensor it can mislead the vehicle management system, and the vehicle management system can complain in such a way that can further mislead the customer and/or technician. This is why a quality diagnosis by an educated and well tooled professional is the only sure way to find the root cause and proper fix for the problem at hand. Determing the trouble code is only one small step.
An example might be when a vehicle has a misfire code. Take, for instance, a Ford F150 that had a Check Engine Light on, and would misfire intermittently. The customer brought it to us and we found two codes stored, a P0307 and a P0316.
A complete and effective diagnosis completed with professional tooling, training, experience, and execution. This is just a simple example of what it takes to accurately diagnose Check Engine Light related problems.